Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save marco-martins/edd9272a4053c977e18d3985d8d6a47f to your computer and use it in GitHub Desktop.
Save marco-martins/edd9272a4053c977e18d3985d8d6a47f to your computer and use it in GitHub Desktop.
Bitbucket pipeline for ftp deployment ( Node + Gulp + Bower + FTP + Rsync )
image: node:6.11.2
pipelines:
custom: # Pipelines that are triggered manually
deployment-to-production-init:
- step:
caches:
- node
script: # Modify the commands below to build your repository.
- npm install -g gulp
- npm install -g bower
- npm install
- npm rebuild node-sass --force
- gulp sass --allow-root
- echo $BITBUCKET_COMMIT >> build.txt
- apt-get update
- apt-get -qq install git-ftp
- echo "'_$(git status -uno --porcelain | wc -l)_'"
- git status -uno --porcelain
- echo "Initiating Push site:Source"
- git ftp init --user $FTP_USER --passwd $FTP_PASSWORD ftp://$FTP_HOST/public_html/$FTP_REMOTE_PATH/
deployment-to-production:
- step:
caches:
- node
script: # Modify the commands below to build your repository.
- npm install -g gulp
- npm install -g bower
- npm install
- npm rebuild node-sass --force
- gulp sass --allow-root
- echo $BITBUCKET_COMMIT >> build.txt
- apt-get update
- apt-get -qq install git-ftp
- echo "'_$(git status -uno --porcelain | wc -l)_'"
- git status -uno --porcelain
- echo "Initiating Push site:Source"
- git ftp push --user $FTP_USER --passwd $FTP_PASSWORD ftp://$FTP_HOST/public_html/$FTP_REMOTE_PATH/
branches: # Pipelines that run automatically on a commit to a branch
staging:
- step:
caches:
- node
script:
- apt-get update
- apt-get -qq install rsync
- npm install -g gulp
- npm install -g bower
- npm install
- npm rebuild node-sass --force
- gulp sass --allow-root
- echo $BITBUCKET_COMMIT > build.txt
- rsync -avH * -e "ssh" $SSH_USER@$SSH_HOST:/var/www/html/$FTP_REMOTE_PATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment