Skip to content
Snippets Groups Projects
Commit 1450697b authored by Luigi Sbailo's avatar Luigi Sbailo
Browse files

Update .gitlab-ci.yml file

parent ba5ed90b
Branches
No related tags found
No related merge requests found
Pipeline #119356 passed
...@@ -12,23 +12,50 @@ stages: ...@@ -12,23 +12,50 @@ stages:
- build - build
- deploy - deploy
build: build to app:
stage: build stage: build
before_script: before_script:
- echo "Building the aitoolkit-gui image" - echo "Building the aitoolkit-gui image"
script: script:
- docker login -u ai_toolkit -p ${AI_TOOLKIT_TOKEN} ${APP_REGISTRY} - docker login -u ai_toolkit -p ${AI_TOOLKIT_TOKEN} ${APP_REGISTRY}
- docker pull ${CI_REGISTRY_IMAGE}:latest - docker pull ${CI_REGISTRY_IMAGE}:latest
- docker build --cache-from ${CI_REGISTRY_IMAGE}:latest -t ${CI_REGISTRY_IMAGE}:latest -t ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHORT_SHA} -t ${APP_REGISTRY}:gui -t ${APP_REGISTRY}:gui${CI_COMMIT_SHORT_SHA} -t ${DEVELOP_REGISTRY}:gui -t ${DEVELOP_REGISTRY}:gui${CI_COMMIT_SHORT_SHA} . - docker build --cache-from ${CI_REGISTRY_IMAGE}:latest -t ${CI_REGISTRY_IMAGE}:latest -t ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHORT_SHA} -t ${APP_REGISTRY}:gui -t ${APP_REGISTRY}:gui${CI_COMMIT_SHORT_SHA} .
- docker push ${CI_REGISTRY_IMAGE}:latest - docker push ${CI_REGISTRY_IMAGE}:latest
- docker push ${APP_REGISTRY}:gui - docker push ${APP_REGISTRY}:gui
- docker push ${APP_REGISTRY}:gui${CI_COMMIT_SHORT_SHA} - docker push ${APP_REGISTRY}:gui${CI_COMMIT_SHORT_SHA}
rules:
# Execute jobs when a new commit is pushed to master branch
- if: $CI_COMMIT_BRANCH == 'master'
build to develop:
stage: build
before_script:
- echo "Building the aitoolkit-gui image"
script:
- docker login -u ai_toolkit -p ${AI_TOOLKIT_TOKEN} ${DEVELOP_REGISTRY} - docker login -u ai_toolkit -p ${AI_TOOLKIT_TOKEN} ${DEVELOP_REGISTRY}
- docker pull ${CI_REGISTRY_IMAGE}:latest
- docker build --cache-from ${CI_REGISTRY_IMAGE}:latest -t ${CI_REGISTRY_IMAGE}:develop -t ${DEVELOP_REGISTRY}:gui -t ${DEVELOP_REGISTRY}:gui${CI_COMMIT_SHORT_SHA} .
- docker push ${CI_REGISTRY_IMAGE}:develop
- docker push ${DEVELOP_REGISTRY}:gui${CI_COMMIT_SHORT_SHA} - docker push ${DEVELOP_REGISTRY}:gui${CI_COMMIT_SHORT_SHA}
- docker push ${DEVELOP_REGISTRY}:gui - docker push ${DEVELOP_REGISTRY}:gui
rules:
# Execute jobs when a new commit is pushed to develop branch
- if: $CI_COMMIT_BRANCH == 'develop'
deploy: deploy to app:
image: python:3.6 image: python:3.6
stage: deploy stage: deploy
script: script:
- ./.gitlab-ci/update_tag_app.sh - ./.gitlab-ci/update_tag_app.sh
rules:
# Execute jobs when a new commit is pushed to master branch
- if: $CI_COMMIT_BRANCH == 'master'
deploy to develop:
image: python:3.6
stage: deploy
script:
- ./.gitlab-ci/update_tag_develop.sh
rules:
# Execute jobs when a new commit is pushed to master branch
- if: $CI_COMMIT_BRANCH == 'develop'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment