From b3311f1975298f2852fccd3c4049e97e7e662180 Mon Sep 17 00:00:00 2001 From: dev Date: Thu, 21 Mar 2024 16:02:52 -0400 Subject: [PATCH 01/10] New workflow for PRs --- .github/workflows/pull_request.yml | 57 ++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/pull_request.yml diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml new file mode 100644 index 000000000..8c9bea2c2 --- /dev/null +++ b/.github/workflows/pull_request.yml @@ -0,0 +1,57 @@ +name: Pull Request Workflow + +on: + pull_request: + types: [opened, synchronize, reopened] +jobs: + docker-image-builds: + strategy: + matrix: + include: + - architecture: x64 + ubuntu-codename: jammy + target: x64-version + - architecture: arm64 + ubuntu-codename: jammy + target: cross-compile-version + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4 + with: + images: usdotfhwaops/php + tags: | + type=schedule + type=ref,event=branch + type=ref,event=tag + type=ref,event=pr + # set latest tag for default branch + type=raw,value=latest,enable={{is_default_branch}} + - name: V2X-Hub Docker build + uses: docker/build-push-action@v4 + with: + file: Dockerfile + build-args: | + BUILD_ARCHITECTURE=${{ matrix.architecture }} + UBUNTU_CODENAME=${{ matrix.ubuntu-codename }} + - name: PHP Docker build + uses: docker/build-push-action@v4 + with: + file: docker/Dockerfile-php + build-args: | + BUILD_ARCHITECTURE=${{ matrix.architecture }} + UBUNTU_CODENAME=${{ matrix.ubuntu-codename }} + - name: Port Drayage Docker build + uses: docker/build-push-action@v4 + with: + context: tools/port-drayage-webservice + build-args: | + BUILD_ARCHITECTURE=${{ matrix.architecture }} + UBUNTU_CODENAME=${{ matrix.ubuntu-codename }} From 6b7655471fe30960f43c431ff6df29eb3661e550 Mon Sep 17 00:00:00 2001 From: dev Date: Thu, 21 Mar 2024 17:44:45 -0400 Subject: [PATCH 02/10] Update --- .../workflows/build_v2xhub_docker_image.yml | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/build_v2xhub_docker_image.yml diff --git a/.github/workflows/build_v2xhub_docker_image.yml b/.github/workflows/build_v2xhub_docker_image.yml new file mode 100644 index 000000000..639c6afb6 --- /dev/null +++ b/.github/workflows/build_v2xhub_docker_image.yml @@ -0,0 +1,46 @@ +name: Build V2X-Hub Docker Image +on: + push: + branches: + - develop + - master + - 'release/**' + - vh-1278-update-to-github-actions +jobs: + v2xhub-docker: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Log in to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4 + with: + images: usdotfhwaops/v2xhub + tags: | + type=schedule + type=ref,event=branch + type=ref,event=tag + type=ref,event=pr + # set latest tag for default branch + type=raw,value=latest,enable={{is_default_branch}} + - name: Build and push + uses: docker/build-push-action@v4 + with: + push: true + platforms: linux/amd64,linux/arm64 + context: . + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + build-args: | + BUILD_ARCHITECTURE=${{ matrix.architecture }} + UBUNTU_CODENAME=${{ matrix.ubuntu-codename }} From 8dcd98e2be160d18ba7bc1af680876a6b60069d2 Mon Sep 17 00:00:00 2001 From: dev Date: Fri, 22 Mar 2024 12:07:45 -0400 Subject: [PATCH 03/10] Adding workflows for each docker build --- .circleci/config.yml | 109 ------------------ .github/workflows/build_php_docker_image.yml | 46 ++++++++ .../build_port_drayage_docker_image.yml | 46 ++++++++ .github/workflows/pull_request.yml | 12 +- tools/port-drayage-webservice/Dockerfile | 4 +- 5 files changed, 97 insertions(+), 120 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/build_php_docker_image.yml create mode 100644 .github/workflows/build_port_drayage_docker_image.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 083450ea6..000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,109 +0,0 @@ -version: 2.1 - -# Copyright (C) 2019-2020 LEIDOS. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. -# - -# Configuration file for Circle CI -# CI will report failure if any executed command returns and error status -# Operations performed are as follows -# Build source code -# Run unit tests for C++ -# Run static code analyzer for SourceCloud -# Upload test results -# Every run command should start with source ${INIT_ENV} to ensure all default dependencies are available -jobs: - arm_build_push : - machine: - # see https://circleci.com/docs/using-arm/ for versions - image: ubuntu-2004:current - resource_class: arm.medium - steps: - - checkout - - run: - name: Docker Build - # Run MYSQL image and build v2xhub docker image - command: | - docker build -t v2xhubarm:ci-build . - docker build -f docker/Dockerfile-php -t php_arm:ci-build . - cd ./tools/port-drayage-webservice/ - docker build -f Dockerfile-arm -t port-drayage-webservice_arm:ci-build . - if [ -n "$CIRCLE_PR_NUMBER" ]; then - circleci-agent step halt - fi - - run: - name: Docker Push - # Push v2xhub docker image to usdotfhwaops dockerhub - command: | - if [ "$CIRCLE_BRANCH" = "develop" ]; then - DOCKER_TAG="latest" - else - DOCKER_TAG=${CIRCLE_BRANCH/\//-} - fi - docker tag v2xhubarm:ci-build usdotfhwaops/v2xhubarm:${DOCKER_TAG} - docker tag php_arm:ci-build usdotfhwaops/php_arm:${DOCKER_TAG} - docker tag port-drayage-webservice_arm:ci-build usdotfhwaops/port-drayage-webservice_arm:${DOCKER_TAG} - echo "$DOCKERHUB_PASSWORD" | docker login --username $DOCKERHUB_USERNAME --password-stdin - docker push usdotfhwaops/v2xhubarm:${DOCKER_TAG} - docker push usdotfhwaops/php_arm:${DOCKER_TAG} - docker push usdotfhwaops/port-drayage-webservice_arm:${DOCKER_TAG} - automated_release : - machine: - image: ubuntu-2004:202201-02 - steps: - - run: - name: Docker Pull Release - # Pull all built images associated with github tag - command: | - docker pull usdotfhwaops/php:master - docker pull usdotfhwaops/port-drayage-webservice:master - docker pull usdotfhwaops/v2xhubamd:master - docker pull usdotfhwaops/php_arm:master - docker pull usdotfhwaops/port-drayage-webservice_arm:master - docker pull usdotfhwaops/v2xhubarm:master - - run: - name: Docker Tag Release - # Tag all pulled images with github tag name - command: | - docker tag usdotfhwaops/php:master usdotfhwaops/php:${CIRCLE_TAG} - docker tag usdotfhwaops/port-drayage-webservice:master usdotfhwaops/port-drayage-webservice:${CIRCLE_TAG} - docker tag usdotfhwaops/v2xhubamd:master usdotfhwaops/v2xhubamd:${CIRCLE_TAG} - docker tag usdotfhwaops/php_arm:master usdotfhwaops/php_arm:${CIRCLE_TAG} - docker tag usdotfhwaops/port-drayage-webservice_arm:master usdotfhwaops/port-drayage-webservice_arm:${CIRCLE_TAG} - docker tag usdotfhwaops/v2xhubarm:master usdotfhwaops/v2xhubarm:${CIRCLE_TAG} - - run: - name: Docker Push Release Tag - # Push all tagged images - command: | - echo "$DOCKERHUB_PASSWORD" | docker login --username $DOCKERHUB_USERNAME --password-stdin - docker push usdotfhwaops/php:${CIRCLE_TAG} - docker push usdotfhwaops/port-drayage-webservice:${CIRCLE_TAG} - docker push usdotfhwaops/v2xhubamd:${CIRCLE_TAG} - docker push usdotfhwaops/php_arm:${CIRCLE_TAG} - docker push usdotfhwaops/port-drayage-webservice_arm:${CIRCLE_TAG} - docker push usdotfhwaops/v2xhubarm:${CIRCLE_TAG} -workflows: - version: 2 - build: - jobs: - - arm_build_push: - filters: - tags: - only: /^[\.0-9]*$/ - - automated_release: - filters: - tags: - only: /^[\.0-9]*$/ - branches: - ignore: /.*/ diff --git a/.github/workflows/build_php_docker_image.yml b/.github/workflows/build_php_docker_image.yml new file mode 100644 index 000000000..d074e2333 --- /dev/null +++ b/.github/workflows/build_php_docker_image.yml @@ -0,0 +1,46 @@ +name: Build Port Drayage Web App Docker Image +on: + push: + branches: + - develop + - master + - 'release/**' + - vh-1278-update-to-github-actions +jobs: + v2xhub-docker: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Log in to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4 + with: + images: usdotfhwaops/port_drayage_webservice + tags: | + type=schedule + type=ref,event=branch + type=ref,event=tag + type=ref,event=pr + # set latest tag for default branch + type=raw,value=latest,enable={{is_default_branch}} + - name: Build and push + uses: docker/build-push-action@v4 + with: + push: true + platforms: linux/amd64,linux/arm64 + context: tools/port-drayage-webservice/ + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + build-args: | + BUILD_ARCHITECTURE=${{ matrix.architecture }} + UBUNTU_CODENAME=${{ matrix.ubuntu-codename }} diff --git a/.github/workflows/build_port_drayage_docker_image.yml b/.github/workflows/build_port_drayage_docker_image.yml new file mode 100644 index 000000000..639c6afb6 --- /dev/null +++ b/.github/workflows/build_port_drayage_docker_image.yml @@ -0,0 +1,46 @@ +name: Build V2X-Hub Docker Image +on: + push: + branches: + - develop + - master + - 'release/**' + - vh-1278-update-to-github-actions +jobs: + v2xhub-docker: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Log in to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4 + with: + images: usdotfhwaops/v2xhub + tags: | + type=schedule + type=ref,event=branch + type=ref,event=tag + type=ref,event=pr + # set latest tag for default branch + type=raw,value=latest,enable={{is_default_branch}} + - name: Build and push + uses: docker/build-push-action@v4 + with: + push: true + platforms: linux/amd64,linux/arm64 + context: . + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + build-args: | + BUILD_ARCHITECTURE=${{ matrix.architecture }} + UBUNTU_CODENAME=${{ matrix.ubuntu-codename }} diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 8c9bea2c2..d5bced161 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -5,15 +5,6 @@ on: types: [opened, synchronize, reopened] jobs: docker-image-builds: - strategy: - matrix: - include: - - architecture: x64 - ubuntu-codename: jammy - target: x64-version - - architecture: arm64 - ubuntu-codename: jammy - target: cross-compile-version runs-on: ubuntu-latest steps: - name: Checkout @@ -38,6 +29,7 @@ jobs: uses: docker/build-push-action@v4 with: file: Dockerfile + platforms: linux/amd64,linux/arm64 build-args: | BUILD_ARCHITECTURE=${{ matrix.architecture }} UBUNTU_CODENAME=${{ matrix.ubuntu-codename }} @@ -45,6 +37,7 @@ jobs: uses: docker/build-push-action@v4 with: file: docker/Dockerfile-php + platforms: linux/amd64,linux/arm64 build-args: | BUILD_ARCHITECTURE=${{ matrix.architecture }} UBUNTU_CODENAME=${{ matrix.ubuntu-codename }} @@ -52,6 +45,7 @@ jobs: uses: docker/build-push-action@v4 with: context: tools/port-drayage-webservice + platforms: linux/amd64,linux/arm64 build-args: | BUILD_ARCHITECTURE=${{ matrix.architecture }} UBUNTU_CODENAME=${{ matrix.ubuntu-codename }} diff --git a/tools/port-drayage-webservice/Dockerfile b/tools/port-drayage-webservice/Dockerfile index 1f27a0549..27e8e0402 100644 --- a/tools/port-drayage-webservice/Dockerfile +++ b/tools/port-drayage-webservice/Dockerfile @@ -1,10 +1,10 @@ -FROM amd64/maven:3.8-jdk-11-slim AS maven_build +FROM maven:3.8-jdk-11-slim AS maven_build RUN mkdir /home/port-drayage-webservice COPY src/ /home/port-drayage-webservice/src/ COPY pom.xml /home/port-drayage-webservice/ WORKDIR /home/port-drayage-webservice/ RUN mvn clean install -FROM amd64/alpine:latest +FROM alpine:latest RUN mkdir /home/port-drayage-webservice/ RUN apk add openjdk11-jre --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community COPY --from=maven_build /home/port-drayage-webservice/target/port-drayage-webservice-0.0.1-SNAPSHOT.jar /home/port-drayage-webservice/ From 8cc2f7f6959b011ad35fe5fe225790f632201eab Mon Sep 17 00:00:00 2001 From: dev Date: Mon, 25 Mar 2024 13:18:03 -0400 Subject: [PATCH 04/10] Finalize and add tag trigger --- .github/workflows/build.yml | 106 ------------------ .github/workflows/build_php_docker_image.yml | 4 +- .../build_port_drayage_docker_image.yml | 4 +- .../workflows/build_v2xhub_docker_image.yml | 4 +- .github/workflows/sonar-scanner.yml | 5 +- 5 files changed, 13 insertions(+), 110 deletions(-) delete mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index eed361c5b..000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,106 +0,0 @@ -name: Build Workflows - -on: - pull_request: - push: - -# TODO push to dockerhub with correct tags -jobs: - v2xhub-docker: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: recursive - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - name: Log in to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@v4 - with: - images: usdotfhwaops/v2xhubamd - tags: | - type=schedule - type=ref,event=branch - type=ref,event=tag - type=ref,event=pr - # set latest tag for default branch - type=raw,value=latest,enable={{is_default_branch}} - - name: Build and push - uses: docker/build-push-action@v4 - with: - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - - php-docker: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: recursive - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - name: Log in to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@v4 - with: - images: usdotfhwaops/php - tags: | - type=schedule - type=ref,event=branch - type=ref,event=tag - type=ref,event=pr - # set latest tag for default branch - type=raw,value=latest,enable={{is_default_branch}} - - name: Build and push - uses: docker/build-push-action@v4 - with: - file: docker/Dockerfile-php - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - - port-drayage-docker: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - name: Log in to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@v4 - with: - images: usdotfhwaops/port-drayage-webservice - tags: | - type=schedule - type=ref,event=branch - type=ref,event=tag - type=ref,event=pr - # set latest tag for default branch - type=raw,value=latest,enable={{is_default_branch}} - - name: Build and push - uses: docker/build-push-action@v4 - with: - push: true - context: tools/port-drayage-webservice - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/build_php_docker_image.yml b/.github/workflows/build_php_docker_image.yml index d074e2333..370f5b14a 100644 --- a/.github/workflows/build_php_docker_image.yml +++ b/.github/workflows/build_php_docker_image.yml @@ -5,7 +5,9 @@ on: - develop - master - 'release/**' - - vh-1278-update-to-github-actions + # Build all tags not containing a / (https://stackoverflow.com/questions/61891328/trigger-github-action-only-on-new-tags ) + tags: + - '*' jobs: v2xhub-docker: runs-on: ubuntu-latest diff --git a/.github/workflows/build_port_drayage_docker_image.yml b/.github/workflows/build_port_drayage_docker_image.yml index 639c6afb6..c0dd92ec5 100644 --- a/.github/workflows/build_port_drayage_docker_image.yml +++ b/.github/workflows/build_port_drayage_docker_image.yml @@ -5,7 +5,9 @@ on: - develop - master - 'release/**' - - vh-1278-update-to-github-actions + # Build all tags not containing a / (https://stackoverflow.com/questions/61891328/trigger-github-action-only-on-new-tags ) + tags: + - '*' jobs: v2xhub-docker: runs-on: ubuntu-latest diff --git a/.github/workflows/build_v2xhub_docker_image.yml b/.github/workflows/build_v2xhub_docker_image.yml index 639c6afb6..28b946cfc 100644 --- a/.github/workflows/build_v2xhub_docker_image.yml +++ b/.github/workflows/build_v2xhub_docker_image.yml @@ -5,7 +5,9 @@ on: - develop - master - 'release/**' - - vh-1278-update-to-github-actions + # Build all tags not containing a / (https://stackoverflow.com/questions/61891328/trigger-github-action-only-on-new-tags ) + tags: + - '*' jobs: v2xhub-docker: runs-on: ubuntu-latest diff --git a/.github/workflows/sonar-scanner.yml b/.github/workflows/sonar-scanner.yml index 6df6b7812..a0636f357 100644 --- a/.github/workflows/sonar-scanner.yml +++ b/.github/workflows/sonar-scanner.yml @@ -1,7 +1,10 @@ on: push: - # run on branches and not PRs due to secrets used branches: + - develop + - master + pull_request: + types: [opened, synchronize, reopened] name: Sonar Workflow jobs: sonarcloud: From b711f020f45b5171162c75546c94e6a985625e8d Mon Sep 17 00:00:00 2001 From: dev Date: Tue, 26 Mar 2024 10:58:24 -0400 Subject: [PATCH 05/10] Update docker compose files --- configuration/amd64/docker-compose.yml | 8 ++++---- configuration/arm64/docker-compose.yml | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/configuration/amd64/docker-compose.yml b/configuration/amd64/docker-compose.yml index 0c9d5feb2..7055795e4 100755 --- a/configuration/amd64/docker-compose.yml +++ b/configuration/amd64/docker-compose.yml @@ -20,7 +20,7 @@ services: - mysql-datavolume:/var/lib/mysql php: - image: usdotfhwaops/php:latest + image: usdotfhwaops/php:develop container_name: php network_mode: host depends_on: @@ -30,7 +30,7 @@ services: tty: true v2xhub: - image: usdotfhwaops/v2xhubamd:latest + image: usdotfhwaops/v2xhub:develop container_name: v2xhub network_mode: host restart: always @@ -46,8 +46,8 @@ services: - ./logs:/var/log/tmx - ./MAP:/var/www/plugins/MAP port_drayage_webservice: - image: usdotfhwaops/port-drayage-webservice:latest - container_name: port_drayage_webservice + image: usdotfhwaops/port-drayage-webservice:develop + container_name: port_drayage_webservicedock network_mode: host secrets: mysql_password: diff --git a/configuration/arm64/docker-compose.yml b/configuration/arm64/docker-compose.yml index a32c31fab..1712beaa6 100644 --- a/configuration/arm64/docker-compose.yml +++ b/configuration/arm64/docker-compose.yml @@ -20,7 +20,7 @@ services: - mysql-datavolume:/var/lib/mysql php: - image: usdotfhwaops/php_arm:latest + image: usdotfhwaops/php:develop container_name: php network_mode: host depends_on: @@ -30,7 +30,7 @@ services: tty: true v2xhub: - image: usdotfhwaops/v2xhubarm:latest + image: usdotfhwaops/v2xhub:develop container_name: v2xhub network_mode: host restart: always @@ -44,7 +44,7 @@ services: - ./logs:/var/log/tmx - ./MAP:/var/www/plugins/MAP port_drayage_webservice: - image: usdotfhwaops/port-drayage-webservice_arm:latest + image: usdotfhwaops/port-drayage-webservice:vh-1278-update-to-github-actions container_name: port_drayage_webservice network_mode: host secrets: From a0a8d5dfdb51037a84aebc400cd466f7da7b49bf Mon Sep 17 00:00:00 2001 From: dev Date: Tue, 26 Mar 2024 11:24:51 -0400 Subject: [PATCH 06/10] Fix workflows --- .github/workflows/build_php_docker_image.yml | 7 ++++--- .github/workflows/build_port_drayage_docker_image.yml | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_php_docker_image.yml b/.github/workflows/build_php_docker_image.yml index 370f5b14a..ad5266fdb 100644 --- a/.github/workflows/build_php_docker_image.yml +++ b/.github/workflows/build_php_docker_image.yml @@ -1,10 +1,11 @@ -name: Build Port Drayage Web App Docker Image +name: Build PHP V2X-Hub Web UI on: push: branches: - develop - master - 'release/**' + - vh-1278-update-github-actions # Build all tags not containing a / (https://stackoverflow.com/questions/61891328/trigger-github-action-only-on-new-tags ) tags: - '*' @@ -27,7 +28,7 @@ jobs: id: meta uses: docker/metadata-action@v4 with: - images: usdotfhwaops/port_drayage_webservice + images: usdotfhwaops/php tags: | type=schedule type=ref,event=branch @@ -40,7 +41,7 @@ jobs: with: push: true platforms: linux/amd64,linux/arm64 - context: tools/port-drayage-webservice/ + file: Dockerfile-php tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} build-args: | diff --git a/.github/workflows/build_port_drayage_docker_image.yml b/.github/workflows/build_port_drayage_docker_image.yml index c0dd92ec5..dfbbe5226 100644 --- a/.github/workflows/build_port_drayage_docker_image.yml +++ b/.github/workflows/build_port_drayage_docker_image.yml @@ -1,10 +1,11 @@ -name: Build V2X-Hub Docker Image +name: Build Port Drayage Web Service on: push: branches: - develop - master - 'release/**' + - vh-1278-update-github-actions # Build all tags not containing a / (https://stackoverflow.com/questions/61891328/trigger-github-action-only-on-new-tags ) tags: - '*' @@ -27,7 +28,7 @@ jobs: id: meta uses: docker/metadata-action@v4 with: - images: usdotfhwaops/v2xhub + images: usdotfhwaops/port-drayage-webservice tags: | type=schedule type=ref,event=branch @@ -40,7 +41,7 @@ jobs: with: push: true platforms: linux/amd64,linux/arm64 - context: . + context: ./tools/port-drayage-webservice/ tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} build-args: | From 2d60efeb991219d8a1ab0e5b97e3a077cb055738 Mon Sep 17 00:00:00 2001 From: dev Date: Tue, 26 Mar 2024 11:27:58 -0400 Subject: [PATCH 07/10] Correct Branch name --- .github/workflows/build_php_docker_image.yml | 2 +- .github/workflows/build_port_drayage_docker_image.yml | 2 +- .github/workflows/build_v2xhub_docker_image.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_php_docker_image.yml b/.github/workflows/build_php_docker_image.yml index ad5266fdb..4d6673ddb 100644 --- a/.github/workflows/build_php_docker_image.yml +++ b/.github/workflows/build_php_docker_image.yml @@ -5,7 +5,7 @@ on: - develop - master - 'release/**' - - vh-1278-update-github-actions + - vh-1278-update-to-github-actions # Build all tags not containing a / (https://stackoverflow.com/questions/61891328/trigger-github-action-only-on-new-tags ) tags: - '*' diff --git a/.github/workflows/build_port_drayage_docker_image.yml b/.github/workflows/build_port_drayage_docker_image.yml index dfbbe5226..dcd09391b 100644 --- a/.github/workflows/build_port_drayage_docker_image.yml +++ b/.github/workflows/build_port_drayage_docker_image.yml @@ -5,7 +5,7 @@ on: - develop - master - 'release/**' - - vh-1278-update-github-actions + - vh-1278-update-to-github-actions # Build all tags not containing a / (https://stackoverflow.com/questions/61891328/trigger-github-action-only-on-new-tags ) tags: - '*' diff --git a/.github/workflows/build_v2xhub_docker_image.yml b/.github/workflows/build_v2xhub_docker_image.yml index 28b946cfc..17c57e68e 100644 --- a/.github/workflows/build_v2xhub_docker_image.yml +++ b/.github/workflows/build_v2xhub_docker_image.yml @@ -5,6 +5,7 @@ on: - develop - master - 'release/**' + - vh-1278-update-to-github-actions # Build all tags not containing a / (https://stackoverflow.com/questions/61891328/trigger-github-action-only-on-new-tags ) tags: - '*' @@ -40,7 +41,6 @@ jobs: with: push: true platforms: linux/amd64,linux/arm64 - context: . tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} build-args: | From 5ef946dead47332efd86f6fe70c7e076c1885c74 Mon Sep 17 00:00:00 2001 From: dev Date: Tue, 26 Mar 2024 11:36:57 -0400 Subject: [PATCH 08/10] Fix build_php_docker_image workflow --- .github/workflows/build_php_docker_image.yml | 2 +- tools/port-drayage-webservice/Dockerfile-arm | 12 ------------ 2 files changed, 1 insertion(+), 13 deletions(-) delete mode 100644 tools/port-drayage-webservice/Dockerfile-arm diff --git a/.github/workflows/build_php_docker_image.yml b/.github/workflows/build_php_docker_image.yml index 4d6673ddb..1ccc3fc85 100644 --- a/.github/workflows/build_php_docker_image.yml +++ b/.github/workflows/build_php_docker_image.yml @@ -41,7 +41,7 @@ jobs: with: push: true platforms: linux/amd64,linux/arm64 - file: Dockerfile-php + file: ./docker/Dockerfile-php tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} build-args: | diff --git a/tools/port-drayage-webservice/Dockerfile-arm b/tools/port-drayage-webservice/Dockerfile-arm deleted file mode 100644 index e83deb874..000000000 --- a/tools/port-drayage-webservice/Dockerfile-arm +++ /dev/null @@ -1,12 +0,0 @@ -FROM arm64v8/maven:3.8-jdk-11-slim AS maven_build -RUN mkdir /home/port-drayage-webservice -COPY src/ /home/port-drayage-webservice/src/ -COPY pom.xml /home/port-drayage-webservice/ -WORKDIR /home/port-drayage-webservice/ -RUN mvn clean install -FROM arm64v8/alpine:latest -RUN mkdir /home/port-drayage-webservice/ -RUN apk add openjdk11 --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community -COPY --from=maven_build /home/port-drayage-webservice/target/port-drayage-webservice-0.0.1-SNAPSHOT.jar /home/port-drayage-webservice/ -WORKDIR /home/port-drayage-webservice/ -ENTRYPOINT ["java","-jar","port-drayage-webservice-0.0.1-SNAPSHOT.jar"] \ No newline at end of file From c8086f208070f2af0ec645b175a5a722bb4a47f5 Mon Sep 17 00:00:00 2001 From: dev Date: Tue, 26 Mar 2024 14:39:28 -0400 Subject: [PATCH 09/10] Updates, remove testing workflow --- .github/workflows/build_php_docker_image.yml | 1 - .github/workflows/build_port_drayage_docker_image.yml | 1 - .github/workflows/build_v2xhub_docker_image.yml | 1 - configuration/amd64/docker-compose.yml | 2 +- configuration/arm64/docker-compose.yml | 2 +- 5 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_php_docker_image.yml b/.github/workflows/build_php_docker_image.yml index 1ccc3fc85..56b90a5f6 100644 --- a/.github/workflows/build_php_docker_image.yml +++ b/.github/workflows/build_php_docker_image.yml @@ -5,7 +5,6 @@ on: - develop - master - 'release/**' - - vh-1278-update-to-github-actions # Build all tags not containing a / (https://stackoverflow.com/questions/61891328/trigger-github-action-only-on-new-tags ) tags: - '*' diff --git a/.github/workflows/build_port_drayage_docker_image.yml b/.github/workflows/build_port_drayage_docker_image.yml index dcd09391b..a5f70503f 100644 --- a/.github/workflows/build_port_drayage_docker_image.yml +++ b/.github/workflows/build_port_drayage_docker_image.yml @@ -5,7 +5,6 @@ on: - develop - master - 'release/**' - - vh-1278-update-to-github-actions # Build all tags not containing a / (https://stackoverflow.com/questions/61891328/trigger-github-action-only-on-new-tags ) tags: - '*' diff --git a/.github/workflows/build_v2xhub_docker_image.yml b/.github/workflows/build_v2xhub_docker_image.yml index 17c57e68e..13aab425d 100644 --- a/.github/workflows/build_v2xhub_docker_image.yml +++ b/.github/workflows/build_v2xhub_docker_image.yml @@ -5,7 +5,6 @@ on: - develop - master - 'release/**' - - vh-1278-update-to-github-actions # Build all tags not containing a / (https://stackoverflow.com/questions/61891328/trigger-github-action-only-on-new-tags ) tags: - '*' diff --git a/configuration/amd64/docker-compose.yml b/configuration/amd64/docker-compose.yml index 7055795e4..6d682d25f 100755 --- a/configuration/amd64/docker-compose.yml +++ b/configuration/amd64/docker-compose.yml @@ -47,7 +47,7 @@ services: - ./MAP:/var/www/plugins/MAP port_drayage_webservice: image: usdotfhwaops/port-drayage-webservice:develop - container_name: port_drayage_webservicedock + container_name: port_drayage_webservice network_mode: host secrets: mysql_password: diff --git a/configuration/arm64/docker-compose.yml b/configuration/arm64/docker-compose.yml index 1712beaa6..bd25756d6 100644 --- a/configuration/arm64/docker-compose.yml +++ b/configuration/arm64/docker-compose.yml @@ -44,7 +44,7 @@ services: - ./logs:/var/log/tmx - ./MAP:/var/www/plugins/MAP port_drayage_webservice: - image: usdotfhwaops/port-drayage-webservice:vh-1278-update-to-github-actions + image: usdotfhwaops/port-drayage-webservice:develop container_name: port_drayage_webservice network_mode: host secrets: From 9bf076a27c129e3d5caed75cf178c7e68512205a Mon Sep 17 00:00:00 2001 From: dev Date: Tue, 26 Mar 2024 15:41:17 -0400 Subject: [PATCH 10/10] Update action versions for deprecated Node.js verion --- .github/workflows/build_php_docker_image.yml | 8 ++++---- .../workflows/build_port_drayage_docker_image.yml | 8 ++++---- .github/workflows/build_v2xhub_docker_image.yml | 8 ++++---- .github/workflows/pull_request.yml | 12 ++++++------ .github/workflows/sonar-scanner.yml | 2 +- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build_php_docker_image.yml b/.github/workflows/build_php_docker_image.yml index 56b90a5f6..bb9ee7cc1 100644 --- a/.github/workflows/build_php_docker_image.yml +++ b/.github/workflows/build_php_docker_image.yml @@ -13,11 +13,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Log in to Docker Hub uses: docker/login-action@v2 with: @@ -25,7 +25,7 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: usdotfhwaops/php tags: | @@ -36,7 +36,7 @@ jobs: # set latest tag for default branch type=raw,value=latest,enable={{is_default_branch}} - name: Build and push - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 with: push: true platforms: linux/amd64,linux/arm64 diff --git a/.github/workflows/build_port_drayage_docker_image.yml b/.github/workflows/build_port_drayage_docker_image.yml index a5f70503f..dd9115995 100644 --- a/.github/workflows/build_port_drayage_docker_image.yml +++ b/.github/workflows/build_port_drayage_docker_image.yml @@ -13,11 +13,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Log in to Docker Hub uses: docker/login-action@v2 with: @@ -25,7 +25,7 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: usdotfhwaops/port-drayage-webservice tags: | @@ -36,7 +36,7 @@ jobs: # set latest tag for default branch type=raw,value=latest,enable={{is_default_branch}} - name: Build and push - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 with: push: true platforms: linux/amd64,linux/arm64 diff --git a/.github/workflows/build_v2xhub_docker_image.yml b/.github/workflows/build_v2xhub_docker_image.yml index 13aab425d..c8ec318d9 100644 --- a/.github/workflows/build_v2xhub_docker_image.yml +++ b/.github/workflows/build_v2xhub_docker_image.yml @@ -13,11 +13,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Log in to Docker Hub uses: docker/login-action@v2 with: @@ -25,7 +25,7 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: usdotfhwaops/v2xhub tags: | @@ -36,7 +36,7 @@ jobs: # set latest tag for default branch type=raw,value=latest,enable={{is_default_branch}} - name: Build and push - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 with: push: true platforms: linux/amd64,linux/arm64 diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index d5bced161..17d8f1dc6 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -8,14 +8,14 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: usdotfhwaops/php tags: | @@ -26,7 +26,7 @@ jobs: # set latest tag for default branch type=raw,value=latest,enable={{is_default_branch}} - name: V2X-Hub Docker build - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 with: file: Dockerfile platforms: linux/amd64,linux/arm64 @@ -34,7 +34,7 @@ jobs: BUILD_ARCHITECTURE=${{ matrix.architecture }} UBUNTU_CODENAME=${{ matrix.ubuntu-codename }} - name: PHP Docker build - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 with: file: docker/Dockerfile-php platforms: linux/amd64,linux/arm64 @@ -42,7 +42,7 @@ jobs: BUILD_ARCHITECTURE=${{ matrix.architecture }} UBUNTU_CODENAME=${{ matrix.ubuntu-codename }} - name: Port Drayage Docker build - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 with: context: tools/port-drayage-webservice platforms: linux/amd64,linux/arm64 diff --git a/.github/workflows/sonar-scanner.yml b/.github/workflows/sonar-scanner.yml index a0636f357..ded72973a 100644 --- a/.github/workflows/sonar-scanner.yml +++ b/.github/workflows/sonar-scanner.yml @@ -18,7 +18,7 @@ jobs: export DEBIAN_FRONTEND=noninteractive apt-get install -y curl zip git gcovr - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: # Disabling shallow clone is recommended for improving relevancy of reporting fetch-depth: 0