Example Bitbucket Pipeline CI script to deploy a PHP/WordPress website using FTP.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Auto deploy staging to staging | |
# Manual deploy master to production | |
image: php:7.1.29 | |
pipelines: | |
branches: | |
staging: | |
- step: | |
name: Deploy to Staging | |
script: | |
- echo "Deploy to Staging" | |
- apt-get update -qq && apt-get install -y -qq lftp | |
- lftp -c "set ftp:ssl-allow no; open -u '$STAGING_USER','$STAGING_PASSWORD' '$STAGING_HOST'; mirror -Rnv ./ / --ignore-time --parallel=10 --exclude-glob .git* --exclude .git/" | |
master: | |
- step: | |
script: | |
- echo "Deploy to Production" | |
- step: | |
name: Deploy to Production | |
script: | |
- apt-get update -qq && apt-get install -y -qq lftp | |
- lftp -c "set ftp:ssl-allow no; open -u $PRODUCTION_USER,'$PRODUCTION_PASSWORD' $PRODUCTION_HOST; mirror -Rnv ./ / --ignore-time --parallel=10 --exclude-glob .git* --exclude .git/" | |
trigger: manual |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment