Skip to content
Snippets Groups Projects
Commit 5eafbd1a authored by Guilherme Arthur Gerônimo's avatar Guilherme Arthur Gerônimo
Browse files

CICD

parent 232b75f7
Branches main
No related tags found
No related merge requests found
......@@ -7,9 +7,35 @@ stages:
build:
stage: build
only:
- master
- staging
- main
script:
- docker build ./ -t "$CI_REGISTRY_IMAGE:latest" --no-cache
- docker build ./ -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" --no-cache
- docker login $CI_REGISTRY -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD
- docker push "$CI_REGISTRY_IMAGE:latest"
- docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
.deploy: &deploy
stage: portainer
variables:
GIT_CHECKOUT: "false"
script:
- if [[ ! -z "${WEBHOOK_PORTAINER}" ]]; then
for url in $(echo ${WEBHOOK_PORTAINER} | sed "s/,/ /g"); do wget --post-data '' -O - "$url"; done
else
echo "Empty \$WEBHOOK_PORTAINER" ; exit 1;
fi
deploy_main:
<<: *deploy
only:
- main
environment:
name: main
deploy_staging:
<<: *deploy
only:
- staging
environment:
name: staging
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment