-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename universities to no longer use a prefix to be compatible with t…
…he contest package format Rename all image files. Update the organizations. Add contest package to the export script. Modify the automation logic to import the contest package using the `import-contest` script.
- Loading branch information
Showing
90 changed files
with
285 additions
and
196 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,16 @@ | ||
#!/usr/bin/env bash | ||
pwd | ||
cd out/contest-package | ||
jq "[.[] | {\"organization_id\": .id, \"name\": .formal_name, \"id\":1, \"group_ids\": [\"3\"], \"external_id\": .id, \"display_name\": .formal_name}] | to_entries | map( (.value.id = \"\(1+.key)\" ) | .value)" organizations.json > teams.json | ||
cat > contest.yaml <<<"id: 1 | ||
name: demo | ||
title: demo | ||
short-name: demo | ||
start-time: 2024-10-21T00:00:00.000Z | ||
duration: 5:00:00 | ||
scoreboard_freeze_duration: 1:00:00 | ||
scoreboard_type: pass-fail | ||
penalty_time: 20 | ||
" | ||
cat > groups.json <<<"[{\"id\":\"3\",\"icpc_id\":\"3\",\"name\":\"Contestants\"}]" | ||
cd ../.. |
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 |
---|---|---|
|
@@ -19,7 +19,7 @@ jobs: | |
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Run export | ||
run: ./export.sh --universities --companies --studies --background --transparent --output-directory out 64 256 | ||
run: ./export.sh --universities --companies --studies --contest-package --background --transparent --output-directory out 64 256 | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: logos | ||
|
@@ -30,7 +30,7 @@ jobs: | |
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- uses: actions/download-artifact@v4.1.7 | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: logos | ||
path: out | ||
|
@@ -39,28 +39,20 @@ jobs: | |
- name: Test in DJ | ||
run: | | ||
cd ${{ github.workspace }} | ||
afftmp="affilDOMjudge" | ||
./.github/workflows/generate-metadata.sh | ||
sudo apt update; sudo apt install cutycapt xvfb httpie -y | ||
mkdir $afftmp | ||
cp ${{ github.workspace }}/out/background_64/* $afftmp | ||
docker compose -f .github/workflows/domjudge/docker-compose.yml up -d mariadb | ||
sleep 30s | ||
docker compose -f .github/workflows/domjudge/docker-compose.yml up -d domjudge | ||
sleep 1m | ||
ADMINPASS=$(docker exec -i domjudge-domjudge-1 cat /opt/domjudge/domserver/etc/initial_admin_password.secret) | ||
http -a admin:$ADMINPASS --check-status -b -f POST "http://localhost:12345/api/users/organizations" json@out/organizations.json | ||
jq "[.[] | {\"organization_id\": .id, \"name\": .formal_name, \"id\":1, \"group_ids\": [\"3\"]}] | to_entries | map( (.value.id = \"\(1+.key)\" ) | .value)" out/organizations.json > teams.json | ||
http -a admin:$ADMINPASS --check-status -b -f POST "http://localhost:12345/api/users/teams" [email protected] | ||
http -a admin:$ADMINPASS --check-status -b PUT "http://localhost:12345/api/config" show_affiliation_logos=true show_flags=true show_affiliations=true data_source=1 --ignore-stdin | ||
http -a admin:$ADMINPASS --verbose --check-status -b GET "http://localhost:12345/api/config" | ||
docker exec -w /tmp/icpc-logos domjudge-domjudge-1 /bin/bash -c "yes | import-contest" | ||
xvfb-run --server-args="-screen 0, 1024x768x24" cutycapt --url=http://localhost:12345 --out=scoreboard.png | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: DJ_scoreboard | ||
path: scoreboard.png | ||
release: | ||
needs: render | ||
if: github.ref == 'refs/heads/main' | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout | ||
|
@@ -71,7 +63,15 @@ jobs: | |
path: out | ||
- name: Zip logos | ||
run: cd ${{ github.workspace }}/out; for i in */; do zip -r "${i%/}.zip" "$i"; done; cd ${{ github.workspace }} | ||
- name: Zip contest package | ||
run: cd ${{ github.workspace }}/out; zip -r contest-package.zip contest-package/ cd ${{ github.workspace }} | ||
- uses: actions/upload-artifact@v4 | ||
if: github.ref != 'refs/heads/main' | ||
with: | ||
name: zips | ||
path: out/*.zip | ||
- uses: "marvinpinto/action-automatic-releases@latest" | ||
if: github.ref == 'refs/heads/main' | ||
with: | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
automatic_release_tag: "latest" | ||
|
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,3 +1,5 @@ | ||
/venv/ | ||
/out/ | ||
/.fleet/ | ||
/tmp/ | ||
/.idea/ |
Oops, something went wrong.