-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add check different submodules for changes
- Loading branch information
Showing
3 changed files
with
52 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/sh | ||
|
||
temp=("$(git diff-tree --submodule=diff --name-only ${GITHUB_EVENT_BEFORE} ${GITHUB_SHA})") | ||
|
||
echo $temp | ||
|
||
# Keeping only distinct values in the array | ||
UNIQ_SUBS=($(echo "${temp[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' ')) | ||
|
||
echo ::set-output name=submodules::$UNIQ_SUBS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,31 @@ | ||
#!/bin/sh | ||
|
||
if [ ! -f "appspec.yml" ]; then | ||
echo $PWD | ||
echo "AppSpec.yml not found in project root" | ||
exit 1 | ||
fi | ||
|
||
sh ./push.sh | ||
sh ./deploy.sh | ||
for SUB in ${1[@]} | ||
do | ||
if [ -d "$SUB" ] | ||
then | ||
cd ${SUB} | ||
if [ ! -f "appspec.yml" ] | ||
then | ||
echo $PWD | ||
echo "AppSpec.yml not found in ${SUB}" | ||
continue | ||
fi | ||
else | ||
continue | ||
fi | ||
|
||
echo "Getting ${SUB} ENV variables ....." | ||
chmod +x ./get_env.sh | ||
sh ./get_env.sh | ||
|
||
echo "Pushing: ${SUB} ......" | ||
chmod +x ./push.sh | ||
sh ./push.sh | ||
|
||
echo "Creating Deployment: ${SUB} ......" | ||
chmod +x ./deploy.sh | ||
sh ./deploy.sh | ||
|
||
cd .. | ||
done |