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:
|
||||
auto_cancel:
|
||||
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:
|
||||
- build
|
||||
@@ -9,9 +21,9 @@ stages:
|
||||
- wiki
|
||||
|
||||
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:
|
||||
stage: build
|
||||
image: docker:27
|
||||
@@ -19,6 +31,7 @@ build-docker:
|
||||
- docker:27-dind
|
||||
variables:
|
||||
DOCKER_TLS_CERTDIR: "/certs"
|
||||
DOCKER_IMAGE: "${CI_REGISTRY_IMAGE}/build-env:latest"
|
||||
before_script:
|
||||
- docker login -u "${CI_REGISTRY_USER}" -p "${CI_REGISTRY_PASSWORD}" "${CI_REGISTRY}"
|
||||
script:
|
||||
@@ -28,20 +41,12 @@ build-docker:
|
||||
-f docker/Dockerfile.build .
|
||||
- docker push "${DOCKER_IMAGE}"
|
||||
rules:
|
||||
- changes:
|
||||
- docker/Dockerfile.build
|
||||
- scripts/mingw-w64-toolchain.cmake
|
||||
- scripts/install-deps-ubuntu.sh
|
||||
- if: $FORCE_REBUILD_IMAGE == "true"
|
||||
- if: $CI_PIPELINE_TYPE == "image-rebuild"
|
||||
|
||||
# ── Linux native build ─────────────────────────────────────────────────────────
|
||||
build-linux:
|
||||
interruptible: true
|
||||
stage: build
|
||||
image: "${DOCKER_IMAGE}"
|
||||
needs:
|
||||
- job: build-docker
|
||||
optional: true
|
||||
script:
|
||||
- cmake -B build-linux -G Ninja -DCMAKE_BUILD_TYPE=Release
|
||||
-DCMAKE_PREFIX_PATH="${QT_LINUX_DIR}"
|
||||
@@ -52,15 +57,15 @@ build-linux:
|
||||
- build-linux/asteria-qt
|
||||
expire_in: 1 day
|
||||
when: on_success
|
||||
rules:
|
||||
- if: $CI_PIPELINE_TYPE == "image-rebuild"
|
||||
when: never
|
||||
- when: on_success
|
||||
|
||||
# ── Windows cross-compile build (MinGW-w64) ───────────────────────────────────
|
||||
build-windows:
|
||||
interruptible: true
|
||||
stage: build
|
||||
image: "${DOCKER_IMAGE}"
|
||||
needs:
|
||||
- job: build-docker
|
||||
optional: true
|
||||
script:
|
||||
- PKG_CONFIG_PATH="${MINGW_SYSROOT}/lib/pkgconfig" cmake -B build-windows -G Ninja
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
@@ -75,26 +80,29 @@ build-windows:
|
||||
- build-windows/asteria-qt.exe
|
||||
expire_in: 1 day
|
||||
when: on_success
|
||||
rules:
|
||||
- if: $CI_PIPELINE_TYPE == "image-rebuild"
|
||||
when: never
|
||||
- when: on_success
|
||||
|
||||
# ── Linux tests ────────────────────────────────────────────────────────────────
|
||||
test-linux:
|
||||
interruptible: true
|
||||
stage: test
|
||||
image: "${DOCKER_IMAGE}"
|
||||
needs:
|
||||
- job: build-docker
|
||||
optional: true
|
||||
script:
|
||||
- cmake -B build-linux -G Ninja -DCMAKE_BUILD_TYPE=Release
|
||||
-DCMAKE_PREFIX_PATH="${QT_LINUX_DIR}"
|
||||
- cmake --build build-linux
|
||||
- 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:
|
||||
interruptible: true
|
||||
stage: package
|
||||
image: "${DOCKER_IMAGE}"
|
||||
needs:
|
||||
- build-linux
|
||||
- test-linux
|
||||
@@ -107,12 +115,15 @@ package-linux:
|
||||
- dist/*.AppImage
|
||||
expire_in: 1 day
|
||||
when: on_success
|
||||
rules:
|
||||
- if: $CI_PIPELINE_TYPE == "image-rebuild"
|
||||
when: never
|
||||
- when: on_success
|
||||
|
||||
# ── Package Windows as portable zip ──────────────────────────────────────────
|
||||
package-windows:
|
||||
interruptible: true
|
||||
stage: package
|
||||
image: "${DOCKER_IMAGE}"
|
||||
needs:
|
||||
- build-windows
|
||||
script:
|
||||
@@ -124,16 +135,17 @@ package-windows:
|
||||
- asteria-qt-windows/
|
||||
expire_in: 1 day
|
||||
when: on_success
|
||||
rules:
|
||||
- if: $CI_PIPELINE_TYPE == "image-rebuild"
|
||||
when: never
|
||||
- when: on_success
|
||||
|
||||
# ── Update wiki with latest dev build links ────────────────────────────────────
|
||||
update-wiki:
|
||||
stage: wiki
|
||||
image: alpine:latest
|
||||
needs:
|
||||
- package-linux
|
||||
- package-windows
|
||||
before_script:
|
||||
- apk add --no-cache curl jq
|
||||
script:
|
||||
- |
|
||||
if [ -z "${GITLAB_TOKEN}" ]; then
|
||||
@@ -177,4 +189,6 @@ update-wiki:
|
||||
exit 1
|
||||
fi
|
||||
rules:
|
||||
- if: $CI_PIPELINE_TYPE == "image-rebuild"
|
||||
when: never
|
||||
- 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) ──────────────────
|
||||
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/*
|
||||
|
||||
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