Try to switch to personal shell runner
This commit is contained in:
3 files changed
+70
-26
No files matched your search
+38
-24
@@ -1,6 +1,18 @@
|
|||||||
workflow:
|
workflow:
|
||||||
auto_cancel:
|
auto_cancel:
|
||||||
on_new_commit: interruptible
|
on_new_commit: interruptible
|
||||||
|
rules:
|
||||||
|
- if: $FORCE_REBUILD_IMAGE == "true"
|
||||||
|
variables:
|
||||||
|
CI_PIPELINE_TYPE: image-rebuild
|
||||||
|
- changes:
|
||||||
|
- docker/Dockerfile.build
|
||||||
|
- scripts/mingw-w64-toolchain.cmake
|
||||||
|
- scripts/install-deps-ubuntu.sh
|
||||||
|
variables:
|
||||||
|
CI_PIPELINE_TYPE: image-rebuild
|
||||||
|
- variables:
|
||||||
|
CI_PIPELINE_TYPE: normal
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- build
|
- build
|
||||||
@@ -9,9 +21,9 @@ stages:
|
|||||||
- wiki
|
- wiki
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
DOCKER_IMAGE: "${CI_REGISTRY_IMAGE}/build-env:latest"
|
GIT_CLEAN_FLAGS: -fdx
|
||||||
|
|
||||||
# ── Build the custom Docker image (only when Dockerfile changes) ───────────────
|
# ── Build the runner image and push to registry ────────────────────────────────
|
||||||
build-docker:
|
build-docker:
|
||||||
stage: build
|
stage: build
|
||||||
image: docker:27
|
image: docker:27
|
||||||
@@ -19,6 +31,7 @@ build-docker:
|
|||||||
- docker:27-dind
|
- docker:27-dind
|
||||||
variables:
|
variables:
|
||||||
DOCKER_TLS_CERTDIR: "/certs"
|
DOCKER_TLS_CERTDIR: "/certs"
|
||||||
|
DOCKER_IMAGE: "${CI_REGISTRY_IMAGE}/build-env:latest"
|
||||||
before_script:
|
before_script:
|
||||||
- docker login -u "${CI_REGISTRY_USER}" -p "${CI_REGISTRY_PASSWORD}" "${CI_REGISTRY}"
|
- docker login -u "${CI_REGISTRY_USER}" -p "${CI_REGISTRY_PASSWORD}" "${CI_REGISTRY}"
|
||||||
script:
|
script:
|
||||||
@@ -28,20 +41,12 @@ build-docker:
|
|||||||
-f docker/Dockerfile.build .
|
-f docker/Dockerfile.build .
|
||||||
- docker push "${DOCKER_IMAGE}"
|
- docker push "${DOCKER_IMAGE}"
|
||||||
rules:
|
rules:
|
||||||
- changes:
|
- if: $CI_PIPELINE_TYPE == "image-rebuild"
|
||||||
- docker/Dockerfile.build
|
|
||||||
- scripts/mingw-w64-toolchain.cmake
|
|
||||||
- scripts/install-deps-ubuntu.sh
|
|
||||||
- if: $FORCE_REBUILD_IMAGE == "true"
|
|
||||||
|
|
||||||
# ── Linux native build ─────────────────────────────────────────────────────────
|
# ── Linux native build ─────────────────────────────────────────────────────────
|
||||||
build-linux:
|
build-linux:
|
||||||
interruptible: true
|
interruptible: true
|
||||||
stage: build
|
stage: build
|
||||||
image: "${DOCKER_IMAGE}"
|
|
||||||
needs:
|
|
||||||
- job: build-docker
|
|
||||||
optional: true
|
|
||||||
script:
|
script:
|
||||||
- cmake -B build-linux -G Ninja -DCMAKE_BUILD_TYPE=Release
|
- cmake -B build-linux -G Ninja -DCMAKE_BUILD_TYPE=Release
|
||||||
-DCMAKE_PREFIX_PATH="${QT_LINUX_DIR}"
|
-DCMAKE_PREFIX_PATH="${QT_LINUX_DIR}"
|
||||||
@@ -52,15 +57,15 @@ build-linux:
|
|||||||
- build-linux/asteria-qt
|
- build-linux/asteria-qt
|
||||||
expire_in: 1 day
|
expire_in: 1 day
|
||||||
when: on_success
|
when: on_success
|
||||||
|
rules:
|
||||||
|
- if: $CI_PIPELINE_TYPE == "image-rebuild"
|
||||||
|
when: never
|
||||||
|
- when: on_success
|
||||||
|
|
||||||
# ── Windows cross-compile build (MinGW-w64) ───────────────────────────────────
|
# ── Windows cross-compile build (MinGW-w64) ───────────────────────────────────
|
||||||
build-windows:
|
build-windows:
|
||||||
interruptible: true
|
interruptible: true
|
||||||
stage: build
|
stage: build
|
||||||
image: "${DOCKER_IMAGE}"
|
|
||||||
needs:
|
|
||||||
- job: build-docker
|
|
||||||
optional: true
|
|
||||||
script:
|
script:
|
||||||
- PKG_CONFIG_PATH="${MINGW_SYSROOT}/lib/pkgconfig" cmake -B build-windows -G Ninja
|
- PKG_CONFIG_PATH="${MINGW_SYSROOT}/lib/pkgconfig" cmake -B build-windows -G Ninja
|
||||||
-DCMAKE_BUILD_TYPE=Release
|
-DCMAKE_BUILD_TYPE=Release
|
||||||
@@ -75,26 +80,29 @@ build-windows:
|
|||||||
- build-windows/asteria-qt.exe
|
- build-windows/asteria-qt.exe
|
||||||
expire_in: 1 day
|
expire_in: 1 day
|
||||||
when: on_success
|
when: on_success
|
||||||
|
rules:
|
||||||
|
- if: $CI_PIPELINE_TYPE == "image-rebuild"
|
||||||
|
when: never
|
||||||
|
- when: on_success
|
||||||
|
|
||||||
# ── Linux tests ────────────────────────────────────────────────────────────────
|
# ── Linux tests ────────────────────────────────────────────────────────────────
|
||||||
test-linux:
|
test-linux:
|
||||||
interruptible: true
|
interruptible: true
|
||||||
stage: test
|
stage: test
|
||||||
image: "${DOCKER_IMAGE}"
|
|
||||||
needs:
|
|
||||||
- job: build-docker
|
|
||||||
optional: true
|
|
||||||
script:
|
script:
|
||||||
- cmake -B build-linux -G Ninja -DCMAKE_BUILD_TYPE=Release
|
- cmake -B build-linux -G Ninja -DCMAKE_BUILD_TYPE=Release
|
||||||
-DCMAKE_PREFIX_PATH="${QT_LINUX_DIR}"
|
-DCMAKE_PREFIX_PATH="${QT_LINUX_DIR}"
|
||||||
- cmake --build build-linux
|
- cmake --build build-linux
|
||||||
- QT_QPA_PLATFORM=offscreen ctest --test-dir build-linux --output-on-failure
|
- QT_QPA_PLATFORM=offscreen ctest --test-dir build-linux --output-on-failure
|
||||||
|
rules:
|
||||||
|
- if: $CI_PIPELINE_TYPE == "image-rebuild"
|
||||||
|
when: never
|
||||||
|
- when: on_success
|
||||||
|
|
||||||
# ── Package Linux as AppImage ─────────────────────────────────────────────
|
# ── Package Linux as AppImage ─────────────────────────────────────────────
|
||||||
package-linux:
|
package-linux:
|
||||||
interruptible: true
|
interruptible: true
|
||||||
stage: package
|
stage: package
|
||||||
image: "${DOCKER_IMAGE}"
|
|
||||||
needs:
|
needs:
|
||||||
- build-linux
|
- build-linux
|
||||||
- test-linux
|
- test-linux
|
||||||
@@ -107,12 +115,15 @@ package-linux:
|
|||||||
- dist/*.AppImage
|
- dist/*.AppImage
|
||||||
expire_in: 1 day
|
expire_in: 1 day
|
||||||
when: on_success
|
when: on_success
|
||||||
|
rules:
|
||||||
|
- if: $CI_PIPELINE_TYPE == "image-rebuild"
|
||||||
|
when: never
|
||||||
|
- when: on_success
|
||||||
|
|
||||||
# ── Package Windows as portable zip ──────────────────────────────────────────
|
# ── Package Windows as portable zip ──────────────────────────────────────────
|
||||||
package-windows:
|
package-windows:
|
||||||
interruptible: true
|
interruptible: true
|
||||||
stage: package
|
stage: package
|
||||||
image: "${DOCKER_IMAGE}"
|
|
||||||
needs:
|
needs:
|
||||||
- build-windows
|
- build-windows
|
||||||
script:
|
script:
|
||||||
@@ -124,16 +135,17 @@ package-windows:
|
|||||||
- asteria-qt-windows/
|
- asteria-qt-windows/
|
||||||
expire_in: 1 day
|
expire_in: 1 day
|
||||||
when: on_success
|
when: on_success
|
||||||
|
rules:
|
||||||
|
- if: $CI_PIPELINE_TYPE == "image-rebuild"
|
||||||
|
when: never
|
||||||
|
- when: on_success
|
||||||
|
|
||||||
# ── Update wiki with latest dev build links ────────────────────────────────────
|
# ── Update wiki with latest dev build links ────────────────────────────────────
|
||||||
update-wiki:
|
update-wiki:
|
||||||
stage: wiki
|
stage: wiki
|
||||||
image: alpine:latest
|
|
||||||
needs:
|
needs:
|
||||||
- package-linux
|
- package-linux
|
||||||
- package-windows
|
- package-windows
|
||||||
before_script:
|
|
||||||
- apk add --no-cache curl jq
|
|
||||||
script:
|
script:
|
||||||
- |
|
- |
|
||||||
if [ -z "${GITLAB_TOKEN}" ]; then
|
if [ -z "${GITLAB_TOKEN}" ]; then
|
||||||
@@ -177,4 +189,6 @@ update-wiki:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
rules:
|
rules:
|
||||||
|
- if: $CI_PIPELINE_TYPE == "image-rebuild"
|
||||||
|
when: never
|
||||||
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
||||||
+13
-2
@@ -119,7 +119,18 @@ RUN wget -q https://github.com/AppImage/appimagetool/releases/download/continuou
|
|||||||
|
|
||||||
# ── file utility (needed by linuxdeploy for ELF detection) ──────────────────
|
# ── file utility (needed by linuxdeploy for ELF detection) ──────────────────
|
||||||
RUN apt-get update -qq && \
|
RUN apt-get update -qq && \
|
||||||
apt-get install -y --no-install-recommends file patchelf zip && \
|
apt-get install -y --no-install-recommends file patchelf zip curl jq && \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
WORKDIR /build
|
# ── gitlab-runner (shell executor) ───────────────────────────────────────────
|
||||||
|
RUN wget -q https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd64 \
|
||||||
|
-O /usr/local/bin/gitlab-runner && \
|
||||||
|
chmod +x /usr/local/bin/gitlab-runner && \
|
||||||
|
mkdir -p /etc/gitlab-runner /builds && \
|
||||||
|
chmod 777 /builds
|
||||||
|
|
||||||
|
COPY docker/entrypoint.sh /entrypoint.sh
|
||||||
|
RUN chmod +x /entrypoint.sh
|
||||||
|
|
||||||
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
CMD []
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Auto-register if no config exists and env vars are provided
|
||||||
|
if [ ! -f /etc/gitlab-runner/config.toml ] && \
|
||||||
|
[ -n "${CI_SERVER_URL}" ] && [ -n "${REGISTRATION_TOKEN}" ]; then
|
||||||
|
gitlab-runner register \
|
||||||
|
--non-interactive \
|
||||||
|
--url "${CI_SERVER_URL}" \
|
||||||
|
--registration-token "${REGISTRATION_TOKEN}" \
|
||||||
|
--executor shell \
|
||||||
|
--shell bash \
|
||||||
|
--description "${RUNNER_NAME:-asteria-qt-runner}" \
|
||||||
|
--tag-list "${RUNNER_TAGS:-}" \
|
||||||
|
--run-untagged="${RUNNER_RUN_UNTAGGED:-true}" \
|
||||||
|
--locked="${RUNNER_LOCKED:-false}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec gitlab-runner run --working-directory=/builds
|
||||||
Reference in new issue
Block a user