mirror of
https://ops.gitlab.net/gitlab-org/gitlab-build-images.git
synced 2025-12-10 02:22:57 +01:00
Support using OS other than Debian as base for custom images
Signed-off-by: Balasankar "Balu" C <balasankar@gitlab.com>
This commit is contained in:
parent
703c30315e
commit
0dea43ac3b
14 changed files with 345 additions and 226 deletions
|
|
@ -3,55 +3,66 @@
|
|||
set -xeuo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
function build_debian() {
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# echo "deb http://deb.debian.org/debian testing main" | tee -a /etc/apt/sources.list.d/testing.list
|
||||
# Install packages
|
||||
apt-get update
|
||||
apt-get install -yq --no-install-recommends \
|
||||
make gcc g++ locales \
|
||||
rsync git-core \
|
||||
ed file curl gnupg2 \
|
||||
unzip \
|
||||
python3 python3-pip python3-crcmod python-minimal \
|
||||
patch
|
||||
# echo "deb http://deb.debian.org/debian testing main" | tee -a /etc/apt/sources.list.d/testing.list
|
||||
# Install packages
|
||||
apt-get update
|
||||
apt-get install -yq --no-install-recommends \
|
||||
make gcc g++ locales \
|
||||
rsync git-core \
|
||||
ed file curl gnupg2 \
|
||||
unzip \
|
||||
python3 python3-pip python3-crcmod python-minimal \
|
||||
patch
|
||||
|
||||
# Install Imagemagick for cropping the pictures on the team page
|
||||
apt-get install -yq --no-install-recommends imagemagick
|
||||
# Install Imagemagick for cropping the pictures on the team page
|
||||
apt-get install -yq --no-install-recommends imagemagick
|
||||
|
||||
# Install node & yarn
|
||||
NODE_INSTALL_VERSION=16.14.2
|
||||
YARN_INSTALL_VERSION=1.22.10
|
||||
/scripts/install-node $NODE_INSTALL_VERSION $YARN_INSTALL_VERSION && node --version && yarn --version
|
||||
# Install node & yarn
|
||||
NODE_INSTALL_VERSION=16.14.2
|
||||
YARN_INSTALL_VERSION=1.22.10
|
||||
/scripts/install-node $NODE_INSTALL_VERSION $YARN_INSTALL_VERSION && node --version && yarn --version
|
||||
|
||||
# Install yamllint
|
||||
# We need version 1.25.0+: https://github.com/adrienverge/yamllint/blob/master/CHANGELOG.rst
|
||||
YAMLLINT_VERSION=1.25.0
|
||||
# Install yamllint
|
||||
# We need version 1.25.0+: https://github.com/adrienverge/yamllint/blob/master/CHANGELOG.rst
|
||||
YAMLLINT_VERSION=1.25.0
|
||||
|
||||
# Temporarily pin pyyaml and pathspec to reduce compatibility with packages from Debian bullseye (testing)
|
||||
pip3 install yamllint==${YAMLLINT_VERSION} pyyaml==5.4.1 pathspec==0.8.1
|
||||
# Temporarily pin pyyaml and pathspec to reduce compatibility with packages from Debian bullseye (testing)
|
||||
pip3 install yamllint==${YAMLLINT_VERSION} pyyaml==5.4.1 pathspec==0.8.1
|
||||
|
||||
# Install gitlab-runner
|
||||
curl -O -J -L https://gitlab-ci-multi-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-ci-multi-runner-linux-amd64
|
||||
mv gitlab-ci-multi-runner-linux-amd64 /usr/bin/gitlab-runner-helper
|
||||
chmod +x /usr/bin/gitlab-runner-helper
|
||||
# Install gitlab-runner
|
||||
curl -O -J -L https://gitlab-ci-multi-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-ci-multi-runner-linux-amd64
|
||||
mv gitlab-ci-multi-runner-linux-amd64 /usr/bin/gitlab-runner-helper
|
||||
chmod +x /usr/bin/gitlab-runner-helper
|
||||
|
||||
# Patch gsutil to support gzip compression with rsync command:
|
||||
# https://github.com/GoogleCloudPlatform/gsutil/pull/1430
|
||||
if [[ -d "/patches/gsutil" ]]; then
|
||||
for i in /patches/gsutil/*.patch; do
|
||||
echo "$i..."
|
||||
patch -d /usr/lib/google-cloud-sdk/platform/gsutil -p1 -i "$i"
|
||||
done
|
||||
# Patch gsutil to support gzip compression with rsync command:
|
||||
# https://github.com/GoogleCloudPlatform/gsutil/pull/1430
|
||||
if [[ -d "/patches/gsutil" ]]; then
|
||||
for i in /patches/gsutil/*.patch; do
|
||||
echo "$i..."
|
||||
patch -d /usr/lib/google-cloud-sdk/platform/gsutil -p1 -i "$i"
|
||||
done
|
||||
fi
|
||||
|
||||
# Set UTF-8
|
||||
echo "C.UTF-8 UTF-8" > /etc/locale.gen
|
||||
locale-gen
|
||||
update-locale LANG=C.UTF-8 LC_CTYPE=C.UTF-8 LC_ALL=C.UTF-8
|
||||
locale -a
|
||||
|
||||
# Clean up
|
||||
apt-get autoremove -yq
|
||||
apt-get clean -yqq
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
}
|
||||
BUILD_OS=${BUILD_OS:-debian}
|
||||
|
||||
if [[ $BUILD_OS =~ debian ]]; then
|
||||
build_debian "$@"
|
||||
elif [[ $BUILD_OS =~ ubi ]]; then
|
||||
build_ubi "$@"
|
||||
fi
|
||||
|
||||
# Set UTF-8
|
||||
echo "C.UTF-8 UTF-8" > /etc/locale.gen
|
||||
locale-gen
|
||||
update-locale LANG=C.UTF-8 LC_CTYPE=C.UTF-8 LC_ALL=C.UTF-8
|
||||
locale -a
|
||||
|
||||
# Clean up
|
||||
apt-get autoremove -yq
|
||||
apt-get clean -yqq
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue