Your IP : 216.73.216.170
# Select a base image to start working with...
image: deeptrancer/php7.1-centos
# Configure the base image
before_script:
##
## Run ssh-agent (inside the build environment)
##
- eval $(ssh-agent -s)
##
## Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store
## We're using tr to fix line endings which makes ed25519 keys work
## without extra base64 encoding.
## https://gitlab.com/gitlab-examples/ssh-private-key/issues/1#note_48526556
##
- bash -c "ssh-add <(echo '$SSH_PRIVATE_KEY')"
##
## Create the SSH directory and give it the right permissions
##
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
# Define pipline stages
stages:
- deploy
update:
stage: deploy
script:
- ssh -o StrictHostKeyChecking=no root@k-team.korusdev.ru "/home/bitrix/deploy.sh -u -b $CI_COMMIT_REF_NAME; exit \$?"
reset:
stage: deploy
script:
- ssh -o StrictHostKeyChecking=no root@k-team.korusdev.ru "/home/bitrix/deploy.sh -r -b $CI_COMMIT_REF_NAME; exit \$?"
when: manual
delete:
stage: deploy
script:
- ssh -o StrictHostKeyChecking=no root@k-team.korusdev.ru "/home/bitrix/deploy.sh -d -b $CI_COMMIT_REF_NAME; exit \$?"
rules:
- if: '$CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_REF_NAME == "demo" || $CI_COMMIT_REF_NAME == "develop"'
when: never
- if: '$CI_COMMIT_REF_NAME != "master" && $CI_COMMIT_REF_NAME != "demo" && $CI_COMMIT_REF_NAME != "develop"'
when: manual