I'm trying to write the script to do continuous deployment after the testing, but rsync is not installed in pipelines containers. apt-get install rsync doesn't work either.
How do you advise me to do continuous deployment over ssh?
I use the image: php:7.1.1
# This is a sample build configuration for PHP.
# Check our guides at https://confluence.atlassian.com/x/e8YWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: php:7.1.1
pipelines:
branches:
master:
- step:
caches:
- composer
script:
- apt-get update && apt-get install -y unzip rsync
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- composer install
- step:
name: rsync
script:
- rsync -zrSlh --stats --exclude-from=deployment-exclude-list.txt $BITBUCKET_CLONE_DIR/ $DEPLOY_USER@$DEPLOY_HOST:$DEPLOY_PATH
In case this helps anyone, my working pipeline:
image: atlassian/default-image:latest
pipelines:
custom:
staging:
- step:
name: 'Deploy to staging'
deployment: staging
script:
- rsync -rltDvzCh --delete --stats --exclude-from=deployment/exclude -e 'ssh -e none' $BITBUCKET_CLONE_DIR/ $DEPLOY_USER@$DEPLOY_HOST:$DEPLOY_PATH
production:
- step:
name: 'Deploy to production'
deployment: production
script:
- rsync -rltDvzCh --delete --stats --exclude-from=deployment/exclude -e 'ssh -e none' $BITBUCKET_CLONE_DIR/ $DEPLOY_USER@$DEPLOY_HOST:$DEPLOY_PATH
I struggled with 2 issues:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.