Skip to content

Instantly share code, notes, and snippets.

@djom202
Forked from thesabbir/bitbucket-pipelines.yml
Created February 18, 2019 13:58
Show Gist options
  • Save djom202/f37425a52677887c58fc519c3e690093 to your computer and use it in GitHub Desktop.
Save djom202/f37425a52677887c58fc519c3e690093 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