Skip to content

Commit

Permalink
Added a step for adding a Docker label
Browse files Browse the repository at this point in the history
  • Loading branch information
junechul committed Aug 31, 2024
1 parent 127d945 commit 4b8a838
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 3 deletions.
16 changes: 15 additions & 1 deletion .github/workflows/docker-build-pc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ env:
REPO_URL: https://git.ti.com/git/processor-sdk-vision/jacinto_ros_perception.git
REPO_TAG: REL.10.00.00
# only for testing
REPO_BRANCH: 10_00_rc4
# REPO_BRANCH: 10_00_rc4
SDK_VER: 10.0.0
GH_TOKEN: ${{ secrets.GHCR_PAT }}

Expand Down Expand Up @@ -58,6 +58,20 @@ jobs:
cd $HOME/j7ros_home
./docker_build.sh
- name: Add a Docker label
run: |
docker_tag=robotics-sdk:${{ env.SDK_VER }}-humble-viz
docker images
sleep 1
docker images
if [ "$(docker images -q $docker_tag 2> /dev/null)" == ""]; then
echo "Docker image $docker_tag does not exist."
exit 1
else
echo "FROM $docker_tag" | docker build --label org.opencontainers.image.source=https://github.com/${{ github.repository }} -t $docker_tag -
docker inspect --format='{{json .Config.Labels}}' $docker_tag
fi
- name: Push Docker image
run: |
docker_tag=robotics-sdk:${{ env.SDK_VER }}-humble-viz
Expand Down
16 changes: 15 additions & 1 deletion .github/workflows/docker-build-stage1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ env:
REPO_URL: https://git.ti.com/git/processor-sdk-vision/jacinto_ros_perception.git
REPO_TAG: REL.10.00.00
# only for testing
REPO_BRANCH: 10_00_rc4
# REPO_BRANCH: 10_00_rc4
SDK_VER: 10.0.0
GH_TOKEN: ${{ secrets.env_PAT }}

Expand Down Expand Up @@ -70,6 +70,20 @@ jobs:
cd $HOME/j7ros_home
SOC=${{ inputs.soc }} ./docker_build.sh stage1_only
- name: Add a Docker label
run: |
docker_tag=robotics-sdk:${{ env.SDK_VER }}-humble-base
docker images
sleep 1
docker images
if [ "$(docker images -q $docker_tag 2> /dev/null)" == ""]; then
echo "Docker image $docker_tag does not exist."
exit 1
else
echo "FROM $docker_tag" | docker build --label org.opencontainers.image.source=https://github.com/${{ github.repository }} -t $docker_tag -
docker inspect --format='{{json .Config.Labels}}' $docker_tag
fi
- name: Push Docker image
run: |
docker_tag=robotics-sdk:${{ env.SDK_VER }}-humble-base
Expand Down
16 changes: 15 additions & 1 deletion .github/workflows/docker-build-stage2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ env:
REPO_URL: https://git.ti.com/git/processor-sdk-vision/jacinto_ros_perception.git
REPO_TAG: REL.10.00.00
# only for testing
REPO_BRANCH: 10_00_rc4
# REPO_BRANCH: 10_00_rc4
SDK_VER: 10.0.0
GH_TOKEN: ${{ secrets.env_PAT }}

Expand Down Expand Up @@ -78,6 +78,20 @@ jobs:
cd $HOME/j7ros_home
SOC=${{ inputs.soc }} ./docker_build.sh stage2_only
- name: Add a Docker label
run: |
docker_tag=robotics-sdk:${{ env.SDK_VER }}-humble-${{ inputs.soc }}
docker images
sleep 1
docker images
if [ "$(docker images -q $docker_tag 2> /dev/null)" == ""]; then
echo "Docker image $docker_tag does not exist."
exit 1
else
echo "FROM $docker_tag" | docker build --label org.opencontainers.image.source=https://github.com/${{ github.repository }} -t $docker_tag -
docker inspect --format='{{json .Config.Labels}}' $docker_tag
fi
- name: Push Docker image
run: |
docker_tag=robotics-sdk:${{ env.SDK_VER }}-humble-${{ inputs.soc }}
Expand Down

0 comments on commit 4b8a838

Please sign in to comment.