-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsome.sh
24 lines (20 loc) · 1014 Bytes
/
some.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
git config --global user.email "robbyra@gmail.com"
git config --global user.name "sang-w0o"
git config --global user.password $GHB_PAT
# mkdir DEVOPS_FOLDER
# git clone $DEVOPS_REPO_URL ./DEVOPS_FOLDER
# cd ./DEVOPS_FOLDER/k8s
cd ./Planit-DevOps/k8s
# line to change: image: 598334522273.dkr.ecr.ap-northeast-2.amazonaws.com/planit_product:*
# change image tag to $COMMIT_HASH
sed -i "s/598334522273.dkr.ecr.ap-northeast-2.amazonaws.com\/planit_product:.*/598334522273.dkr.ecr.ap-northeast-2.amazonaws.com\/planit_product:$COMMIT_HASH/" deployment-rollout.yaml
git remote set-url origin $DEVOPS_REPO_URL
git checkout -b "deploy/$COMMIT_HASH"
git add .
git commit -m "Deploy product image(tag: $COMMIT_HASH)"
git push origin "deploy/$COMMIT_HASH"
# Create pull request and request review to sang-w0o
export GH_TOKEN=$GHB_PAT
gh auth login
gh pr create -B master --title "Deploy product image(tag: $COMMIT_HASH)" --body "Deploy product image(tag: $COMMIT_HASH)" -a "@me" -R PlanIt-Study/Planit-DevOps