Skip to content

Instantly share code, notes, and snippets.

@thesabbir
Created January 9, 2017 10:06
Show Gist options
  • Save thesabbir/7d4cb5537e63557635c0902666695b26 to your computer and use it in GitHub Desktop.
Save thesabbir/7d4cb5537e63557635c0902666695b26 to your computer and use it in GitHub Desktop.
Bitbucket pipeline example for JS projects
image: node:7.0 #node v7
clone: # the 'clone' section
depth: 1 # latest commit only
pipelines:
default:
- step:
script:
- npm i -g yarn
- yarn
- yarn run generate:config
- yarn run lint
- yarn test
branches:
dev: #only for dev branch
- step:
script:
- apt-get update
- apt-get install -y zip
- npm i -g yarn
- yarn
- yarn run generate:config
- yarn run lint
- yarn test
- yarn run build
- mkdir -p ~/.ssh
- echo $KNOWN_HOST >> ~/.ssh/known_hosts
- echo $SSH_KEY >> ~/.ssh/id_rsa.temp
- base64 -d -i ~/.ssh/id_rsa.temp > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- yarn run deploy:pipeline
qa: #only for qa branch
- step:
script:
- apt-get update
- apt-get install -y zip
- npm i -g yarn
- yarn
- yarn run generate:config
- yarn run lint
- yarn test
- yarn run build
- mkdir -p ~/.ssh
- echo $KNOWN_HOST >> ~/.ssh/known_hosts
- echo $SSH_KEY >> ~/.ssh/id_rsa.temp
- base64 -d -i ~/.ssh/id_rsa.temp > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- yarn run deploy:pipeline
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment