The Free Software Media System - Server Backend & API
ci: Add flock to openapi spec upload (#11381)
Joshua M. Boniface7d67443aca4f
diff --git a/.github/workflows/ci-openapi.yml b/.github/workflows/ci-openapi.ymlindex bdbfcd3eb3..0abbb09c0d 100644--- a/.github/workflows/ci-openapi.yml+++ b/.github/workflows/ci-openapi.yml@@ -174,6 +174,8 @@ jobs:debug: falsescript_stop: falsescript: |+ (+ flock -x -w 300 200 || exit 1TGT_DIR="/srv/repository/main/openapi"LAST_SPEC="$( ls -lt ${TGT_DIR}/unstable/ | grep 'jellyfin-openapi' | head -1 | awk '{ print $NF }' )"# If new and previous spec don't differ (diff retcode 0), remove incoming and finish@@ -187,10 +189,11 @@ jobs:sudo rm ${TGT_DIR}/jellyfin-openapi-unstable_previous.json# Move current jellyfin-openapi-unstable.json symlink to jellyfin-openapi-unstable_previous.jsonsudo mv ${TGT_DIR}/jellyfin-openapi-unstable.json ${TGT_DIR}/jellyfin-openapi-unstable_previous.json- # Create new jellyfin-openapi-stable.json symlink+ # Create new jellyfin-openapi-unstable.json symlinksudo ln -s unstable/jellyfin-openapi-${{ env.JELLYFIN_VERSION }}.json ${TGT_DIR}/jellyfin-openapi-unstable.json- # Check that the previous openapi spec is correct+ # Check that the previous openapi unstable spec link is correctif [[ "$( readlink ${TGT_DIR}/jellyfin-openapi-unstable_previous.json )" != "unstable/${LAST_SPEC}" ]]; thensudo rm ${TGT_DIR}/jellyfin-openapi-unstable_previous.jsonsudo ln -s unstable/${LAST_SPEC} ${TGT_DIR}/jellyfin-openapi-unstable_previous.jsonfi+ ) 200>/run/openapi-unstable.lock