From fe9bf41bbb9bd9be76b659ad82792972b5c037dd Mon Sep 17 00:00:00 2001 From: dfeldick Date: Fri, 10 May 2024 07:26:57 -0700 Subject: [PATCH] APIGOV-27565 - test --- .github/workflows/build-docker-images.yml | 86 +++++++++++------------ build/discovery.Dockerfile | 2 +- 2 files changed, 44 insertions(+), 44 deletions(-) diff --git a/.github/workflows/build-docker-images.yml b/.github/workflows/build-docker-images.yml index 0c7c1b8..42798bc 100644 --- a/.github/workflows/build-docker-images.yml +++ b/.github/workflows/build-docker-images.yml @@ -58,53 +58,53 @@ jobs: sdk_version=${{ steps.vars.outputs.sdkversion }} commit_id=${{ steps.vars.outputs.commit }} - # buildTraceabilityAgentDocker: - # needs: testAgents - # env: - # GOFLAGS: "-mod=mod" - # GOWORK: "off" - # IMAGE_NAME: webmethods_traceability_agent - # ORG_NAME: Axway - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v4 + buildTraceabilityAgentDocker: + needs: testAgents + env: + GOFLAGS: "-mod=mod" + GOWORK: "off" + IMAGE_NAME: webmethods_traceability_agent + ORG_NAME: Axway + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 - # - name: Set outputs - # id: vars - # run: | - # echo "date=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_OUTPUT - # echo "tag=${{github.ref_name }}" >> $GITHUB_OUTPUT - # echo "sdkversion=$(grep github.com/Axway/agent-sdk go.mod | awk '{print $2}')" >> $GITHUB_OUTPUT - # echo "commit=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_OUTPUT + - name: Set outputs + id: vars + run: | + echo "date=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_OUTPUT + echo "tag=${{github.ref_name }}" >> $GITHUB_OUTPUT + echo "sdkversion=$(grep github.com/Axway/agent-sdk go.mod | awk '{print $2}')" >> $GITHUB_OUTPUT + echo "commit=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_OUTPUT - # - name: Log in to the Container registry - # uses: docker/login-action@v3 - # with: - # registry: ghcr.io - # username: ${{ github.actor }} - # password: ${{ secrets.GITHUB_TOKEN }} + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - # - name: Extract metadata (tags, labels) for Docker - # id: meta - # uses: docker/metadata-action@v5 - # with: - # flavor: latest=false - # images: ghcr.io/${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }} + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + flavor: latest=false + images: ghcr.io/${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }} - # - name: Build and push Docker image - # uses: docker/build-push-action@v5 - # with: - # context: . - # file: build/traceability.Dockerfile - # push: true - # tags: ${{ steps.meta.outputs.tags }} - # labels: ${{ steps.meta.outputs.labels }} - # build-args: | - # time=${{ steps.vars.outputs.date }} - # CGO_ENABLED=0 - # version=${{ steps.vars.outputs.tag }} - # sdk_version=${{ steps.vars.outputs.sdkversion }} - # commit_id=${{ steps.vars.outputs.commit }} + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + file: build/traceability.Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + build-args: | + time=${{ steps.vars.outputs.date }} + CGO_ENABLED=0 + version=${{ steps.vars.outputs.tag }} + sdk_version=${{ steps.vars.outputs.sdkversion }} + commit_id=${{ steps.vars.outputs.commit }} notifyTeamsChannel: runs-on: ubuntu-latest diff --git a/build/discovery.Dockerfile b/build/discovery.Dockerfile index b3f467c..cfd9aec 100644 --- a/build/discovery.Dockerfile +++ b/build/discovery.Dockerfile @@ -28,7 +28,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build \ # Create non-root user RUN addgroup -g 2500 ${APP_USER} && adduser -u 2500 -D -G ${APP_USER} ${APP_USER} -RUN chown -R $APP_USER:$APP_USER /webmethods_discovery_agent +RUN chown -R $APP_USER:$APP_USER bin/webmethods_discovery_agent USER ${APP_USER} # alpine 3.19 linux/amd64