Skip to content

Commit

Permalink
Healer, heal thyself.
Browse files Browse the repository at this point in the history
- use binary built by goreleaser in container image
  • Loading branch information
alephnull committed Nov 21, 2023
1 parent 205d352 commit 1d30438
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 26 deletions.
27 changes: 14 additions & 13 deletions .github/workflows/doctor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,33 @@ on:
jobs:
doctor:
runs-on: ubuntu-latest
container: tykio/gromit:v1.5
container: tykio/gromit:v1.6
strategy:
fail-fast: false
matrix:
repo: [tyk, tyk-analytics, tyk-pump, tyk-identity-broker, tyk-sink, portal]
branch: [master]
bundle: [releng]
feature: [releng]

steps:
- uses: actions/checkout@v3
- name: checkout repo
uses: actions/checkout@v4
with:
repository: TykTechnologies/${{ matrix.repo }}
token: ${{ secrets.ORG_GH_TOKEN }}
path: ${{ matrix.repo }}
fetch-depth: 1

- name: checkout gromit
uses: actions/checkout@v4
with:
fetch-depth: 1
path: gromit

- name: Generate
run: gromit bundle --bundle ${{ matrix.bundle }} --branch ${{matrix.branch}} --repo ${{ matrix.repo }} gen ${{ matrix.repo }}
run: gromit bundle gen --features ./gromit/policy/templates/${{ matrix.feature }} --branch ${{matrix.branch}} --repo ${{ matrix.repo }} ${{ matrix.repo }}

- name: Check for zero diffs
id: diff
run: |
gromit git diff ${{ matrix.repo }} 2>${{ matrix.repo }}-${{ matrix.bundle }}-${{matrix.branch}}.txt
- name: Check output
if: ${{ always() }}
id: output
run: |
output=$(cat ${{ matrix.repo }}-${{ matrix.bundle }}-${{matrix.branch}}.txt)
echo "::warning::${output}"
op_file=diff.log
gromit git diff ${{ matrix.repo }} >${op_file} 2>&1 || echo "::error title=${{ matrix.repo }} ${{ matrix.feature }} ${{matrix.branch}}::$(cat $op_file)"
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ jobs:
name: Goreleaser
with:
version: latest
args: release --rm-dist ${{ !startsWith(github.ref, 'refs/tags/') && '--snapshot' || '' }}
args: release --clean ${{ !startsWith(github.ref, 'refs/tags/') && '--snapshot' || '' }}
env:
GITHUB_TOKEN: ${{ secrets.ORG_GH_TOKEN }}
1 change: 1 addition & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ dockers:
- "tykio/gromit:v{{ .Major }}.{{ .Minor }}{{.Prerelease}}"
- "tykio/gromit:{{.Tag}}"
use: buildx
dockerfile: Dockerfile
build_flag_templates:
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
Expand Down
14 changes: 2 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,12 @@
FROM golang:1.20 as builder

RUN apt-get update && apt-get install -y unzip
WORKDIR /src/gromit
ADD . .
RUN CGO_ENABLED=0 make gromit

# generate clean image for end users
FROM debian:stable-slim
RUN apt-get update && apt-get dist-upgrade -y git curl
RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg -o /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& apt-get update \
&& apt-get install gh -y
COPY --from=builder /src/gromit/gromit /usr/bin/
COPY gromit /usr/bin/
EXPOSE 443
RUN mkdir /config
VOLUME [ "/config" ]

# executable
ENTRYPOINT [ "gromit" ]
Expand Down

0 comments on commit 1d30438

Please sign in to comment.