Skip to content

small adjustment to the startup.sh #28

small adjustment to the startup.sh

small adjustment to the startup.sh #28

Workflow file for this run

# Generated by: gromit policy
# Generated on: Fri Apr 28 10:48:32 UTC 2023
# Distribution channels covered by this workflow
# - docker hub
name: Release
on:
pull_request:
push:
branches:
- master
- release-**
tags:
- 'v*'
env:
GOPRIVATE: github.com/TykTechnologies
REGISTRY: ghcr.io
jobs:
goreleaser:
name: '${{ matrix.golang_cross }}'
runs-on: ubuntu-latest
container: 'tykio/golang-cross:${{ matrix.golang_cross }}'
strategy:
fail-fast: false
matrix:
golang_cross: [1.19-bullseye]
include:
- golang_cross: 1.19-bullseye
goreleaser: 'ci/goreleaser/goreleaser.yml'
debvers: 'ubuntu/xenial ubuntu/bionic debian/jessie ubuntu/focal debian/buster debian/bullseye'
outputs:
tag: ${{ steps.targets.outputs.tag }}
steps:
- name: Fix private module deps
env:
TOKEN: '${{ secrets.ORG_GH_TOKEN }}'
run: >
git config --global url."https://${TOKEN}@github.com".insteadOf "https://github.com"
- name: Checkout of tyk-identity-broker
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: "Add Git safe.directory"
run: git config --global --add safe.directory $GITHUB_WORKSPACE
- name: Delete old release assets
if: startsWith(github.ref, 'refs/tags')
uses: mknejp/delete-release-assets@v1
with:
token: ${{ github.token }}
tag: ${{ github.ref }}
fail-if-no-assets: false
fail-if-no-release: false
assets: |
*.deb
*.rpm
*.tar.gz
*.txt.sig
*.txt
- name: Set tag
id: targets
shell: bash
run: |
current_tag=${GITHUB_REF##*/}
echo "tag=${current_tag}" >> $GITHUB_OUTPUT
- uses: goreleaser/goreleaser-action@v4
with:
version: 1.18.2
args: release --clean -f ${{ matrix.goreleaser }} ${{ !startsWith(github.ref, 'refs/tags/') && ' --snapshot' || '' }}
env:
CGO_ENABLED: 0
GOLANG_CROSS: ${{ matrix.golang_cross }}
DEBVERS: ${{ matrix.debvers }}
- uses: actions/upload-artifact@v3
with:
name: deb
retention-days: 1
path: |
dist/*.deb
!dist/*PAYG*.deb
ci:
needs:
- goreleaser
runs-on: ubuntu-latest
steps:
- name: Shallow checkout of tyk-identity-broker
uses: actions/checkout@v3
with:
fetch-depth: 1
- uses: actions/download-artifact@v3
with:
name: deb
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- name: Login to GithHub Registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: CI build
uses: docker/build-push-action@v3
with:
push: true
context: "."
file: ci/Dockerfile.std
platforms: linux/amd64,linux/arm64
tags: |
${{ env.REGISTRY }}/sycatims/sycat-one-identity-broker:${{ needs.goreleaser.outputs.tag }}
${{ env.REGISTRY }}/sycatims/sycat-one-identity-broker:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
# - name: Tell gromit about new build
# id: gromit
# run: |
# # Remember to remove the true when TD-626 is fixed
# curl -fsSL -H "Authorization: ${{secrets.GROMIT_TOKEN}}" 'https://domu-kun.cloud.tyk.io/gromit/newbuild' \
# -X POST -d '{ "repo": "${{ github.repository}}", "ref": "${{ github.ref }}", "sha": "${{ github.sha }}" }' || true
#
smoke-tests:
if: startsWith(github.ref, 'refs/tags') && !github.event.pull_request.draft
needs:
- goreleaser
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Run tests
shell: bash
run: |
set -eaxo pipefail
if [ ! -d smoke-tests ]; then
echo "::warning No repo specific smoke tests defined"
fi
if [ ! -d ci/tests ]; then
echo "::warning No ci tests defined"
exit 0
fi
for d in ci/tests/*/
do
echo Attempting to test $d
if [ -d $d ] && [ -e $d/test.sh ]; then
cd $d
./test.sh ${{ needs.goreleaser.outputs.tag }}
cd -
fi
done
for d in smoke-tests/*/
do
echo Attempting to test $d
if [ -d $d ] && [ -e $d/test.sh ]; then
cd $d
./test.sh ${{ needs.goreleaser.outputs.tag }}
cd -
fi
done