Compare commits
No commits in common. "b88d8caa226d757a6589cd7e73ec86f126413cc8" and "8004d78a367098a8878b26dd7b2882a5f5534c11" have entirely different histories.
b88d8caa22
...
8004d78a36
1 changed files with 19 additions and 41 deletions
60
cd.sh
60
cd.sh
|
@ -23,7 +23,7 @@ case "${CD_OS_NAME}" in
|
||||||
esac
|
esac
|
||||||
CD_STEP=0
|
CD_STEP=0
|
||||||
|
|
||||||
function cd_step {
|
function step {
|
||||||
if [ "${1}" ] ; then
|
if [ "${1}" ] ; then
|
||||||
((CD_STEP++))
|
((CD_STEP++))
|
||||||
echo "
|
echo "
|
||||||
|
@ -32,29 +32,14 @@ function cd_step {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function cd_write {
|
step "set name servers"
|
||||||
local file="${1}"
|
for server in "${CD_DNS_SERVERS[@]}" ; do
|
||||||
local text="${2}"
|
echo "nameserver ${server}" \
|
||||||
if [ "${file}" ] ; then
|
>> "${CD_DNS_FILE}" \
|
||||||
echo -n "${text}" \
|
|
||||||
> "${file}" \
|
|
||||||
|| exit
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function cd_set_dns {
|
|
||||||
local server
|
|
||||||
local text=''
|
|
||||||
cd_step "set name servers"
|
|
||||||
for server in "${CD_DNS_SERVERS[@]}" ; do
|
|
||||||
text+="nameserver ${server}
|
|
||||||
"
|
|
||||||
done
|
|
||||||
cd_write "${CD_DNS_FILE}" "${text}" \
|
|
||||||
|| exit
|
|| exit
|
||||||
}
|
done
|
||||||
|
|
||||||
cd_step "configure package manager"
|
step "configure package manager"
|
||||||
echo -n "\
|
echo -n "\
|
||||||
Acquire::Check-Valid-Until True;
|
Acquire::Check-Valid-Until True;
|
||||||
APT::Get::Show-Versions True;
|
APT::Get::Show-Versions True;
|
||||||
|
@ -63,7 +48,7 @@ APT::Install-Suggests False;
|
||||||
Dir::Etc::SourceParts '';
|
Dir::Etc::SourceParts '';
|
||||||
" > '/etc/apt/apt.conf.d/apt.conf' \
|
" > '/etc/apt/apt.conf.d/apt.conf' \
|
||||||
|| exit
|
|| exit
|
||||||
cd_step "configure package repositories"
|
step "configure package repositories"
|
||||||
echo -n "\
|
echo -n "\
|
||||||
deb https://deb.debian.org/debian bookworm main
|
deb https://deb.debian.org/debian bookworm main
|
||||||
deb https://deb.debian.org/debian bookworm-backports main
|
deb https://deb.debian.org/debian bookworm-backports main
|
||||||
|
@ -72,52 +57,45 @@ deb https://deb.debian.org/debian-security bookworm-security main
|
||||||
" > '/etc/apt/sources.list' \
|
" > '/etc/apt/sources.list' \
|
||||||
|| exit
|
|| exit
|
||||||
|
|
||||||
cd_step "disable package verification"
|
step "disable package verification"
|
||||||
echo -n "\
|
echo -n "\
|
||||||
Acquire::https::Verify-Peer False;
|
Acquire::https::Verify-Peer False;
|
||||||
" > '/etc/apt/apt.conf.d/https' \
|
" > '/etc/apt/apt.conf.d/https' \
|
||||||
|| exit
|
|| exit
|
||||||
cd_step "update package catalog"
|
step "update package catalog"
|
||||||
apt-get update \
|
apt-get update \
|
||||||
|| exit
|
|| exit
|
||||||
cd_step "install CA certificates package"
|
step "install CA certificates package"
|
||||||
apt-get install --yes 'ca-certificates' \
|
apt-get install --yes 'ca-certificates' \
|
||||||
|| exit
|
|| exit
|
||||||
cd_step "enable package verification"
|
step "enable package verification"
|
||||||
rm '/etc/apt/apt.conf.d/https' \
|
rm '/etc/apt/apt.conf.d/https' \
|
||||||
|| exit
|
|| exit
|
||||||
|
|
||||||
cd_step "update package catalog"
|
step "update package catalog"
|
||||||
apt-get update \
|
apt-get update \
|
||||||
|| exit
|
|| exit
|
||||||
cd_step "upgrade packages"
|
step "upgrade packages"
|
||||||
apt-get upgrade --yes \
|
apt-get upgrade --yes \
|
||||||
|| exit
|
|| exit
|
||||||
|
|
||||||
cd_step "install Git"
|
step "install Git"
|
||||||
apt-get install --yes 'git' \
|
apt-get install --yes 'git' \
|
||||||
|| exit
|
|| exit
|
||||||
|
|
||||||
DIRECTORY="$(mktemp --directory)" \
|
DIRECTORY="$(mktemp --directory)" \
|
||||||
|| exit
|
|| exit
|
||||||
cd_step "clone Continuous Delivery"
|
step "clone Continuous Delivery"
|
||||||
git clone \
|
git clone \
|
||||||
"${GITHUB_SERVER_URL}/${CD_REPOSITORY}" \
|
"${GITHUB_SERVER_URL}/${CD_REPOSITORY}" \
|
||||||
"${DIRECTORY}" \
|
"${DIRECTORY}" \
|
||||||
|| exit
|
|| exit
|
||||||
|
|
||||||
cd_step "install Python"
|
step "install Python"
|
||||||
apt-get install --yes 'python3' \
|
apt-get install --yes 'python3' \
|
||||||
|| exit
|
|| exit
|
||||||
cd_step "clean package cache"
|
step "clean package cache"
|
||||||
apt-get clean \
|
apt-get clean \
|
||||||
|| exit
|
|| exit
|
||||||
cd_step "bootstrap"
|
step "bootstrap"
|
||||||
"${DIRECTORY}/bootstrap.sh"
|
"${DIRECTORY}/bootstrap.sh"
|
||||||
|
|
||||||
|
|
||||||
function cd_main {
|
|
||||||
cd_set_dns
|
|
||||||
}
|
|
||||||
|
|
||||||
cd_main
|
|
||||||
|
|
Loading…
Reference in a new issue