I am not new to git but i have just recently started working on deployments using bitbucket pieplines. I have tried to deploy a single file to my server by hardcoding the cmd in bitbucket.yml script. But i am not sure how to read a specific PR which is merged and also read the files from it and then deploy it to server.
I am using javascript/nodejs as the preferred language to write .yml script below is my script file:
# This is a sample build configuration for JavaScript.
# Check our guides at https://confluence.atlassian.com/x/14UWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: node:12.18.2
pipelines:
branches: # deploying as per branches
feature/pocDepTerex: # poc master branch
- step:
name: install node module and test dcu deployment
caches:
- node
script:
- echo "repo branch is $BITBUCKET_BRANCH"
- npm install -g
- dcu -n $HOST_NAME_TEST -k $APP_KEY_TEST -t "widget\helloworld2\display.template"
- git status
- echo "push the etags to destination branch without initiating build"
- git add .
- git commit -m "[skip ci]"
- git push origin feature/pocDepTerex
- fi
Kindly let me know how to achieve this.