Skip to content

Instantly share code, notes, and snippets.

@developer-guy
Forked from alediaferia/.gitlab-ci.yml
Created October 6, 2020 12:10
Show Gist options
  • Save developer-guy/e3d332ad7bb40b8b25bfeb2781c327ca to your computer and use it in GitHub Desktop.
Save developer-guy/e3d332ad7bb40b8b25bfeb2781c327ca to your computer and use it in GitHub Desktop.
GitLab CI example snippet for building and releasing images to Heroku
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