gitlab: Add initial CI integration.

Based on Wine.
This commit is contained in:
Jacek Caban 2023-01-09 23:00:36 +01:00
parent 65df784694
commit 5208117d2b
4 changed files with 81 additions and 0 deletions

9
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,9 @@
# main Gitlab CI script
stages:
- image
- build
include:
- local: "/wine/gitlab/image.yml"
- local: "/wine/gitlab/build.yml"

21
wine/gitlab/build.yml Normal file
View File

@ -0,0 +1,21 @@
# CI script for building Wine
.wine-gecko-build:
image: $CI_REGISTRY/wine/wine-gecko:debian-bullseye
interruptible: true
variables:
GIT_DEPTH: 0
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
build32:
stage: build
extends: .wine-gecko-build
script:
- ./wine/make_package -win32 -pdb --all-package --force-build
build64:
stage: build
extends: .wine-gecko-build
script:
- ./wine/make_package -win64 -pdb --all-package --force-build

30
wine/gitlab/image.docker Normal file
View File

@ -0,0 +1,30 @@
# FROM line will be added dynamically
WORKDIR /tmp
RUN export DEBIAN_FRONTEND=noninteractive; \
echo 'path-exclude=/usr/share/doc/*' > /etc/dpkg/dpkg.cfg.d/99-exclude-cruft && \
echo 'path-exclude=/usr/share/locale/*' >> /etc/dpkg/dpkg.cfg.d/99-exclude-cruft && \
echo 'path-exclude=/usr/share/man/*' >> /etc/dpkg/dpkg.cfg.d/99-exclude-cruft && \
echo 'APT::Install-Recommends "false";' > /etc/apt/apt.conf && \
echo '#!/bin/sh' > /usr/sbin/policy-rc.d && \
echo 'exit 101' >> /usr/sbin/policy-rc.d && \
chmod +x /usr/sbin/policy-rc.d && \
apt-get update && \
apt-get install -y gcc g++ git autoconf autoconf2.13 flex bison perl gettext lbzip2 \
unzip zip xz-utils yasm ccache netbase curl ca-certificates cmake wget make \
python3 python3-distutils uuid-runtime wine && \
apt-get clean && \
useradd -m gitlab
RUN git clone https://github.com/mstorsjo/llvm-mingw.git && \
cd llvm-mingw && \
git reset --hard 04c623fe8b50d0c0d78e810ef1cefe10fc418a50 && \
export ARCHS="i686 x86_64" && \
export LLVM_VERSION=llvmorg-15.0.0 && \
./build-all.sh /opt/llvm-mingw && \
cd .. && rm -rf llvm-mingw
ENV PATH=/opt/llvm-mingw/bin:$PATH
USER gitlab

21
wine/gitlab/image.yml Normal file
View File

@ -0,0 +1,21 @@
# CI script for creating the docker image used for Wine builds
build-image:
stage: image
rules:
- if: $CI_PIPELINE_SOURCE == 'push' && $CI_PROJECT_PATH == "wine/wine-gecko" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
changes:
- wine/gitlab/image.yml
- wine/gitlab/image.docker
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
variables:
IMAGE_SOURCE: "$CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX/debian:bullseye"
IMAGE_LOCAL: "$CI_REGISTRY_IMAGE:debian-bullseye"
DOCKER_FILE: "$CI_PROJECT_DIR/wine/gitlab/image.docker"
script:
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"auth\":\"$(printf "%s:%s" "$CI_REGISTRY_USER" "$CI_REGISTRY_PASSWORD" | base64 | tr -d '\n')\"},\"$CI_DEPENDENCY_PROXY_SERVER\":{\"auth\":\"$(printf "%s:%s" "$CI_DEPENDENCY_PROXY_USER" "$CI_DEPENDENCY_PROXY_PASSWORD" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json
- sed -i "1iFROM $IMAGE_SOURCE" "$DOCKER_FILE"
- /kaniko/executor --context "$CI_PROJECT_DIR" --dockerfile "$DOCKER_FILE" --destination "$IMAGE_LOCAL"