Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

Commit

Permalink
Merge pull request #125 from Axway/APIGOV-00001
Browse files Browse the repository at this point in the history
APIGOV-00001 - test
  • Loading branch information
dfeldick authored Aug 12, 2024
2 parents dff453c + 2da7dac commit dfb26ee
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 94 deletions.
181 changes: 90 additions & 91 deletions .github/workflows/build-docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,101 +10,101 @@ jobs:
testAgents:
uses: ./.github/workflows/run-tests.yml

buildDiscoveryAgentDocker:
needs: testAgents
env:
GOFLAGS: "-mod=mod"
GOWORK: "off"
IMAGE_NAME: webmethods_discovery_agent
ORG_NAME: Axway
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# buildDiscoveryAgentDocker:
# needs: testAgents
# env:
# GOFLAGS: "-mod=mod"
# GOWORK: "off"
# IMAGE_NAME: webmethods_discovery_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: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# - 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: 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: Log in to the Container registry
# uses: docker/login-action@v3
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: build/discovery.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: 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 }}

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: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# - name: Build and push Docker image
# uses: docker/build-push-action@v5
# with:
# context: .
# file: build/discovery.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 }}

# 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: 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
Expand All @@ -115,5 +115,4 @@ jobs:
env:
TEAMS_WEBHOOK_URL: ${{ secrets.TEAMS_WEBHOOK_URL }}
TAG: ${{ github.ref_name }}
run: ./release.sh

run: ./release.sh ${{ github.event.inputs.promotiontype }}
8 changes: 7 additions & 1 deletion .github/workflows/fully-automated-release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# this action is triggered by selecting the action in the github UI and then clicking "run workflow"
name: Fully automated release

on: workflow_dispatch
on:
workflow_dispatch:
inputs:
promotiontype:
description: Promotion type (major, minor, patch)
required: true
default: 'patch'

jobs:
updateAndCreatePR:
Expand Down
11 changes: 9 additions & 2 deletions release.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
shopt -s nocasematch

# you can add variables like this to test locally. Just run ./release.sh. Note that to run on MAC, you must install bash 5.x.
# you can add variables like this to test locally. Just run ./release.sh. Note that to run on MAC, you must install bash 5.x.
# Then, to run the script you must do: /usr/local/bin/bash ./release.sh
# TEAMS_WEBHOOK_URL="foo.bar"
# TAG="1.2.3"
Expand All @@ -17,6 +17,10 @@ check_required_variables() {
echo "Validating the required environment variables..."

[ -z "${TEAMS_WEBHOOK_URL}" ] && echo "TEAMS_WEBHOOK_URL variable not set" && exit 1
if [[ "$PROMOTION_TYPE" != "patch" && "$PROMOTION_TYPE" != "minor" && "$PROMOTION_TYPE" != "major" ]]; then
echo "PROMOTION_TYPE variable must be patch, minor, or major"
exit 1
fi
[ -z "${TAG}" ] && echo "TAG variable not set" && exit 1
[ -z "${SDK}" ] && echo "SDK variable not set" && exit 1

Expand Down Expand Up @@ -73,8 +77,11 @@ post_to_teams() {
main() {
# validate required variables
get_sdk_version
export PROMOTION_TYPE=$1
check_required_variables

exit -1

if [ $? -eq 1 ]; then
echo "No release info being generated."
exit 1
Expand All @@ -85,7 +92,7 @@ main() {
releaseStats+="- SDK version: ${SDK}\n"

echo -e "Full Release Info:\n"${releaseStats}
post_to_teams "${releaseStats}"
# post_to_teams "${releaseStats}"
exit 0
}

Expand Down

0 comments on commit dfb26ee

Please sign in to comment.