Skip to content

Instantly share code, notes, and snippets.

@allfake
Created July 11, 2022 08:23
Show Gist options
  • Save allfake/7802ecccc3f401ec4b6e3c581815ae64 to your computer and use it in GitHub Desktop.
Save allfake/7802ecccc3f401ec4b6e3c581815ae64 to your computer and use it in GitHub Desktop.
Use pipeline
when any commit come to master pileline will build deploy and rsync(atlassian/rsync-deploy:x.x.x) to server
you need to create SSH keys in bitbucket to have Known hosts
-> Repository setting -> SSH keys
Make sure you set [SSH key] in authorized_keys
Exameple of build Vuejs and upload to server
pipelines:
branches:
master:
- step:
name: Build
image: node:10
caches:
- node
script:
- npm install
- npm run build
artifacts:
- dist/**
- step:
name: Deploy
deployment: staging
script:
- pipe: atlassian/rsync-deploy:0.7.0
variables:
USER: 'Your user'
SERVER: 'Your server'
LOCAL_PATH: 'dist/*'
REMOTE_PATH: 'Your upload to path'
=================================================
pipelines:
branches: (use branches)
master: (when push to master branche then do this step)
- step:
name: Build
image: node:10 (nodejs version)
caches:
- node
script:
- npm install
- npm run build (For me when build complete will copy files to dist folder)
artifacts: (when push to master branche then do this step)
- dist/** (share dist/** to next step)
- step:
name: Deploy
deployment: staging
script:
- pipe: atlassian/rsync-deploy:0.7.0 (this is rsync)
variables:
USER: 'Your user'
SERVER: 'Your server'
LOCAL_PATH: 'dist/*'(get dist/* from artifacts)
REMOTE_PATH: 'Your upload to path'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment