-
Notifications
You must be signed in to change notification settings - Fork 1
120 lines (98 loc) · 3.51 KB
/
Copy pathdevPR.yml
File metadata and controls
120 lines (98 loc) · 3.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: Github to Jira integration
on:
pull_request:
branches:
- dev
jobs:
PrRequest:
name: Transition Issu
runs-on: ubuntu-latest
steps:
- name: Login
uses: atlassian/gajira-login@master
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASEURL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER }}
JIRA_API_TOKEN: ${{ secrets.JIRA_TOKEN }}
- name: Find Issue Key
id: find2
uses: atlassian/gajira-find-issue-key@v2.0.2
with:
string: ${{ github.event.pull_request.title }}
from: ""
- name: Transition issue
uses: atlassian/gajira-transition@master
with:
issue: ${{ steps.find2.outputs.issue }}
transition: "ReadyForCodeReview"
- name: Comment on issue
uses: atlassian/gajira-comment@master
with:
issue: ${{ steps.find2.outputs.issue }}
comment: "${{ steps.find2.outputs.issue }} pushed to repository: ${{ github.event.repository.full_name }}"
deploy:
name: Build image
needs: PrRequest
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Install kubectl
uses: azure/setup-kubectl@v1
with:
version: 'v1.21.3'
id: install
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-session-token: ${{ secrets.AWS_SESSION_TOKEN }}
aws-region: us-east-1
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Load secrets and save to app.env
run: aws secretsmanager get-secret-value --secret-id simple_bank --query SecretString --output text | jq -r 'to_entries|map("\(.key)=\(.value)")|.[]' > app.env
- name: Build, tag, and push image to Amazon ECR
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: team2
IMAGE_TAG: ${{ github.sha }}
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -t $ECR_REGISTRY/$ECR_REPOSITORY:latest .
docker push -a $ECR_REGISTRY/$ECR_REPOSITORY
- name: Update kube config
run: aws eks --region us-east-1 update-kubeconfig --name aws_depolyment_team2
- name: Deploy image to Amazon EKS
run: |
kubectl apply -f deployProd.yaml
kubectl apply -f serviceProd.yaml
kubectl rollout restart deployment react-form -n default
test-transition-issue:
name: Transition Issue
needs: deploy
runs-on: ubuntu-latest
steps:
- name: Login
uses: atlassian/gajira-login@master
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASEURL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER }}
JIRA_API_TOKEN: ${{ secrets.JIRA_TOKEN }}
- name: Find Issue Key
id: find3
uses: atlassian/gajira-find-issue-key@v2.0.2
with:
string: ${{ github.event.pull_request.title }}
from: ""
- name: Transition issue
uses: atlassian/gajira-transition@master
with:
issue: ${{ steps.find3.outputs.issue }}
transition: "InCodeReview"
- name: Comment on issue
uses: atlassian/gajira-comment@master
with:
issue: ${{ steps.find3.outputs.issue }}
comment: "${{ steps.find3.outputs.issue }} pushed to repository: ${{ github.event.repository.full_name }}"