|
| 1 | +stages: |
| 2 | + - build-image |
| 3 | + |
| 4 | +.job_template: &build_image_definition_dh |
| 5 | + image: docker:19 |
| 6 | + stage: build-image |
| 7 | + services: |
| 8 | + - alias: docker |
| 9 | + name: docker:19.03.5-dind |
| 10 | + script: |
| 11 | + - apk add --no-cache bash |
| 12 | + - bash ./ci_docker_build_push.sh |
| 13 | + variables: &extended_image_vars_dh |
| 14 | + REGISTRY_USER: "${DH_CI_REGISTRY_USER}" |
| 15 | + REGISTRY_PASSWORD: "${DH_CI_REGISTRY_PASSWORD}" |
| 16 | + REGISTRY: "${DH_CI_REGISTRY}" |
| 17 | + DOCKER_NAME: "postgresai/migration-tools" |
| 18 | + |
| 19 | +.job_template: &build_image_definition_gl |
| 20 | + image: docker:19 |
| 21 | + stage: build-image |
| 22 | + services: |
| 23 | + - alias: docker |
| 24 | + name: docker:19.03.5-dind |
| 25 | + script: |
| 26 | + - apk add --no-cache bash |
| 27 | + - bash ./ci_docker_build_push.sh |
| 28 | + variables: &extended_image_vars_gl |
| 29 | + REGISTRY_USER: "${CI_REGISTRY_USER}" |
| 30 | + REGISTRY_PASSWORD: "${CI_REGISTRY_PASSWORD}" |
| 31 | + REGISTRY: "${CI_REGISTRY}" |
| 32 | + DOCKER_NAME: "registry.gitlab.com/postgres-ai/custom-images/migration-tools" |
| 33 | + |
| 34 | +.only_var_template: &only_tag_release |
| 35 | + only: |
| 36 | + variables: |
| 37 | + - $CI_COMMIT_TAG =~ /^[0-9.]+$/ |
| 38 | + changes: |
| 39 | + - migration-tools/* |
| 40 | + |
| 41 | +.only_var_template: &only_feature |
| 42 | + only: |
| 43 | + refs: |
| 44 | + - branches |
| 45 | + variables: |
| 46 | + - $CI_COMMIT_REF_SLUG != "master" |
| 47 | + changes: |
| 48 | + - migration-tools/* |
| 49 | + when: manual |
| 50 | + |
| 51 | +build-sqitch-image-latest: |
| 52 | + <<: *build_image_definition_dh |
| 53 | + <<: *only_tag_release |
| 54 | + variables: |
| 55 | + <<: *extended_image_vars_dh |
| 56 | + TOOL_NAME: "sqitch" |
| 57 | + DOCKER_FILE: "migration-tools/sqitch.Dockerfile" |
| 58 | + TAGS: "${DOCKER_NAME}:${TOOL_NAME},${DOCKER_NAME}:${TOOL_NAME}-${CI_COMMIT_TAG}" |
| 59 | + |
| 60 | +build-flyway-image-latest: |
| 61 | + <<: *build_image_definition_dh |
| 62 | + <<: *only_tag_release |
| 63 | + variables: |
| 64 | + <<: *extended_image_vars_dh |
| 65 | + TOOL_NAME: "flyway" |
| 66 | + DOCKER_FILE: "migration-tools/flyway.Dockerfile" |
| 67 | + TAGS: "${DOCKER_NAME}:${TOOL_NAME},${DOCKER_NAME}:${TOOL_NAME}-${CI_COMMIT_TAG}" |
| 68 | + |
| 69 | +build-liquibase-image-latest: |
| 70 | + <<: *build_image_definition_dh |
| 71 | + <<: *only_tag_release |
| 72 | + variables: |
| 73 | + <<: *extended_image_vars_dh |
| 74 | + TOOL_NAME: "liquibase" |
| 75 | + DOCKER_FILE: "migration-tools/liquibase.Dockerfile" |
| 76 | + TAGS: "${DOCKER_NAME}:${TOOL_NAME},${DOCKER_NAME}:${TOOL_NAME}-${CI_COMMIT_TAG}" |
| 77 | + |
| 78 | +build-rake-image-latest: |
| 79 | + <<: *build_image_definition_dh |
| 80 | + <<: *only_tag_release |
| 81 | + variables: |
| 82 | + <<: *extended_image_vars_dh |
| 83 | + TOOL_NAME: "rake" |
| 84 | + DOCKER_FILE: "migration-tools/rake.Dockerfile" |
| 85 | + TAGS: "${DOCKER_NAME}:${TOOL_NAME},${DOCKER_NAME}:${TOOL_NAME}-${CI_COMMIT_TAG}" |
| 86 | + |
| 87 | +build-django-image-latest: |
| 88 | + <<: *build_image_definition_dh |
| 89 | + <<: *only_tag_release |
| 90 | + variables: |
| 91 | + <<: *extended_image_vars_dh |
| 92 | + TOOL_NAME: "django" |
| 93 | + DOCKER_FILE: "migration-tools/django.Dockerfile" |
| 94 | + TAGS: "${DOCKER_NAME}:${TOOL_NAME},${DOCKER_NAME}:${TOOL_NAME}-${CI_COMMIT_TAG}" |
| 95 | + |
| 96 | +build-sqitch-image-feature: |
| 97 | + <<: *build_image_definition_gl |
| 98 | + <<: *only_feature |
| 99 | + variables: |
| 100 | + <<: *extended_image_vars_gl |
| 101 | + TOOL_NAME: "sqitch" |
| 102 | + DOCKER_FILE: "migration-tools/sqitch.Dockerfile" |
| 103 | + TAGS: "${DOCKER_NAME}:${TOOL_NAME},${DOCKER_NAME}:${TOOL_NAME}-${CI_COMMIT_REF_SLUG}" |
| 104 | + |
| 105 | + |
| 106 | +build-flyway-image-feature: |
| 107 | + <<: *build_image_definition_gl |
| 108 | + <<: *only_feature |
| 109 | + variables: |
| 110 | + <<: *extended_image_vars_gl |
| 111 | + TOOL_NAME: "flyway" |
| 112 | + DOCKER_FILE: "migration-tools/flyway.Dockerfile" |
| 113 | + TAGS: "${DOCKER_NAME}:${TOOL_NAME},${DOCKER_NAME}:${TOOL_NAME}-${CI_COMMIT_REF_SLUG}" |
| 114 | + |
| 115 | +build-liquibase-image-feature: |
| 116 | + <<: *build_image_definition_gl |
| 117 | + <<: *only_feature |
| 118 | + variables: |
| 119 | + <<: *extended_image_vars_gl |
| 120 | + TOOL_NAME: "liquibase" |
| 121 | + DOCKER_FILE: "migration-tools/liquibase.Dockerfile" |
| 122 | + TAGS: "${DOCKER_NAME}:${TOOL_NAME},${DOCKER_NAME}:${TOOL_NAME}-${CI_COMMIT_REF_SLUG}" |
| 123 | + |
| 124 | +build-rake-image-feature: |
| 125 | + <<: *build_image_definition_gl |
| 126 | + <<: *only_feature |
| 127 | + variables: |
| 128 | + <<: *extended_image_vars_gl |
| 129 | + TOOL_NAME: "rake" |
| 130 | + DOCKER_FILE: "migration-tools/rake.Dockerfile" |
| 131 | + TAGS: "${DOCKER_NAME}:${TOOL_NAME},${DOCKER_NAME}:${TOOL_NAME}-${CI_COMMIT_REF_SLUG}" |
| 132 | + |
| 133 | +build-django-image-feature: |
| 134 | + <<: *build_image_definition_gl |
| 135 | + <<: *only_feature |
| 136 | + variables: |
| 137 | + <<: *extended_image_vars_gl |
| 138 | + TOOL_NAME: "django" |
| 139 | + DOCKER_FILE: "migration-tools/django.Dockerfile" |
| 140 | + TAGS: "${DOCKER_NAME}:${TOOL_NAME},${DOCKER_NAME}:${TOOL_NAME}-${CI_COMMIT_REF_SLUG}" |
0 commit comments