Skip to content

Commit

Permalink
BFD-3090: Use bfd-parent version in bfd-apps image (#2084)
Browse files Browse the repository at this point in the history
  • Loading branch information
mjburling authored Dec 7, 2023
1 parent 3325ba8 commit ea92f71
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/ci-java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ env:
^ops/ansible/roles/bfd-pipeline/|\
^ops/ansible/roles/bfd-server/|\
^.github/workflows/ci-ansible.yml|\
^.github/workflows/yml\
)"
^.github/workflows/ci-java.yml)"

jobs:
workflow:
Expand Down Expand Up @@ -111,19 +110,26 @@ jobs:
run: mvn --threads 1C --quiet --batch-mode -Dmaven.build.cache.enabled=false verify
working-directory: ./apps

- name: 'Install yq'
run: |
sudo wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq
sudo chmod +x /usr/bin/yq
- name: Login to GitHub Container Registry
run: |
echo "${{ secrets.GITHUB_TOKEN }}" \
| docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build and Deliver Apps Container Image
run: |
BFD_PARENT_VERSION="$(yq '.project.version' pom.xml)"
SANITIZED_REF="${GITHUB_REF_NAME////-}"
IMAGE_NAME="ghcr.io/cmsgov/bfd-apps"
SHORT_SHA="$(git rev-parse --short HEAD)"
FULL_BRANCH_TAG="${IMAGE_NAME}:${SANITIZED_REF}" # human readable, branch name tag
FULL_COMMIT_TAG="${IMAGE_NAME}:${SHORT_SHA}" # a short sha suffixed image tag
docker build . --tag "$FULL_BRANCH_TAG"
echo "Building ${BFD_PARENT_VERSION} Container"
docker build --tag "$FULL_BRANCH_TAG" --build-arg="BFD_VERSION=${BFD_PARENT_VERSION}" .
docker tag "$FULL_BRANCH_TAG" "$FULL_COMMIT_TAG"
docker push "$FULL_BRANCH_TAG"
docker push "$FULL_COMMIT_TAG"
Expand Down
9 changes: 5 additions & 4 deletions apps/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
# BASE_ANSIBLE tag, a known tag or latest available from https://github.com/CMSgov/beneficiary-fhir-data/pkgs/container/bfd-ansible
ARG BASE_ANSIBLE_TAG=master
FROM ghcr.io/cmsgov/bfd-ansible:$BASE_ANSIBLE_TAG
ARG BFD_VERSION
LABEL org.opencontainers.image.source=https://github.com/CMSgov/beneficiary-fhir-data

# flyway migrations for test harness setup
COPY bfd-model/bfd-model-rif/src/main/resources/db/migration /flyway/sql

# bfd-server assets
COPY bfd-server/bfd-server-launcher/target/bfd-server-launcher-1.0.0-SNAPSHOT.zip /.m2/repository/gov/cms/bfd/bfd-server-launcher/1.0.0-SNAPSHOT/bfd-server-launcher-1.0.0-SNAPSHOT.zip
COPY bfd-server/bfd-server-war/target/bfd-server-war-1.0.0-SNAPSHOT.war /.m2/repository/gov/cms/bfd/bfd-server-war/1.0.0-SNAPSHOT/bfd-server-war-1.0.0-SNAPSHOT.war
COPY bfd-server/bfd-server-launcher/target/bfd-server-launcher-${BFD_VERSION}.zip /.m2/repository/gov/cms/bfd/bfd-server-launcher/${BFD_VERSION}/bfd-server-launcher-${BFD_VERSION}.zip
COPY bfd-server/bfd-server-war/target/bfd-server-war-${BFD_VERSION}.war /.m2/repository/gov/cms/bfd/bfd-server-war/${BFD_VERSION}/bfd-server-war-${BFD_VERSION}.war

# bfd-pipeline assets
COPY bfd-pipeline/bfd-pipeline-app/target/bfd-pipeline-app-1.0.0-SNAPSHOT.zip /.m2/repository/gov/cms/bfd/bfd-pipeline-app/1.0.0-SNAPSHOT/bfd-pipeline-app-1.0.0-SNAPSHOT.zip
COPY bfd-pipeline/bfd-pipeline-app/target/bfd-pipeline-app-${BFD_VERSION}.zip /.m2/repository/gov/cms/bfd/bfd-pipeline-app/${BFD_VERSION}/bfd-pipeline-app-${BFD_VERSION}.zip

# bfd-db-migrator assets
COPY bfd-db-migrator/target/bfd-db-migrator-1.0.0-SNAPSHOT.zip /.m2/repository/gov/cms/bfd/bfd-db-migrator/1.0.0-SNAPSHOT/bfd-db-migrator-1.0.0-SNAPSHOT.zip
COPY bfd-db-migrator/target/bfd-db-migrator-${BFD_VERSION}.zip /.m2/repository/gov/cms/bfd/bfd-db-migrator/${BFD_VERSION}/bfd-db-migrator-${BFD_VERSION}.zip

0 comments on commit ea92f71

Please sign in to comment.