-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize the content of the alerts. (#640)
Signed-off-by: ZePan110 <[email protected]> Signed-off-by: chensuyue <[email protected]>
- Loading branch information
Showing
1 changed file
with
33 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,6 +51,7 @@ jobs: | |
fi | ||
- name: Check for changed Dockerfile paths in readme | ||
if: always() | ||
run: | | ||
set -e | ||
shopt -s globstar | ||
|
@@ -75,6 +76,37 @@ jobs: | |
exit 1 | ||
fi | ||
- name: Check new Dockerfile in compose yaml | ||
if: always() | ||
run: | | ||
set -xe | ||
shopt -s globstar | ||
cd ${{github.workspace}} | ||
no_add="FALSE" | ||
merged_commit=$(git log -1 --format='%H') | ||
changed_files="$(git diff --name-status --diff-filter=A ${{ github.event.pull_request.base.sha }} ${merged_commit} -- '**/Dockerfile**' | cut -f2)" | ||
changed_yamls="$(git diff --name-status --diff-filter=AM ${{ github.event.pull_request.base.sha }} ${merged_commit} -- '**/*.yaml**' | cut -f2)" | ||
if [ -n "$changed_files" ]; then | ||
for file in $changed_files; do | ||
service=$(echo "$file" | awk -F '/' '{print $2}') | ||
if find "${{github.workspace}}/.github/workflows/docker/compose/" -name "*$service*" |grep -q .; then | ||
if [ -n "$changed_files" ] && grep -q $service'-compose-cd.yaml' <<< "$changed_yamls"; then | ||
echo "The $file has been added to the ${{github.workspace}}/.github/workflows/docker/compose/"$service"-compose-cd.yaml." | ||
else | ||
echo "Please check if the added $file is included in the yaml under path ${{github.workspace}}/.github/workflows/docker/compose/"$service"-compose-cd.yaml." | ||
no_add="TRUE" | ||
fi | ||
else | ||
echo "Please create a new compose file named "$service"-compose-cd.yaml in ${{github.workspace}}/.github/workflows/docker/compose/ for $file and fill it in." | ||
no_add="TRUE" | ||
fi | ||
done | ||
fi | ||
if [[ "$no_add" == "TRUE" ]]; then | ||
exit 1 | ||
fi | ||
Dockerfile-path-change-detection-in-GenAIExamples: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
@@ -99,7 +131,7 @@ jobs: | |
is_use="FALSE" | ||
used_files="" | ||
merged_commit=$(git log -1 --format='%H') | ||
changed_files="$(git diff --name-status --diff-filter=DR ${{ github.event.pull_request.base.sha }} ${merged_commit} -- '**/Dockerfile' | cut -f2)" | ||
changed_files="$(git diff --name-status --diff-filter=DR ${{ github.event.pull_request.base.sha }} ${merged_commit} -- '**/Dockerfile**' | cut -f2)" | ||
if [ -n "$changed_files" ]; then | ||
for file in $changed_files; do | ||
matching_files=$(grep -rl "$file" ../GenAIExamples/**/*.md) | ||
|
@@ -118,34 +150,3 @@ jobs: | |
echo "Please modify the corresponding README in GenAIExamples repo and ask [email protected] for final confirmation." | ||
exit 1 | ||
fi | ||
Dockerfile-addition-detection-in-GenAIComps: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Clean Up Working Directory | ||
run: sudo rm -rf ${{github.workspace}}/* | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Check if the Dockerfile has been added | ||
run: | | ||
set -e | ||
shopt -s globstar | ||
cd ${{github.workspace}} | ||
is_use="FALSE" | ||
used_files="" | ||
merged_commit=$(git log -1 --format='%H') | ||
changed_files="$(git diff --name-status --diff-filter=A ${{ github.event.pull_request.base.sha }} ${merged_commit} -- '**/Dockerfile**' | cut -f2)" | ||
if [ -n "$changed_files" ]; then | ||
for file in $changed_files; do | ||
if find "${{github.workspace}}/.github/workflows/docker/compose/" -name "*$(echo "$file" | awk -F '/' '{print $2}')*" |grep -q .; then | ||
echo "Please check if the added $file is included in the yaml under path ${{github.workspace}}/.github/workflows/docker/compose/." | ||
else | ||
echo "Please create a new compose file named service_name-compose-cd.yaml in ${{github.workspace}}/.github/workflows/docker/compose/ for $file and fill it in." | ||
fi | ||
done | ||
exit 1 | ||
fi |