Skip to content

golang: update to 1.19, update non-rp libs. #49

golang: update to 1.19, update non-rp libs.

golang: update to 1.19, update non-rp libs. #49

Workflow file for this run

name: "build image"
on:
push:
branches-ignore:
- main
- master
tags:
- 'v*'
jobs:
build_cfg:
runs-on: ubuntu-latest
environment: default
outputs:
VERSION_KIND: ${{ steps.config_step.outputs.VERSION_KIND }}
VERSION_STR: ${{ steps.config_step.outputs.VERSION_STR }}
ALT_TAGS: ${{ steps.config_step.outputs.ALT_TAGS }}
steps:
- name: "Determine Version"
id: config_step
run: |-
#VER_KIND = 'alpha' (not deployed) | 'dev' | 'beta' | 'gold'
VER_KIND=dev
VER_BUILD=$(date +%H%M)
# limit to only first 3 chars
VER_BUILD=${VER_BUILD:0:3}
# 'strict' semver segments cannot start with 0
VERSION_NUM="$(date +%y).$(date +%-m).$(date +%-d).${VER_BUILD#0}"
# recreate as INT, leaving 0's in place; creates a 'reasonable' 32-bit signed int.
VERSION_INT="$(date +%y)$(date +%m)$(date +%d)${VER_BUILD}"
VERSION_STR=${VERSION_NUM}
REF_NAME="${{ github.ref_name }}"
if [[ ${REF_NAME} =~ ^(v)([[:digit:]]+\..*)$ ]]; then
VER_KIND=gold
VERSION_STR=${BASH_REMATCH[2]}
else
ALT_TAGS=""
if [[ "${REF_NAME}" == "develop" ]]; then
ALT_TAGS+=",ci-develop"
else
ALT_TAGS=",ci-dev-${REF_NAME#**/}"
fi
fi
echo "VERSION_STR=${VERSION_STR}" >> $GITHUB_OUTPUT
echo "ALT_TAGS=${ALT_TAGS}" >> $GITHUB_OUTPUT
echo "VERSION_KIND=${VER_KIND}" >> $GITHUB_OUTPUT
echo "::notice::Version KIND=${VER_KIND}, STR=${VERSION_STR}${ALT_TAGS}, INT=${VERSION_INT}"
#endjob build_cfg
trigger-build:
runs-on: ubuntu-latest
needs: [build_cfg]
environment: default
env:
K8S_PROJECT: pulse-engage-courier
K8S_CONTAINER: courier
SLACK_DEPLOY_MSG:
steps:
- name: "Trigger Container Build"
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.CI_WEBHOOK_TOKEN }}
repository: istresearch/ci-docker
event-type: build-repo
client-payload: |-
{
"repo": {
"name": "${{ github.repository }}",
"ref_type": "${{ github.ref_type }}",
"ref_name": "${{ github.ref_name }}"
},
"image": {
"dockerfile": "Dockerfile",
"arch_allowed": "amd64 arm64",
"name": "${{ github.repository }}",
"tag": "${{ needs.build_cfg.outputs.VERSION_STR }}${{ needs.build_cfg.outputs.ALT_TAGS }}",
"build_args": [
]
},
"deployment": {
"deploy_flag": "${{ needs.build_cfg.outputs.VERSION_KIND == 'dev' }}",
"k8s_project": "${{ env.K8S_PROJECT }}",
"k8s_container": "${{ env.K8S_CONTAINER }}",
"deploy_msg": "${{ env.SLACK_DEPLOY_MSG }}"
},
"callback": {
"repository": "${{ github.repository }}",
"event_type": "build_image_result",
"error_type": "build_image_error"
}
}
#endjob trigger-build