Commit 43245abe authored by James T. Lee's avatar James T. Lee
Browse files

Refresh repo and build image in separate pipeline

parent 08382a0c
Pipeline #466 passed with stage
in 1 minute and 19 seconds
...@@ -5,6 +5,8 @@ stages: ...@@ -5,6 +5,8 @@ stages:
'Sync Haskell': 'Sync Haskell':
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"'
...@@ -15,7 +17,7 @@ stages: ...@@ -15,7 +17,7 @@ stages:
- 'cat "$SSH_KNOWN_HOSTS" >> ~/.ssh/known_hosts' - 'cat "$SSH_KNOWN_HOSTS" >> ~/.ssh/known_hosts'
# Sync # Sync
- 'git pull --no-edit https://github.com/gentoo-haskell/gentoo-haskell.git' - 'git pull --no-edit --strategy=resolve https://github.com/gentoo-haskell/gentoo-haskell.git'
# Generate metadata # Generate metadata
- 'echo -e "[haskell]\nlocation = ${PWD}" > /etc/portage/repos.conf/haskell.conf' - 'echo -e "[haskell]\nlocation = ${PWD}" > /etc/portage/repos.conf/haskell.conf'
...@@ -27,11 +29,13 @@ stages: ...@@ -27,11 +29,13 @@ stages:
- 'git add -f metadata/md5-cache profiles/use.local.desc' - 'git add -f metadata/md5-cache profiles/use.local.desc'
- 'git commit -m "$(date -I) snapshot"' - 'git commit -m "$(date -I) snapshot"'
- 'git remote set-url origin git@gitlab.james.tl:nest/gentoo/haskell.git' - 'git remote set-url origin git@gitlab.james.tl:nest/gentoo/haskell.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:
- '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 .'
......
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