Skip to content

Commit

Permalink
Uncouple docker-compose from version
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbourelly999 committed Apr 29, 2024
1 parent 9c30a8a commit 16d93f1
Show file tree
Hide file tree
Showing 8 changed files with 220 additions and 118 deletions.
106 changes: 0 additions & 106 deletions .github/workflows/build.yml

This file was deleted.

48 changes: 48 additions & 0 deletions .github/workflows/build_php_docker_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build PHP V2X-Hub Web UI
on:
push:
branches:
- develop
- master
- 'release/**'
# 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
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- 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@v5
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@v5
with:
push: true
platforms: linux/amd64,linux/arm64
file: ./docker/Dockerfile-php
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BUILD_ARCHITECTURE=${{ matrix.architecture }}
UBUNTU_CODENAME=${{ matrix.ubuntu-codename }}
48 changes: 48 additions & 0 deletions .github/workflows/build_port_drayage_docker_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build Port Drayage Web Service
on:
push:
branches:
- develop
- master
- 'release/**'
# 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
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- 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@v5
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@v5
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 }}
47 changes: 47 additions & 0 deletions .github/workflows/build_v2xhub_docker_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build V2X-Hub Docker Image
on:
push:
branches:
- develop
- master
- 'release/**'
# 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
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- 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@v5
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@v5
with:
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BUILD_ARCHITECTURE=${{ matrix.architecture }}
UBUNTU_CODENAME=${{ matrix.ubuntu-codename }}
51 changes: 51 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Pull Request Workflow

on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
docker-image-builds:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
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@v5
with:
file: Dockerfile
platforms: linux/amd64,linux/arm64
build-args: |
BUILD_ARCHITECTURE=${{ matrix.architecture }}
UBUNTU_CODENAME=${{ matrix.ubuntu-codename }}
- name: PHP Docker build
uses: docker/build-push-action@v5
with:
file: docker/Dockerfile-php
platforms: linux/amd64,linux/arm64
build-args: |
BUILD_ARCHITECTURE=${{ matrix.architecture }}
UBUNTU_CODENAME=${{ matrix.ubuntu-codename }}
- name: Port Drayage Docker build
uses: docker/build-push-action@v5
with:
context: tools/port-drayage-webservice
platforms: linux/amd64,linux/arm64
build-args: |
BUILD_ARCHITECTURE=${{ matrix.architecture }}
UBUNTU_CODENAME=${{ matrix.ubuntu-codename }}
12 changes: 8 additions & 4 deletions .github/workflows/sonar-scanner.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
on:
push:
# run on branches and not PRs due to secrets used
branches:
- develop
- master
- "release/*"
pull_request:
types: [opened, synchronize, reopened]
name: Sonar Workflow
jobs:
sonarcloud:
runs-on: ubuntu-latest
container:
image: ubuntu:jammy-20230126
steps:
- name: Install curl, zip, git, gcovr
- name: Install gcovr
run: |
apt update
export DEBIAN_FRONTEND=noninteractive
apt-get install -y curl zip git gcovr
apt-get install -y 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
Expand Down
20 changes: 15 additions & 5 deletions configuration/amd64/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ services:
- mysql-datavolume:/var/lib/mysql

php:
image: usdotfhwaops/php:7.6.0
image: usdotfhwaops/php:${V2XHUB_VERSION:-develop}
container_name: php
network_mode: host
depends_on:
Expand All @@ -30,23 +30,33 @@ services:
tty: true

v2xhub:
image: usdotfhwaops/v2xhubamd:7.6.0
image: usdotfhwaops/v2xhubamd:${V2XHUB_VERSION:-develop}
container_name: v2xhub
network_mode: host
restart: always
depends_on:
- db
environment:
- MYSQL_PASSWORD=/run/secrets/mysql_password
- INFRASTRUCTURE_ID=rsu_<J2735 MAP MESSAGE INTERSECTION ID>
- INFRASTRUCTURE_NAME=<RSU_NAME>
- SIMULATION_MODE=${SIMULATION_MODE:-false}
- SIMULATION_IP=${SIMULATION_IP:-127.0.0.1}
- SIMULATION_REGISTRATION_PORT=6767
- LOCAL_IP=${LOCAL_IP:-127.0.0.1}
- TIME_SYNC_TOPIC=time_sync
- TIME_SYNC_PORT=7575
- SIM_V2X_PORT=5757
- SIM_INTERACTION_PORT=7576
- V2X_PORT=8686
- INFRASTRUCTURE_ID=${INFRASTRUCTURE_ID:-rsu_1234}
- INFRASTRUCTURE_NAME=${INFRASTRUCTURE_NAME:-East Intersection}
- SENSOR_JSON_FILE_PATH=${SENSOR_JSON_FILE_PATH:-/var/www/plugins/MAP/sensors.json}
secrets:
- mysql_password
volumes:
- ./logs:/var/log/tmx
- ./MAP:/var/www/plugins/MAP
port_drayage_webservice:
image: usdotfhwaops/port-drayage-webservice:7.6.0
image: usdotfhwaops/port-drayage-webservice:${V2XHUB_VERSION:-develop}
container_name: port_drayage_webservice
network_mode: host
secrets:
Expand Down
Loading

0 comments on commit 16d93f1

Please sign in to comment.