Skip to content

Instantly share code, notes, and snippets.

@ynott
Created July 20, 2018 11:50
Show Gist options
  • Save ynott/4f4a9aa07600f6e5e6603e2dac9df269 to your computer and use it in GitHub Desktop.
Save ynott/4f4a9aa07600f6e5e6603e2dac9df269 to your computer and use it in GitHub Desktop.
.gitlab-ci.yaml
# This file is a template, and might need editing before it works on your project.
# Official docker image.
image: docker:latest
services:
- docker:dind
stages:
- build
before_script:
- docker info
- docker login -u "gitlab-ci-token" -p "$CI_JOB_TOKEN" $CI_REGISTRY
- export IMAGE_TAG="${CI_BUILD_TAG-${CI_COMMIT_SHA:0:8}}"
fluent-twitter:
stage: build
script:
- docker build --pull -t "${CI_REGISTRY_IMAGE}/${CI_JOB_NAME}:${IMAGE_TAG}" "fluent/${CI_JOB_NAME}"
- docker push "${CI_REGISTRY_IMAGE}/${CI_JOB_NAME}:${IMAGE_TAG}"
- docker tag "${CI_REGISTRY_IMAGE}/${CI_JOB_NAME}:${IMAGE_TAG}" "${CI_REGISTRY_IMAGE}/${CI_JOB_NAME}"
- docker push "${CI_REGISTRY_IMAGE}/${CI_JOB_NAME}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment