Created
December 8, 2019 17:37
-
-
Save alediaferia/f53c0a9805f4c010cd6d3ca1ed6cd032 to your computer and use it in GitHub Desktop.
GitLab CI example snippet for building and releasing images to Heroku
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stages: | |
- build | |
- release | |
build_image: | |
only: | |
- master | |
image: registry.gitlab.com/majorhayden/container-buildah | |
stage: build | |
variables: | |
STORAGE_DRIVER: "vfs" | |
BUILDAH_FORMAT: "docker" | |
before_script: | |
- dnf install -y nodejs | |
- curl https://cli-assets.heroku.com/install.sh | sh | |
- sed -i '/^mountopt =.*/d' /etc/containers/storage.conf # https://major.io/2019/08/13/buildah-error-vfs-driver-does-not-support-overlay-mountopt-options/ | |
script: | |
- buildah bud --iidfile iidfile -t cd-alediaferia:$CI_COMMIT_SHORT_SHA . | |
- buildah push --creds=_:$(heroku auth:token) $(cat iidfile) registry.heroku.com/cd-alediaferia/web | |
release: | |
only: | |
- master | |
image: node:10.17-alpine | |
stage: release | |
before_script: | |
- apk add curl bash | |
- curl https://cli-assets.heroku.com/install.sh | sh | |
script: | |
- heroku container:release -a cd-alediaferia web |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment