Commit cb00b2d2 authored by Thomas Löffler's avatar Thomas Löffler

[TASK] Introduces deployment

parent a107222c
variables:
SSH_HOST: proserver@vpro0100.proserver.punkt.de
SSH_PATH: /var/www/deploy
cache:
key: "$CI_BUILD_NAME/$CI_BUILD_REF_NAME"
untracked: true
paths:
- cache/
stages:
- test
- build
- deploy
test:
stage: test
script: echo "Running tests..."
build:
stage: build
script: echo "Running builds..."
deploy_staging:
image: webdevops/php:debian-9
stage: deploy
environment:
name: staging
url: https://vpro0100.proserver.punkt.de
only:
- master
- 9-add-deployment-on-staging-server
before_script:
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Install ssh-agent if not already installed, it is required by Docker.
# (change apt-get to yum if you use a CentOS-based image)
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
# 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
- ssh-add <(echo "$SSH_PRIVATE_KEY")
# For Docker builds disable host key checking. Be aware that by adding that
# you are suspectible to man-in-the-middle attacks.
# WARNING: Use this only with the Docker executor, if you use it with shell
# you will overwrite your user's SSH config.
- mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
- export COMPOSER_CACHE_DIR=.composer
- cd data/typo3/
script:
- composer install --no-dev
- rsync -az -e "ssh" --delete --exclude=fileadmin --exclude=typo3conf/l10n --exclude=.git --exclude=node_modules --exclude=bower_components --exclude=typo3temp --exclude=.ssh --exclude=.sass-cache --exclude=/uploads ./ $SSH_HOST:$SSH_PATH/
- ssh $SSH_HOST chmod +x $SSH_PATH/bin/scripts/prepare.sh
- ssh $SSH_HOST $SSH_PATH/bin/scripts/prepare.sh
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment