Skip to content

Instantly share code, notes, and snippets.

@felipefernandes
Last active February 10, 2021 16:14
Show Gist options
  • Save felipefernandes/859f96af5b8a6249468d45d639b095fb to your computer and use it in GitHub Desktop.
Save felipefernandes/859f96af5b8a6249468d45d639b095fb 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