spcd/cd.sh

85 lines
1.4 KiB
Bash
Raw Normal View History

2024-03-25 11:26:38 +00:00
NAMESERVERS=(
'9.9.9.9'
)
PACKAGES=(
'git'
2024-04-25 08:23:23 +00:00
'python3'
2024-03-25 11:26:38 +00:00
)
REPOSITORY='rwx.work/cd'
2024-04-25 13:30:32 +00:00
echo '
1/11 set name servers
'
2024-03-25 11:26:38 +00:00
for nameserver in "${NAMESERVERS[@]}" ; do
echo "nameserver ${nameserver}" \
>> '/etc/resolv.conf' \
|| exit
done
2024-04-25 13:30:32 +00:00
echo '
2/11 configure package manager
'
2024-04-05 15:49:25 +00:00
echo -n "\
APT::Get::Show-Versions True;
2024-04-08 08:07:37 +00:00
APT::Install-Recommends False;
APT::Install-Suggests False;
2024-04-05 15:49:25 +00:00
" > '/etc/apt/apt.conf.d/apt.conf' \
|| exit
2024-04-25 13:30:32 +00:00
echo '
3/11 configure package repositories
'
echo -n "\
deb https://deb.debian.org/debian bookworm main
deb https://deb.debian.org/debian-backports bookworm main
deb https://deb.debian.org/debian-updates bookworm main
deb https://deb.debian.org/debian-security bookworm-security main
" > '/etc/apt/sources.list' \
|| exit
echo '
4/11 update package catalog
'
apt-get update \
|| exit
echo '
5/11 install CA certificates package
'
apt-get install --yes 'ca-certificates' \
|| exit
echo '
6/11 update package catalog
'
2024-03-25 08:02:43 +00:00
apt-get update \
2024-03-25 11:26:38 +00:00
|| exit
2024-04-25 13:30:32 +00:00
echo '
7/11 upgrade packages
'
apt-get upgrade --yes \
|| exit
echo '
8/11 install Git
'
apt-get install --yes 'git' \
2024-03-25 11:26:38 +00:00
|| exit
2024-03-25 19:09:04 +00:00
DIRECTORY="$(mktemp --directory)" \
|| exit
2024-04-25 13:30:32 +00:00
echo '
9/11 clone Continuous Delivery
'
2024-03-25 08:02:43 +00:00
git clone \
2024-03-25 11:26:38 +00:00
"${GITHUB_SERVER_URL}/${REPOSITORY}" \
2024-03-25 19:09:04 +00:00
"${DIRECTORY}" \
2024-03-25 11:26:38 +00:00
|| exit
2024-04-25 13:30:32 +00:00
echo '
10/11 install Python
'
apt-get install --yes 'python3' \
|| exit
echo '
11/11 bootstrap
'
2024-03-25 19:09:04 +00:00
"${DIRECTORY}/bootstrap.sh"