-
-
Save developer-guy/e3d332ad7bb40b8b25bfeb2781c327ca to your computer and use it in GitHub Desktop.
GitLab CI example snippet for building and releasing images to Heroku
This file contains 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