show migration head

This commit is contained in:
Antoine Legrand 2017-07-27 11:53:23 +02:00
parent 851686dd0b
commit 9fd455de28
3 changed files with 12 additions and 3 deletions

View file

@ -34,7 +34,7 @@ local jobs = {
// Update the base container // Update the base container
stage: stages.docker_base, stage: stages.docker_base,
script: [ script: [
'docker build --cache-from quay.io/quay/quay-base:latest' + 'docker build --no-cache' +
' -t %s -f quay-base.dockerfile .' % images.base.name, ' -t %s -f quay-base.dockerfile .' % images.base.name,
'docker push %s' % images.base.name, 'docker push %s' % images.base.name,
], ],
@ -46,6 +46,10 @@ local jobs = {
stage: stages.docker_build, stage: stages.docker_build,
script: [ script: [
'docker build -t %s -f Dockerfile .' % images.quayci.name, 'docker build -t %s -f Dockerfile .' % images.quayci.name,
'docker run --rm %s cat ALEMBIC_HEAD > /tmp/ALEMBIC_HEAD' % images.quayci.name,
'export MIGRATION_HEAD=`cat /tmp/ALEMBIC_HEAD | cut -d" " -f1`',
'echo $MIGRATION_HEAD',
'docker build --label db-schema-head=$MIGRATION_HEAD -t %s -f Dockerfile .' % images.quayci.name,
'docker push %s' % images.quayci.name], 'docker push %s' % images.quayci.name],
}, },

View file

@ -9,7 +9,7 @@ container-base-build:
- master - master
- tags - tags
script: script:
- docker build --cache-from quay.io/quay/quay-base:latest -t quay.io/quay/quay-base:latest -f quay-base.dockerfile . - docker build --no-cache -t quay.io/quay/quay-base:latest -f quay-base.dockerfile .
- docker push quay.io/quay/quay-base:latest - docker push quay.io/quay/quay-base:latest
stage: docker_base stage: docker_base
tags: tags:
@ -23,6 +23,10 @@ container-build:
image: docker:git image: docker:git
script: script:
- docker build -t quay.io/quay/quay-ci:${CI_COMMIT_REF_SLUG} -f Dockerfile . - docker build -t quay.io/quay/quay-ci:${CI_COMMIT_REF_SLUG} -f Dockerfile .
- docker run --rm quay.io/quay/quay-ci:${CI_COMMIT_REF_SLUG} cat ALEMBIC_HEAD > /tmp/ALEMBIC_HEAD
- export MIGRATION_HEAD=`cat /tmp/ALEMBIC_HEAD | cut -d" " -f1`
- echo $MIGRATION_HEAD
- docker build --label db-schema-head=$MIGRATION_HEAD -t quay.io/quay/quay-ci:${CI_COMMIT_REF_SLUG} -f Dockerfile .
- docker push quay.io/quay/quay-ci:${CI_COMMIT_REF_SLUG} - docker push quay.io/quay/quay-ci:${CI_COMMIT_REF_SLUG}
stage: docker_build stage: docker_build
tags: tags:

View file

@ -19,7 +19,8 @@ local utils = import "utils.libsonnet";
name: utils.containerName(self.repo, self.tag), name: utils.containerName(self.repo, self.tag),
}, },
quayci: { repo: "quay.io/quay/quay-ci", tag: "${CI_COMMIT_REF_SLUG}", quayci: { repo: "quay.io/quay/quay-ci",
tag: "${CI_COMMIT_REF_SLUG}",
name: utils.containerName(self.repo, self.tag), name: utils.containerName(self.repo, self.tag),
}, },