From 15fc603f649037211c81af2427669584cfe0d175 Mon Sep 17 00:00:00 2001 From: lza_menace Date: Thu, 12 Oct 2023 14:14:19 -0700 Subject: [PATCH] start publishing container images on push to main --- .github/workflows/publish.yaml | 11 ++++++---- release.sh | 37 +++++++++++++++++++++++++--------- 2 files changed, 34 insertions(+), 14 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index e21b8f1..db9c387 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -5,12 +5,15 @@ on: branches: master jobs: - login: + publish_images: runs-on: ubuntu-latest + name: Publish Docker images to Dockerhub steps: - - - name: Log into Docker Hub + - name: Authenticate to Dockerhub uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} \ No newline at end of file + password: ${{ secrets.DOCKERHUB_TOKEN }} + - build_images: + run: | + bash release.sh diff --git a/release.sh b/release.sh index d7c7b83..02a2abe 100644 --- a/release.sh +++ b/release.sh @@ -1,19 +1,36 @@ #!/bin/bash +# Build and tag container images for all services; monerod, nodemapper, and exporter +# All are manually tagged since some do not update as frequently as others. Bump the script +# to bump the image stored on Dockerhub. + set -ex -TAG="${1}" -BASE=$(echo ${TAG} | cut -d":" -f1) +VERSION="${1}" +DH_USER=lalanza808 +MONERO_VERSION=v0.18.3.1 +MONERO_BASE=${DH_USER}/monerod +EXPORTER_VERSION=1.0.0 +EXPORTER_BASE=${DH_USER}/exporter +NODEMAPPER_VERSION=1.0.0 +NODEMAPPER_BASE=${DH_USER}/nodemapper -if [[ -z "${TAG}" ]]; then - echo "You must specify a container tag. ex: lalanza808/monero:v0.17.1.8" - exit 1 -fi -docker build -t "${TAG}" -f dockerfiles/monero_nocompile . +# build nodemapper +docker build -t "${NODEMAPPER_BASE}:${NODEMAPPER_VERSION}" -f dockerfiles/nodemapper . +docker tag "${NODEMAPPER_BASE}:${NODEMAPPER_VERSION}" "${NODEMAPPER_BASE}:latest" +docker push "${NODEMAPPER_BASE}:${NODEMAPPER_VERSION}" +docker push "${NODEMAPPER_BASE}:latest" -docker tag "${TAG}" "${BASE}:latest" +# build exporter +docker build -t "${EXPORTER_BASE}:${EXPORTER_VERSION}" -f dockerfiles/exporter . +docker tag "${EXPORTER_BASE}:${EXPORTER_VERSION}" "${EXPORTER_BASE}:latest" +docker push "${EXPORTER_BASE}:${EXPORTER_VERSION}" +docker push "${EXPORTER_BASE}:latest" -docker push "${TAG}" +# build monerod -docker push "${BASE}:latest" +docker build -t "${MONERO_BASE}:${MONERO_VERSION}" -f dockerfiles/nodemapper . +docker tag "${MONERO_BASE}:${MONERO_VERSION}" "${MONERO_BASE}:latest" +docker push "${MONERO_BASE}:${MONERO_VERSION}" +docker push "${MONERO_BASE}:latest"