diff --git a/templates/build-docker.yml b/templates/build-docker.yml new file mode 100644 index 0000000000000000000000000000000000000000..92e916230a9ab0f4ab7091236ef07dd6cb608d38 --- /dev/null +++ b/templates/build-docker.yml @@ -0,0 +1,43 @@ +.build-docker: + extends: .nexus + script: + - > + docker build + --pull + --quiet + --cache-from $PATRINAT_REGISTRY/$CI_IMAGE:$TAG_CACHE + --tag $PATRINAT_REGISTRY/$CI_IMAGE:$TAG + . + - docker push $PATRINAT_REGISTRY/$CI_IMAGE:$TAG + +🐳 image-test: + extends: .build-docker + stage: push + rules: + - if: '$CI_COMMIT_BRANCH =~ /^(?:sprint|(?:hot)?fix(?:es)?|feature)-.+/' + variables: + TAG_BUILD: test + TAG_CACHE: test + +🐳 image-preprod: + extends: .build-docker + stage: push + rules: + - if: '$CI_COMMIT_BRANCH == "master"' + - if: $CI_COMMIT_TAG + when: never + variables: + TAG_BUILD: preprod + TAG_CACHE: preprod + +🐳 image-prod: + extends: .build-docker + stage: push + rules: + - if: $CI_COMMIT_TAG + variables: + TAG_BUILD: $CI_COMMIT_REF_NAME + TAG_CACHE: latest + after_script: + - docker tag $PATRINAT_REGISTRY/$CI_IMAGE:$CI_COMMIT_REF_NAME $PATRINAT_REGISTRY/$CI_IMAGE:latest + - docker push $PATRINAT_REGISTRY/$CI_IMAGE:latest diff --git a/templates/deploy-portainer.yml b/templates/deploy-portainer.yml new file mode 100644 index 0000000000000000000000000000000000000000..04c745545243940648d0c00ad27a04f1efae6922 --- /dev/null +++ b/templates/deploy-portainer.yml @@ -0,0 +1,38 @@ +.deploy: + image: curlimages/curl-base:latest + stage: deploy + variables: + GIT_STRATEGY: none + tags: + - docker-deploy + script: + - curl -XPOST "${DEPLOY_WEBHOOK}" + +🎆 deploy-test: + extends: .deploy + needs: [ "🐳 image-test" ] + environment: + name: staging + url: https://"$TEST_SERVER_URL" + rules: + - if: '$CI_COMMIT_BRANCH =~ /^(?:sprint|(?:hot)?fix(?:es)?|feature)-.+/' + +🎆 deploy-preprod: + extends: .deploy + needs: [ "🐳 image-preprod" ] + environment: + name: preproduction + url: https://"$PREPPROD_SERVER_URL" + rules: + - if: '$CI_COMMIT_BRANCH == "master"' + - if: $CI_COMMIT_TAG + when: never + +🎆 deploy-prod: + extends: .deploy + needs: [ "🐳 image-prod" ] + environment: + name: production + url: https://"$PROD_SERVER_URL" + rules: + - if: $CI_COMMIT_TAG