File tree Expand file tree Collapse file tree 3 files changed +52
-14
lines changed Expand file tree Collapse file tree 3 files changed +52
-14
lines changed Original file line number Diff line number Diff line change @@ -26,15 +26,22 @@ runs:
26
26
aws-access-key-id : ${{ secrets.AWS_ACCESS_KEY_ID }}
27
27
aws-secret-access-key : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
28
28
aws-region : ${{ secrets.AWS_REGION }}
29
- - run : chmod +x ./scripts/get_env.sh && ./scripts/get_env.sh
29
+ - id : get-diff
30
+ name : Get different submodules
31
+ run : chmod +x ./scripts/diff.sh && ./scripts/diff.sh
32
+ env :
33
+ GITHUB_EVENT_BEFORE : ${{ github.event.before }}
34
+ GITHUB_SHA : ${{ github.GITHUB_SHA }}
35
+ outputs :
36
+ submodules :
37
+ description : " Submodules to be deployed"
38
+ - name : Deploy to AWS
39
+ run : chmod +x ./main.sh && ./scripts/main.sh ${{ steps.get-diff.outputs.submodules }}
30
40
shell : bash
31
41
env :
32
42
GET_ENV : ${{ inputs.get-env }}
33
43
ENV_BUCKET : ${{ inputs.env-bucket }}
34
- - run : chmod +x ./main.sh && ./scripts/main.sh
35
- shell : bash
36
- env :
37
44
AWS_APP_NAME : ${{ inputs.aws-app-name }}
38
- APP_BUCKET : ${{ inputs.app-bucket }}
45
+ AWS_PUBLISH_BUCKET_NAME : ${{ inputs.app-bucket }}
39
46
AWS_FILENAME : ${{ inputs.aws-app-name }}-${{ github.sha }}
40
- AWS_GROUP : ${{ inputs.app-group }}
47
+ AWS_DEPLOY_GROUP : ${{ inputs.app-group }}
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ temp=(" $( git diff-tree --submodule=diff --name-only ${GITHUB_EVENT_BEFORE} ${GITHUB_SHA} ) " )
4
+
5
+ echo $temp
6
+
7
+ # Keeping only distinct values in the array
8
+ UNIQ_SUBS=($( echo " ${temp[@]} " | tr ' ' ' \n' | sort -u | tr ' \n' ' ' ) )
9
+
10
+ echo ::set-output name=submodules::$UNIQ_SUBS
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
3
- if [ ! -f " appspec.yml" ]; then
4
- echo $PWD
5
- echo " AppSpec.yml not found in project root"
6
- exit 1
7
- fi
8
-
9
- sh ./push.sh
10
- sh ./deploy.sh
3
+ for SUB in ${1[@]}
4
+ do
5
+ if [ -d " $SUB " ]
6
+ then
7
+ cd ${SUB}
8
+ if [ ! -f " appspec.yml" ]
9
+ then
10
+ echo $PWD
11
+ echo " AppSpec.yml not found in ${SUB} "
12
+ continue
13
+ fi
14
+ else
15
+ continue
16
+ fi
17
+
18
+ echo " Getting ${SUB} ENV variables ....."
19
+ chmod +x ./get_env.sh
20
+ sh ./get_env.sh
21
+
22
+ echo " Pushing: ${SUB} ......"
23
+ chmod +x ./push.sh
24
+ sh ./push.sh
25
+
26
+ echo " Creating Deployment: ${SUB} ......"
27
+ chmod +x ./deploy.sh
28
+ sh ./deploy.sh
29
+
30
+ cd ..
31
+ done
You can’t perform that action at this time.
0 commit comments