From 8b5d2a8546a000e152f54f83967d8e6d1e08e726 Mon Sep 17 00:00:00 2001 From: Mehdi Ben Abdallah Date: Mon, 31 Jan 2022 22:15:15 +0100 Subject: [PATCH] sync missing versions to dockerhub regularly --- .github/workflows/sync_missing_versions.yml | 19 +++++++++++++++++++ Makefile | 7 ++++--- 2 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/sync_missing_versions.yml diff --git a/.github/workflows/sync_missing_versions.yml b/.github/workflows/sync_missing_versions.yml new file mode 100644 index 0000000..67246c7 --- /dev/null +++ b/.github/workflows/sync_missing_versions.yml @@ -0,0 +1,19 @@ +on: + workflow_dispatch: + schedule: + - cron: '0 0 1 * *' # at 00:00 on 1st day of month +jobs: + sync_missing_versions: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Sync missing versions + run: make sync_missing_versions + diff --git a/Makefile b/Makefile index c6f7af1..94f6e9a 100644 --- a/Makefile +++ b/Makefile @@ -47,7 +47,8 @@ sync_missing_versions: NEXT_PAGE=$$(cat $$TMP/page.json | jq -rM '.next'); \ done; \ \ - grep -v -x -f "$$TMP/promtool.tags" "$$TMP/prometheus.tags" > "$$TMP/missing.tags"; \ - grep -v -x -f blacklist.tags "$$TMP/missing.tags" > "$$TMP/filtered_missing.tags"; \ + (grep -v -x -f "$$TMP/promtool.tags" "$$TMP/prometheus.tags" > "$$TMP/missing.tags") || true; \ + (grep -v -x -f blacklist.tags "$$TMP/missing.tags" > "$$TMP/filtered_missing.tags") || true; \ + touch "$$TMP/filtered_missing.tags"; \ cat "$$TMP/filtered_missing.tags" | sort | xargs -I{} -n1 bash -c "make sync PROMTOOL_VERSION={}"; \ - +