diff --git a/.circleci/config.yml b/.circleci/config.yml index 1b4a264e..f1bf1f65 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -23,6 +23,7 @@ version: 2 # Run static code analyzer for SourceCloud # Upload test results # Every run command should start with source ${INIT_ENV} to ensure all default dependancies are available +# TODO (CAR-6025) move to github action to take advantage of dynamic image tag and docker org to remove branch/version coupling jobs: build: # Pull docker image from docker hub diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 00000000..c88db096 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,8 @@ +name: Docker build +on: + pull_request: + types: [opened, synchronize, reopened] + +jobs: + docker: + uses: usdot-fhwa-stol/actions/.github/workflows/docker.yml@main \ No newline at end of file diff --git a/.github/workflows/dockerhub.yml b/.github/workflows/dockerhub.yml new file mode 100644 index 00000000..fd70cc8d --- /dev/null +++ b/.github/workflows/dockerhub.yml @@ -0,0 +1,16 @@ +name: Docker Hub build +on: + push: + branches: + - develop + - master + - "release/*" + tags: + - "carma-system-*" + +jobs: + dockerhub: + uses: usdot-fhwa-stol/actions/.github/workflows/dockerhub.yml@main + secrets: + DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index dc5b1ce0..8ee174cb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,8 +12,11 @@ # License for the specific language governing permissions and limitations under # the License. -FROM usdotfhwastoldev/carma-base:develop as base +ARG DOCKER_ORG="usdotfhwastoldev" +ARG DOCKER_TAG="develop" +FROM ${DOCKER_ORG}/carma-base:${DOCKER_TAG} as base FROM base as setup +ARG GIT_BRANCH="develop" ARG ROS1_PACKAGES="" ENV ROS1_PACKAGES=${ROS1_PACKAGES} @@ -22,7 +25,7 @@ ENV ROS2_PACKAGES=${ROS2_PACKAGES} RUN mkdir ~/src COPY --chown=carma . /home/carma/src/CARMAAvtVimbaDriver -RUN ~/src/CARMAAvtVimbaDriver/docker/checkout.bash +RUN ~/src/CARMAAvtVimbaDriver/docker/checkout.bash -b ${GIT_BRANCH} RUN ~/src/CARMAAvtVimbaDriver/docker/install.sh FROM base diff --git a/README.md b/README.md index a4ae3f3a..00c7400f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ | CicleCI Build Status | Sonar Code Quality | DockerHub Release | DockerHub Release Candidate | DockerHub Develop | |------|-----|-----|-----|-----| -[![CircleCI](https://img.shields.io/circleci/build/gh/usdot-fhwa-stol/avt_vimba_camera/develop?label=CircleCI)](https://app.circleci.com/pipelines/github/usdot-fhwa-stol/avt_vimba_camera?branch=develop) | [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=usdot-fhwa-stol_CARMAAvtVimbaDriver&metric=alert_status)](https://sonarcloud.io/dashboard?id=usdot-fhwa-stol_CARMAAvtVimbaDriver) | [![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/usdotfhwastol/carma-avt-vimba-driver?label=carma-avt-vimba-driver)](https://hub.docker.com/repository/docker/usdotfhwastol/carma-avt-vimba-driver) | [![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/usdotfhwastolcandidate/carma-avt-vimba-driver?label=carma-avt-vimba-driver)](https://hub.docker.com/repository/docker/usdotfhwastolcandidate/carma-avt-vimba-driver) | [![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/usdotfhwastoldev/carma-avt-vimba-driver?label=carma-avt-vimba-driver)](https://hub.docker.com/repository/docker/usdotfhwastoldev/carma-avt-vimba-driver) +[![CircleCI](https://img.shields.io/circleci/build/gh/usdot-fhwa-stol/avt_vimba_camera/develop?label=CircleCI)](https://app.circleci.com/pipelines/github/usdot-fhwa-stol/avt_vimba_camera?branch=develop) | [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=usdot-fhwa-stol_CARMAAvtVimbaDriver&metric=alert_status)](https://sonarcloud.io/dashboard?id=usdot-fhwa-stol_CARMAAvtVimbaDriver) | [![DockerHub build](https://github.com/usdot-fhwa-stol/avt_vimba_camera/actions/workflows/dockerhub.yml/badge.svg?branch=carma-system-4.5.0)](https://github.com/usdot-fhwa-stol/avt_vimba_camera/actions/workflows/dockerhub.yml) | [![DockerHub build](https://github.com/usdot-fhwa-stol/avt_vimba_camera/actions/workflows/dockerhub.yml/badge.svg?branch=release/lavida)](https://github.com/usdot-fhwa-stol/avt_vimba_camera/actions/workflows/dockerhub.yml)| [![DockerHub build](https://github.com/usdot-fhwa-stol/avt_vimba_camera/actions/workflows/dockerhub.yml/badge.svg?branch=develop)](https://github.com/usdot-fhwa-stol/avt_vimba_camera/actions/workflows/dockerhub.yml) # CARMAAvtVimbaDriver This is a fork of a third party driver developed for video camera operation. It is modified for CARMA-specific use. The master repo, located [here](https://github.com/srv/avt_vimba_camera), had no readme for its home page, so this readme is added to the fork to describe how this repo fits into the rest of the CARMA environment. diff --git a/docker/checkout.bash b/docker/checkout.bash index 10438f44..e4542b86 100755 --- a/docker/checkout.bash +++ b/docker/checkout.bash @@ -20,11 +20,13 @@ set -exo pipefail dir=~ +BRANCH=develop # The script will use this unless the -b flag updates it while [[ $# -gt 0 ]]; do arg="$1" case $arg in - -d|--develop) - BRANCH=develop + -b|--branch) + BRANCH=$2 + shift shift ;; -r|--root) @@ -34,11 +36,6 @@ while [[ $# -gt 0 ]]; do ;; esac done +git clone https://github.com/usdot-fhwa-stol/carma-msgs.git "${dir}"/src/carma-msgs --branch "$BRANCH" --depth 1 +git clone https://github.com/usdot-fhwa-stol/carma-utils.git "${dir}"/src/carma-utils --branch "$BRANCH" --depth 1 -if [[ "$BRANCH" = "develop" ]]; then - git clone https://github.com/usdot-fhwa-stol/carma-msgs.git ~/src/carma-msgs --branch $BRANCH --depth 1 - git clone https://github.com/usdot-fhwa-stol/carma-utils.git ~/src/carma-utils --branch $BRANCH --depth 1 -else - git clone https://github.com/usdot-fhwa-stol/carma-msgs.git ${dir}/src/carma-msgs --branch develop - git clone https://github.com/usdot-fhwa-stol/carma-utils.git ${dir}/src/carma-utils --branch develop -fi