Skip to content

Commit

Permalink
feat(ci): add ci support for madoguchi (#310)
Browse files Browse the repository at this point in the history
* wip

* feat(ci): add Madoguchi support to autobuild ci
  • Loading branch information
madonuko authored Apr 7, 2023
1 parent a59679e commit 4a2cced
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 21 deletions.
27 changes: 6 additions & 21 deletions .github/workflows/autobuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,6 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
#- run: git checkout HEAD^

# - name: Generate Build matrix
# id: generate_build_matrix
# # generate build matrix by checking out changes in anda/
# run: |
# # get the list of changed folders in the current commit, including subfolders
# changed_folders=$(git diff --name-only HEAD^ | grep -oP 'anda\/(.+)(\/|\$)' | sort -u )
# echo "Changed folders: $changed_folders"
# # if changed_folders is empty then set is empty to true
# if [ -z "$changed_folders" ]; then
# echo "::set-output name=is_empty::true"
# else
# echo "::set-output name=is_empty::false"
# fi
# # turn it into a json array
# build_matrix=$(echo "$changed_folders" | jq -R . | jq -s . | jq -c .)

# echo "::set-output name=build_matrix::$build_matrix"
# #echo "::set-output name=build_matrix::$build_matrix"
- name: Generate build matrix
id: generate_build_matrix
run: |
Expand Down Expand Up @@ -80,7 +60,8 @@ jobs:
extraArgs: -D "sccache_bucket ${{secrets.SCCACHE_BUCKET}}" -D "sccache_endpoint ${{secrets.SCCACHE_ENDPOINT}}" -D "sccache_secret ${{secrets.SCCACHE_SECRET}}" -D "sccache_accesskey ${{secrets.SCCACHE_ACCESSKEY}}"
andaRepo: https://github.com/terrapkg/subatomic-repos/raw/main/terra${{ matrix.version }}.repo

- id: art
- name: Generating artifact name
id: art
run: |
NAME=${{ matrix.pkg.pkg }}-${{ matrix.pkg.arch }}-${{ matrix.version }}
x=${NAME//\//@}
Expand All @@ -98,3 +79,7 @@ jobs:
--server https://subatomic.fyralabs.com \
--token ${{ secrets.SUBATOMIC_TOKEN }} \
terra${{ matrix.version }} anda-build/rpm/rpms/*
- name: Notify Madoguchi
if: always()
run: ./.github/workflows/mg.sh ${{success()}} ${{matrix.pkg.pkg}} ${{matrix.version}} ${{matrix.pkg.arch}} ${{github.run_id}} ${{secrets.MADOGUCHI_JWT}}
12 changes: 12 additions & 0 deletions .github/workflows/mg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
if $1; then
dirs=${$2/\/pkg/}
export p="{\"id\":\"$5\",\"verl\":\"%v\",\"arch\":\"$4\",\"dirs\":\"$dirs\"}"
else
export p="{\"id\":\"$5\",\"verl\":\"%v\",\"arch\":\"$4\"}"
fi
for f in anda-build/rpm/rpms/*; do
n=$(lesspipe.sh $f | grep -E "Name\s*: " | sed "s@Name\s*: @@")
v=$(echo ${f/${n}-/} | sed -E "s@\.fc$3.+@@")
curl -H "Authorization: Bearer $6" https://madoguchi.fyralabs.com/ci/terra$3/builds/$n -X PUT -H "Content-Type: application/json" -d ${p/%v/$v} --fail-with-body &
done
wait

0 comments on commit 4a2cced

Please sign in to comment.