Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example Bitbucket Pipeline CI script to deploy a PHP/WordPress website using FTP.
# 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
You can’t perform that action at this time.