diff --git a/action.yaml b/action.yaml index a31e626..6dfd5e0 100644 --- a/action.yaml +++ b/action.yaml @@ -25,6 +25,7 @@ jobs: if: "!contains(github.event.head_commit.message, 'skip ci')" uses: actions/checkout@v2 with: + ref: 'patch' repository: 'kbaseapps/kb_sdk_actions' path: 'kb_sdk_actions' @@ -36,10 +37,10 @@ jobs: KBASE_TEST_TOKEN: ${{ secrets.KBASE_TEST_TOKEN }} run: | # Verify kb_sdk_actions clone worked - test -f "$HOME/kb_sdk_actions/bin/kb-sdk" && echo "CI files cloned" + test -f "$GITHUB_WORKSPACE/kb_sdk_actions/bin/kb-sdk" && echo "CI files cloned" # Pull kb-sdk & create startup script - docker pull kbase/kb-sdk - + docker pull ghcr.io/kbase/kb_sdk_patch-develop:br-0.0.4 + sh $GITHUB_WORKSPACE/kb_sdk_actions/bin/make_testdir && echo "Created test_local" test -f "test_local/test.cfg" && echo "Confirmed config exists" diff --git a/bin/kb-sdk b/bin/kb-sdk index 54ac4d9..47ef6a6 100755 --- a/bin/kb-sdk +++ b/bin/kb-sdk @@ -1,8 +1,17 @@ #!/bin/sh +KB_SDK_IMAGE="ghcr.io/kbase/kb_sdk_patch-develop:br-0.0.4" + # Cache the group for the docker file if [ ! -e $HOME/.kbsdk.cache ] ; then - docker run -i -v /var/run/docker.sock:/var/run/docker.sock --entrypoint ls kbase/kb-sdk -l /var/run/docker.sock|awk '{print $4}' > $HOME/.kbsdk.cache + docker run -i -v /var/run/docker.sock:/var/run/docker.sock \ + --entrypoint ls $KB_SDK_IMAGE -l /var/run/docker.sock | \ + awk '{print $4}' > $HOME/.kbsdk.cache fi -exec docker run -i --rm -v $HOME:$HOME -u $(id -u) -w $(pwd) -v /var/run/docker.sock:/var/run/docker.sock -e DUSER=$USER -e DSHELL=$SHELL --group-add $(cat $HOME/.kbsdk.cache) kbase/kb-sdk $@ +exec docker run -i --rm \ + -v $HOME:$HOME -u $(id -u) -w $(pwd) \ + -v /var/run/docker.sock:/var/run/docker.sock \ + -e DUSER=$USER -e DSHELL=$SHELL \ + --group-add $(cat $HOME/.kbsdk.cache) \ + $KB_SDK_IMAGE $@ diff --git a/bin/make_testdir b/bin/make_testdir index b7a15c3..e0f3599 100755 --- a/bin/make_testdir +++ b/bin/make_testdir @@ -3,10 +3,19 @@ # Disable the default `return 1` when creating `test_local` set +e +KB_SDK_IMAGE="ghcr.io/kbase/kb_sdk_patch-develop:br-0.0.4" + # Cache the group for the docker file if [ ! -e $HOME/.kbsdk.cache ] ; then - docker run -i -v /var/run/docker.sock:/var/run/docker.sock --entrypoint ls kbase/kb-sdk -l /var/run/docker.sock|awk '{print $4}' > $HOME/.kbsdk.cache + docker run -i -v /var/run/docker.sock:/var/run/docker.sock \ + --entrypoint ls $KB_SDK_IMAGE -l /var/run/docker.sock | \ + awk '{print $4}' > $HOME/.kbsdk.cache fi -exec docker run -i --rm -v $HOME:$HOME -u $(id -u) -w $(pwd) -v /var/run/docker.sock:/var/run/docker.sock -e DUSER=$USER -e DSHELL=$SHELL --group-add $(cat $HOME/.kbsdk.cache) kbase/kb-sdk test -exit \ No newline at end of file +exec docker run -i --rm \ + -v $HOME:$HOME -u $(id -u) -w $(pwd) \ + -v /var/run/docker.sock:/var/run/docker.sock \ + -e DUSER=$USER -e DSHELL=$SHELL \ + --group-add $(cat $HOME/.kbsdk.cache) \ + $KB_SDK_IMAGE test +exit