Valid YML

This commit is contained in:
FyloZ 2021-02-11 14:53:32 -05:00
parent eaa69bcc7d
commit 7be8023a2a
1 changed files with 12 additions and 12 deletions

View File

@ -43,18 +43,6 @@ package-backend:
- ColorRecipesExplorer-$CI_PIPELINE_IID.jar
expire_in: 1 week
deploy-backend:
stage: deploy
image: alpine:latest
needs: ['package-backend']
variables:
DEPLOYED_CONTAINER_NAME: "cre_backend"
<<: *before_deploy
script:
- ssh -p $DEPLOYMENT_SERVER_SSH_PORT $DEPLOYMENT_SERVER_USERNAME@$DEPLOYMENT_SERVER "docker stop $DEPLOYED_CONTAINER_NAME || true && docker rm $DEPLOYED_CONTAINER_NAME || true"
- ssh -p $DEPLOYMENT_SERVER_SSH_PORT $DEPLOYMENT_SERVER_USERNAME@$DEPLOYMENT_SERVER "docker login -u $CI_USERNAME -p $CI_ACCESS_TOKEN $CI_REGISTRY && docker pull $CI_REGISTRY_IMAGE_BACKEND"
- ssh -p $DEPLOYMENT_SERVER_SSH_PORT $DEPLOYMENT_SERVER_USERNAME@$DEPLOYMENT_SERVER "docker run -d -p $BACKEND_PORT:$BACKEND_PORT --name=$DEPLOYED_CONTAINER_NAME -e spring_profiles_active=$BACKEND_PROFILES -e spring_datasource_username=$DB_USERNAME -e spring_datasource_password=$DB_PASSWORD -e spring_datasource_url=$DB_URL $CI_REGISTRY_IMAGE_BACKEND"
.before_deploy: &before_deploy
before_script:
- apk update
@ -66,3 +54,15 @@ deploy-backend:
- ssh_add ~/.ssh/id_rsa
- ssh-keyscan -p $DEPLOYMENT_SERVER_SSH_PORT -H $DEPLOYMENT_SERVER >> ~/.ssh/known_hosts
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
deploy-backend:
stage: deploy
image: alpine:latest
needs: ['package-backend']
variables:
DEPLOYED_CONTAINER_NAME: "cre_backend"
<<: *before_deploy
script:
- ssh -p $DEPLOYMENT_SERVER_SSH_PORT $DEPLOYMENT_SERVER_USERNAME@$DEPLOYMENT_SERVER "docker stop $DEPLOYED_CONTAINER_NAME || true && docker rm $DEPLOYED_CONTAINER_NAME || true"
- ssh -p $DEPLOYMENT_SERVER_SSH_PORT $DEPLOYMENT_SERVER_USERNAME@$DEPLOYMENT_SERVER "docker login -u $CI_USERNAME -p $CI_ACCESS_TOKEN $CI_REGISTRY && docker pull $CI_REGISTRY_IMAGE_BACKEND"
- ssh -p $DEPLOYMENT_SERVER_SSH_PORT $DEPLOYMENT_SERVER_USERNAME@$DEPLOYMENT_SERVER "docker run -d -p $BACKEND_PORT:$BACKEND_PORT --name=$DEPLOYED_CONTAINER_NAME -e spring_profiles_active=$BACKEND_PROFILES -e spring_datasource_username=$DB_USERNAME -e spring_datasource_password=$DB_PASSWORD -e spring_datasource_url=$DB_URL $CI_REGISTRY_IMAGE_BACKEND"