diff options
| author | mo khan <mo@mokhan.ca> | 2019-09-03 18:49:17 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2019-09-03 18:49:17 -0600 |
| commit | a67ef9c7d53548cd5bea9196eb7e754f893990db (patch) | |
| tree | 9f620b7f086d470591572848f4c8044881586005 /.gitlab/ci | |
| parent | 221dba40184c3ba31efb3ed9fd467035886f9e5c (diff) | |
build pipeline
Diffstat (limited to '.gitlab/ci')
| -rw-r--r-- | .gitlab/ci/build.gitlab-ci.yml | 9 | ||||
| -rw-r--r-- | .gitlab/ci/release.gitlab-ci.yml | 30 | ||||
| -rw-r--r-- | .gitlab/ci/test.gitlab-ci.yml | 5 |
3 files changed, 44 insertions, 0 deletions
diff --git a/.gitlab/ci/build.gitlab-ci.yml b/.gitlab/ci/build.gitlab-ci.yml new file mode 100644 index 0000000..ebbb31b --- /dev/null +++ b/.gitlab/ci/build.gitlab-ci.yml @@ -0,0 +1,9 @@ +build-image: + image: docker:stable + services: + - docker:stable-dind + stage: build + script: + - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY + - docker build . -t $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA + - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA diff --git a/.gitlab/ci/release.gitlab-ci.yml b/.gitlab/ci/release.gitlab-ci.yml new file mode 100644 index 0000000..f0fa81c --- /dev/null +++ b/.gitlab/ci/release.gitlab-ci.yml @@ -0,0 +1,30 @@ +tarball: + image: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA + variables: + GIT_STRATEGY: none + stage: release + script: + - cd /code + - bundle exec rake clean pdf tarball + after_script: + - mv /code/pkg $CI_PROJECT_DIR + artifacts: + paths: + - pkg/*.tar.gz + only: + - master + +publish-image: + image: docker:stable + services: + - docker:stable-dind + variables: + GIT_STRATEGY: none + stage: release + script: + - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY + - docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA + - docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA $CI_REGISTRY_IMAGE:latest + - docker push $CI_REGISTRY_IMAGE:latest + only: + - master diff --git a/.gitlab/ci/test.gitlab-ci.yml b/.gitlab/ci/test.gitlab-ci.yml new file mode 100644 index 0000000..bc38906 --- /dev/null +++ b/.gitlab/ci/test.gitlab-ci.yml @@ -0,0 +1,5 @@ +test: + image: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA + stage: test + script: + - bin/test |
