Commit 726b525c authored by James T. Lee's avatar James T. Lee
Browse files

CI: Do build stage in separate pipeline from sync

parent 5b33c060
Pipeline #453 passed with stage
in 1 minute and 8 seconds
...@@ -5,6 +5,8 @@ stages: ...@@ -5,6 +5,8 @@ stages:
'Sync Portage': 'Sync Portage':
stage: 'sync' stage: 'sync'
rules:
- if: '$BUILD_IMAGE != "1"'
script: script:
# Config # Config
- 'git config --global user.name "Nest CI"' - 'git config --global user.name "Nest CI"'
...@@ -34,13 +36,14 @@ stages: ...@@ -34,13 +36,14 @@ stages:
- 'git add .' - 'git add .'
- 'git commit -m "$(date -I) snapshot"' - 'git commit -m "$(date -I) snapshot"'
- 'git remote set-url origin git@gitlab.james.tl:nest/gentoo/portage.git' - 'git remote set-url origin git@gitlab.james.tl:nest/gentoo/portage.git'
- 'git push -o ci.skip origin "HEAD:${CI_COMMIT_BRANCH}"' - 'git push -o ci.variable="BUILD_IMAGE=1" origin "HEAD:${CI_COMMIT_BRANCH}"'
'Build Image': 'Build Image':
stage: 'build'
image: '${CI_REGISTRY}/nest/tools/buildah:${CI_HOST_CPU}' image: '${CI_REGISTRY}/nest/tools/buildah:${CI_HOST_CPU}'
stage: 'build'
rules:
- if: '$BUILD_IMAGE == "1"'
script: script:
- 'git pull'
- 'buildah login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"' - 'buildah login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"'
- 'buildah bud --pull -t "$CI_REGISTRY_IMAGE" -f .Containerfile .' - 'buildah bud --pull -t "$CI_REGISTRY_IMAGE" -f .Containerfile .'
- 'buildah push "$CI_REGISTRY_IMAGE"' - 'buildah push "$CI_REGISTRY_IMAGE"'
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment