Skip to content

Commit

Permalink
Merge pull request #886 from Azure/commit_json_to_branch
Browse files Browse the repository at this point in the history
generate_sonic_image_links.sh is modified to checkout a dedicated branch(sonic_latest_images_links) and commit the sonic images links related json file to this branch.

json file from master branch is no more required and hence it is deleted.

html file updated to use the json file that is getting created in the branch
  • Loading branch information
xumia authored Oct 21, 2021
2 parents 61fcbae + 87231d2 commit 56b95cb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/sonic_image_links_create_workflow.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This is a basic workflow to help you get started with GitHub Actions

name: Run the shell script to generate sonic image links in sonic_image_links.json
name: Run the shell script to generate sonic image links in sonic_image_links.json in a dedicated branch

# Run the script once in a minute. Github may take 15 minutes to run this even though we request once in a minute, which is OK.
on:
Expand Down
11 changes: 7 additions & 4 deletions generate_sonic_image_links.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#!/usr/bin/env bash
git checkout -b sonic_latest_images_links
git config --global user.email "[email protected]"
git config --global user.name "xinliu-seattle"
git reset --hard
git pull origin sonic_latest_images_links

#set -euo pipefail

Expand Down Expand Up @@ -145,8 +150,6 @@ do
done
echo "\n}" >> sonic_image_links.json

git config --global user.email "[email protected]"
git config --global user.name "xinliu-seattle"
git add sonic_image_links.json
git commit -m "latest links for sonic images"
git push
git commit -m "latest links for sonic images in dedicated branch sonic_latest_images_links"
git push -f --set-upstream origin sonic_latest_images_links
Empty file modified sonic_image_links.json
100755 → 100644
Empty file.
4 changes: 2 additions & 2 deletions sonic_latest_images.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ <h2> Latest Successful Builds </h2><br>

</p>
<p class="mt-4">
<a href="https://sonic-build.azurewebsites.net/ui/sonic/Pipelines">click here</a></span></td> for previous builds3 <br>
<a href="https://sonic-build.azurewebsites.net/ui/sonic/Pipelines">click here</a></span></td> for previous builds <br>
</p>

</p>
Expand All @@ -77,7 +77,7 @@ <h2> Latest Successful Builds </h2><br>

<script>
$(document).ready(function () {
$.getJSON("sonic_image_links.json",
$.getJSON("https://raw.githubusercontent.com/Azure/SONiC/sonic_latest_images_links/sonic_image_links.json",
function(data) {
dbs = data;
branches = Object.keys(data);
Expand Down

0 comments on commit 56b95cb

Please sign in to comment.