From 9a72ca4623bc5c637dae8ac81f0a0dc0ffafb144 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joan=20L=C3=B3pez=20de=20la=20Franca=20Beltran?= Date: Mon, 27 May 2024 23:14:09 +0200 Subject: [PATCH] Automate Docker images build & push --- .github/workflows/docker.yml | 38 +++++++++++++++++++++++++ testenv/docker/krb5kdc-older/Dockerfile | 2 +- testenv/docker/krbhttp/Dockerfile | 1 - 3 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/docker.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..8b0d6a1 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,38 @@ +name: Build and publish Docker images + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + build-and-publish: + runs-on: ubuntu-latest + strategy: + matrix: + pair: + - { dir: 'dns', tag: 'dns' } + - { dir: 'krb5kdc', tag: 'kdc-centos-default' } + - { dir: 'krb5kdc-latest', tag: 'kdc-latest' } + - { dir: 'krb5kdc-older', tag: 'kdc-older' } + - { dir: 'krb5kdc-res', tag: 'kdc-resdom' } + - { dir: 'krb5kdc-shorttickets', tag: 'kdc-shorttickets' } + - { dir: 'krb5kdc-sub', tag: 'kdc-sub' } + - { dir: 'krbhttp', tag: 'http' } + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Build Docker image + run: | + docker build -t ghcr.io/grafana/gokrb5-test:${{ matrix.pair.tag }} testenv/docker/${{ matrix.pair.dir }} + - name: Log in to GitHub Container Registry + if: github.event_name == 'push' && github.ref == 'refs/heads/master' + run: | + echo "${{ secrets.GITHUB_TOKEN }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin + - name: Push Docker image + if: github.event_name == 'push' && github.ref == 'refs/heads/master' + run: | + docker push ghcr.io/grafana/gokrb5-test:${{ matrix.pair.tag }} \ No newline at end of file diff --git a/testenv/docker/krb5kdc-older/Dockerfile b/testenv/docker/krb5kdc-older/Dockerfile index 7db9e6d..91e6a78 100644 --- a/testenv/docker/krb5kdc-older/Dockerfile +++ b/testenv/docker/krb5kdc-older/Dockerfile @@ -17,7 +17,7 @@ RUN yum install -y \ ADD krb5-1.6.3.tar.gz /tmp RUN cd /tmp/krb5-1.6.3/src && \ - ./configure && make && make install + ./configure && make CFLAGS="-fgnu89-inline" && make install ADD krb5.conf /etc/krb5.conf ADD kdc.conf /usr/local/var/krb5kdc/kdc.conf diff --git a/testenv/docker/krbhttp/Dockerfile b/testenv/docker/krbhttp/Dockerfile index 3eab261..fdbbfa7 100644 --- a/testenv/docker/krbhttp/Dockerfile +++ b/testenv/docker/krbhttp/Dockerfile @@ -13,7 +13,6 @@ RUN cd /etc/yum.repos.d/ \ RUN yum install -y \ httpd \ - mod_auth_kerb \ mod_auth_gssapi \ mod_session \ mod_ssl \