This commit is contained in:
@@ -22,6 +22,13 @@ jobs:
|
||||
run: |
|
||||
python3 -m py_compile controller.py
|
||||
python3 -m unittest discover -s tests -v
|
||||
sh -n scripts/install-controller.sh scripts/ces-controller
|
||||
|
||||
- name: Deploy verified controller
|
||||
run: |
|
||||
sh scripts/install-controller.sh "$GITHUB_SHA"
|
||||
test "$(cat /opt/ces-controller/current/VERSION)" = "$GITHUB_SHA"
|
||||
/usr/local/bin/ces-controller --help >/dev/null
|
||||
|
||||
- name: Confirm no paid action ran
|
||||
run: |
|
||||
|
||||
@@ -23,17 +23,15 @@ jobs:
|
||||
env:
|
||||
AUTODL_API_TOKEN: ${{ secrets.AUTODL_API_TOKEN }}
|
||||
TRAINING_RUNNER_REGISTRATION_TOKEN: ${{ secrets.TRAINING_RUNNER_REGISTRATION_TOKEN }}
|
||||
GITEA_JOB_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
OPERATION: ${{ inputs.operation }}
|
||||
IMAGE_UUID: ${{ inputs.image_uuid }}
|
||||
CONFIRM_SPEND: ${{ inputs.confirm_spend }}
|
||||
steps:
|
||||
- name: Checkout controller source
|
||||
- name: Select deployed controller
|
||||
run: |
|
||||
git init .
|
||||
git remote add origin "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git"
|
||||
git -c http.extraHeader="Authorization: token $GITEA_JOB_TOKEN" fetch --depth 1 origin "$GITHUB_SHA"
|
||||
git checkout --detach FETCH_HEAD
|
||||
test -x /usr/local/bin/ces-controller
|
||||
test "$(cat /opt/ces-controller/current/VERSION)" = "$GITHUB_SHA"
|
||||
echo "controller_version=$GITHUB_SHA"
|
||||
|
||||
- name: Validate requested operation
|
||||
run: |
|
||||
@@ -44,7 +42,7 @@ jobs:
|
||||
|
||||
- name: Manage AutoDL Pro instance
|
||||
run: |
|
||||
python3 controller.py "$OPERATION" \
|
||||
/usr/local/bin/ces-controller "$OPERATION" \
|
||||
--image-uuid "$IMAGE_UUID" \
|
||||
--confirm-spend "$CONFIRM_SPEND"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user