Your IP : 216.73.216.170


Current Path : /home/bitrix/ext_www/mr.yacl.site/
Upload File :
Current File : /home/bitrix/ext_www/mr.yacl.site/.gitlab-ci.yml

# 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

# накатываем git и миграции
deploy_default:
  stage: deploy
  script:
    - ssh -o StrictHostKeyChecking=no root@mrgroup.korusdev.ru "cd /home/bitrix/www; git reset --hard; git pull; composer install; php vendor/bin/bim up --force"
  environment:
    name: test/$CI_COMMIT_REF_NAME
    url: https://mrgroup.korusdev.ru/
  when: always
  only:
    - develop

switch_branch:
  stage: deploy
  script:
    - ssh -o StrictHostKeyChecking=no root@mrgroup.korusdev.ru "cd /home/bitrix/www; git reset --hard; git fetch --all; git checkout $CI_COMMIT_REF_NAME; git pull origin $CI_COMMIT_REF_NAME; composer install; php vendor/bin/bim up --force"
  environment:
    name: test/$CI_COMMIT_REF_NAME
    url: https://mrgroup.korusdev.ru/
  when: manual