From fca44e3bfba10f6962c77585f3d311f085e155c8 Mon Sep 17 00:00:00 2001 From: mrceyhun Date: Thu, 30 Jun 2022 15:50:00 +0200 Subject: [PATCH] Add nats-sub dcoker image gh action --- .github/workflows/build-nats.yml | 47 +++++++++++++++++++++++++++ .github/workflows/build-rucio-mon.yml | 4 +-- README.md | 7 ++-- 3 files changed, 53 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/build-nats.yml diff --git a/.github/workflows/build-nats.yml b/.github/workflows/build-nats.yml new file mode 100644 index 00000000..60cafaaf --- /dev/null +++ b/.github/workflows/build-nats.yml @@ -0,0 +1,47 @@ +name: Build + +on: + push: + tags: + - 'go-*.*.*' + +jobs: + build: + name: Build nats-sub + runs-on: ubuntu-latest + steps: + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: '^1.18' + + - name: Check out code into the Go module directory + uses: actions/checkout@v3 + + - name: Get git tag + id: get_tag + run: echo ::set-output name=tag::${GITHUB_REF/refs\/tags\//} + + - name: Build nats-sub docker image + run: | + echo Image tag: ${{ steps.get_tag.outputs.tag }} + curl -ksLO https://raw.githubusercontent.com/dmwm/CMSKubernetes/master/docker/nats-sub/Dockerfile + sed -i -e "s,ENV CMSMON_TAG=.*,ENV CMSMON_TAG=${{steps.get_tag.outputs.tag}},g" Dockerfile + docker build . --tag docker.pkg.github.com/dmwm/nats-sub/nats-sub + docker tag docker.pkg.github.com/dmwm/nats-sub/nats-sub registry.cern.ch/cmsmonitoring/nats-sub + + - name: Login to registry.cern.ch + uses: docker/login-action@v2 + with: + registry: registry.cern.ch + username: ${{ secrets.CERN_LOGIN }} + password: ${{ secrets.CERN_TOKEN }} + + - name: Publish nats-sub image to registry.cern.ch + uses: docker/build-push-action@v1 + with: + username: ${{ secrets.CERN_LOGIN }} + password: ${{ secrets.CERN_TOKEN }} + registry: registry.cern.ch + repository: cmsmonitoring/nats-sub + tag_with_ref: true diff --git a/.github/workflows/build-rucio-mon.yml b/.github/workflows/build-rucio-mon.yml index b68ddfa5..9cf79e92 100644 --- a/.github/workflows/build-rucio-mon.yml +++ b/.github/workflows/build-rucio-mon.yml @@ -4,9 +4,7 @@ name: Build on: push: tags: - - 'go-*.*.*' - paths: - - 'src/go/rucio-dataset-mon-go/**' + - 'rgo-*.*.*' jobs: build: diff --git a/README.md b/README.md index 0190a280..cfe25ee4 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,14 @@ infrastructure. ### Git Workflows -- On tag `go-*.*.*` +- On tag :whale: `go-*.*.*` :rocket: - Builds go executables and release `cmsmon-tools` - Builds `cmsmonitoring/cmsmonit-int` docker image and push to registry.cern.ch - Builds `cmsmonitoring/cmsmonit-alert` docker image and push to registry.cern.ch -- On tag `sqoop-*.*.*` + - Builds `cmsmonitoring/nats-sub` docker image and push to registry.cern.ch +- On tag :whale: `rgo-*.*.*` :rocket: + - Builds `cmsmonitoring/cmsmon-rucio-ds-web` docker image using `src/go/rucio-dataset-mon-go` +- On tag :whale: `sqoop-*.*.*` :rocket: - Builds `cmsmonitoring/sqoop` docker image and push to registry.cern.ch - Syntax check on special conditions - Check validations of json and yaml files only that kind of files are changed