diff --git a/.github/workflows/compile_ubuntu.yml b/.github/workflows/compile_ubuntu.yml index 6689930d51ce..49891513391e 100644 --- a/.github/workflows/compile_ubuntu.yml +++ b/.github/workflows/compile_ubuntu.yml @@ -37,7 +37,8 @@ jobs: tags: | type=schedule,pattern={{date 'YYY-MM-DD'}} - - name: Build Docker Image + - id: build + name: Build Docker Image uses: docker/build-push-action@v6 with: push: false @@ -46,10 +47,8 @@ jobs: file: ./Tools/container/Dockerfile - name: Test Docker Works - uses: addnab/docker-run-action@v3 - with: - image: ${{ steps.meta.outputs.labels }} - run: echo "hello world" + run: | + REPO_NAME=${{ steps.build.outputs.imageid }} ./Tools/container/docker_run.sh make px4_fmu-v4 - name: Setup tmate session if: ${{ failure() }} diff --git a/Tools/container/docker_run.sh b/Tools/container/docker_run.sh index 0335af0696fd..e9666d91fca5 100755 --- a/Tools/container/docker_run.sh +++ b/Tools/container/docker_run.sh @@ -1,16 +1,25 @@ #!/bin/bash if [[ -z "${DOCKER_TAG}" ]]; then - # The default tag name should be hardcoded - # to whatever we are currently using in CI on this branch - TAG_NAME="2024-10-11" + # The default tag name should be hardcoded + # to whatever we are currently using in CI on this branch + TAG_NAME="2024-10-11" else - TAG_NAME="${DOCKER_TAG}" + TAG_NAME="${DOCKER_TAG}" +fi + +if [[ -z "${REPO_NAME}" ]]; then + REPO_NAME="ghcr.io/px4/px4-dev" + # REPO_NAME="px4/px4-dev" +else + REPO_NAME="${REPO_NAME}" + TAG_NAME="" fi # set the image name and tag -PX4_DOCKER_REPO="ghcr.io/px4/px4-dev:$TAG_NAME" +PX4_DOCKER_REPO="$REPO_NAME:$TAG_NAME" # get the project root path +# assumes docker_run.sh lives in ./Tools/container SRC_DIR=$(dirname $(realpath $0)) SRC_DIR=${SRC_DIR%/*/*}