--- stages: - 'sync' - 'build' 'Sync Portage': stage: 'sync' rules: - if: '$BUILD_IMAGE != "1"' script: # Config - 'git config --global user.name "Nest CI"' - 'git config --global user.email nest@james.tl' - 'eval $(ssh-agent -s)' - 'chmod 600 "$SSH_PRIVATE_KEY" && ssh-add "$SSH_PRIVATE_KEY"' - 'mkdir -p ~/.ssh && chmod 700 ~/.ssh' - 'cat "$SSH_KNOWN_HOSTS" >> ~/.ssh/known_hosts' # Sync - 'rsync --verbose --checksum --recursive --links --executability --delete --exclude-from=.dockerignore --progress rsync://rsync.us.gentoo.org/gentoo-portage/ .' # Verify - 'gemato verify -K /usr/share/openpgp-keys/gentoo-release.asc --keep-going' - 'find . -name Manifest.gz -delete' - 'rm -f Manifest Manifest.files.gz' # Push - 'git add .' - 'git commit -m "$(date -I) snapshot"' - 'git remote set-url origin git@gitlab.james.tl:nest/gentoo/portage.git' - 'git push -o ci.variable="BUILD_IMAGE=1" origin "HEAD:${CI_COMMIT_BRANCH}"' 'Build Image': image: '${CI_REGISTRY}/nest/tools/buildah:${CI_HOST_CPU}' stage: 'build' rules: - if: '$BUILD_IMAGE == "1"' script: - 'buildah login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"' - 'buildah bud --pull -t "$CI_REGISTRY_IMAGE" -f .Containerfile .' - 'buildah push "$CI_REGISTRY_IMAGE"'