Skip to content

Commit

Permalink
container: test run script
Browse files Browse the repository at this point in the history
  • Loading branch information
mrpollo committed Oct 15, 2024
1 parent 72bee55 commit d31a7e8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/compile_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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() }}
Expand Down
19 changes: 14 additions & 5 deletions Tools/container/docker_run.sh
Original file line number Diff line number Diff line change
@@ -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%/*/*}

Expand Down

0 comments on commit d31a7e8

Please sign in to comment.