From 35959335cfc2fccb8c4fe4e70cad2717620cbf79 Mon Sep 17 00:00:00 2001 From: 030 Date: Sat, 27 Apr 2024 15:24:13 +0200 Subject: [PATCH] fix: [#571] Upload docker images --- .github/workflows/dip.yml | 2 +- .github/workflows/docker.yml | 7 ++++- .github/workflows/dockerhub.yml | 2 +- .github/workflows/go.yml | 8 +++-- .github/workflows/golang.yml | 2 +- .github/workflows/integration.yml | 2 +- .github/workflows/release.yml | 6 ++-- .github/workflows/snapcraft.yml | 2 +- .github/workflows/yamllint.yml | 2 +- docs/quickstarts/DOCKER.md | 29 ++----------------- .../snippets/n3dr/docker/CONFIG_REPOSITORY.md | 11 +++++++ .../n3dr/docker/CONFIG_REPOSITORY_DEST.md | 11 +++++++ .../n3dr/docker/POPULATE_ARTIFACTS.md | 13 +++++++++ 13 files changed, 58 insertions(+), 39 deletions(-) create mode 100644 docs/quickstarts/snippets/n3dr/docker/CONFIG_REPOSITORY.md create mode 100644 docs/quickstarts/snippets/n3dr/docker/CONFIG_REPOSITORY_DEST.md create mode 100644 docs/quickstarts/snippets/n3dr/docker/POPULATE_ARTIFACTS.md diff --git a/.github/workflows/dip.yml b/.github/workflows/dip.yml index 27ad51db..a0aff2a4 100644 --- a/.github/workflows/dip.yml +++ b/.github/workflows/dip.yml @@ -5,7 +5,7 @@ name: DIP - cron: '35 21 25 * *' jobs: dip: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 name: Check whether images are up-to-date steps: - uses: actions/checkout@v4.1.4 diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index d64d6ad2..0a9bd98c 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,6 +1,11 @@ --- name: Docker -'on': push +'on': + # required by gomod-go-version-updater to trigger this action once pr has + # been reviewed + pull_request_review: + types: [submitted] + push: jobs: mcvs-docker-action: runs-on: ubuntu-20.04 diff --git a/.github/workflows/dockerhub.yml b/.github/workflows/dockerhub.yml index 2b8f78c4..3484d661 100644 --- a/.github/workflows/dockerhub.yml +++ b/.github/workflows/dockerhub.yml @@ -6,7 +6,7 @@ name: Dockerhub - '*' jobs: release: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - name: Set up QEMU uses: docker/setup-qemu-action@v3.0.0 diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 5ba4a07c..7ed8e294 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -10,11 +10,11 @@ jobs: strategy: matrix: include: - - os: macos-latest + - os: macos-14 shasum: shasum -a 512 - - os: ubuntu-latest + - os: ubuntu-20.04 shasum: sha512sum - - os: windows-latest + - os: windows-2019 shasum: sha512sum steps: - uses: actions/checkout@v4.1.4 @@ -33,8 +33,10 @@ jobs: if: ${{ startsWith(matrix.os, 'ubuntu') }} - uses: codecov/codecov-action@v4.3.0 with: + fail_ci_if_error: true files: ./coverage.txt flags: unittests + token: ${{ secrets.CODECOV_TOKEN }} verbose: true if: ${{ startsWith(matrix.os, 'ubuntu') }} - name: SonarCloud Scan diff --git a/.github/workflows/golang.yml b/.github/workflows/golang.yml index 37088838..b1f7fc9d 100644 --- a/.github/workflows/golang.yml +++ b/.github/workflows/golang.yml @@ -1,5 +1,5 @@ --- -name: golang +name: Golang 'on': # required by gomod-go-version-updater to trigger this action once pr has # been reviewed diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 71e3d8b4..49d62531 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -6,7 +6,7 @@ name: Integration - dependabot/** jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v4.1.4 - uses: actions/setup-go@v5.0.0 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 312df75c..83bacb17 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,11 +8,11 @@ jobs: strategy: matrix: include: - - os: macos-latest + - os: macos-14 shasum: shasum -a 512 - - os: ubuntu-latest + - os: ubuntu-20.04 shasum: sha512sum - - os: windows-latest + - os: windows-2019 shasum: sha512sum steps: - uses: actions/checkout@v4.1.4 diff --git a/.github/workflows/snapcraft.yml b/.github/workflows/snapcraft.yml index 8bf37241..9e469411 100644 --- a/.github/workflows/snapcraft.yml +++ b/.github/workflows/snapcraft.yml @@ -9,7 +9,7 @@ jobs: uses: ./.github/workflows/release.yml snapcraft: needs: [release] - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v4.1.4 with: diff --git a/.github/workflows/yamllint.yml b/.github/workflows/yamllint.yml index 35a6fc38..c8f7c2ae 100644 --- a/.github/workflows/yamllint.yml +++ b/.github/workflows/yamllint.yml @@ -3,7 +3,7 @@ name: Yamllint 'on': push jobs: yamllint: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 container: image: pipelinecomponents/yamllint:0.21.0 env: diff --git a/docs/quickstarts/DOCKER.md b/docs/quickstarts/DOCKER.md index b19b0ce9..28d88306 100644 --- a/docs/quickstarts/DOCKER.md +++ b/docs/quickstarts/DOCKER.md @@ -2,34 +2,11 @@ - [Download N3DR](./snippets/n3dr/DOWNLOAD.md). - [Start a Nexus3 server](./snippets/nexus3/SERVER.md). -- Populate it with artifacts: - -```bash -docker login localhost:8082 \ - -p $(docker exec -it nexus3-n3dr-src cat /nexus-data/admin.password) \ - -u admin && \ -for d in $(seq 5); do - docker_registry_tag=localhost:8082/repository/docker-images/utrecht/n3dr:6.${d}.0 - docker pull "utrecht/n3dr:6.${d}.0" - docker tag "utrecht/n3dr:6.${d}.0" localhost:8082/repository/docker-images/utrecht/n3dr:6.${d}.0 - docker push localhost:8082/repository/docker-images/utrecht/n3dr:6.${d}.0 -done -``` - +- [Create a repository in the Nexus3 server that has just been started](./snippets/n3dr/docker/CONFIG_REPOSITORY.md). +- [Populate it with artifacts](./snippets/n3dr/docker/POPULATE_ARTIFACTS.md). - [Backup all artifacts](./snippets/n3dr/BACKUP.md). - [Start another Nexus3 server](./snippets/nexus3/ANOTHERSERVER.md). -- Create a repository in the other Nexus3 server: - -```bash -./n3dr configRepository \ - -u admin \ - -p $(docker exec -it nexus3-n3dr-dest cat /nexus-data/admin.password) \ - -n localhost:9000 \ - --https=false \ - --configRepoName docker-images \ - --configRepoType docker -``` - +- [Create a repository in the other Nexus3 server](./snippets/n3dr/docker/CONFIG_REPOSITORY_DEST.md). - [Upload the artifacts to the other Nexus3 server](./snippets/n3dr/UPLOAD.md). - [Validate](./snippets/n3dr/VALIDATE.md). - [Cleanup](./snippets/nexus3/CLEANUP.md). diff --git a/docs/quickstarts/snippets/n3dr/docker/CONFIG_REPOSITORY.md b/docs/quickstarts/snippets/n3dr/docker/CONFIG_REPOSITORY.md new file mode 100644 index 00000000..66da7a58 --- /dev/null +++ b/docs/quickstarts/snippets/n3dr/docker/CONFIG_REPOSITORY.md @@ -0,0 +1,11 @@ +# config repository docker + +```bash +./n3dr configRepository \ + -u admin \ + -p $(docker exec -it nexus3-n3dr-src cat /nexus-data/admin.password) \ + -n localhost:8081 \ + --https=false \ + --configRepoName docker-images \ + --configRepoType docker +``` diff --git a/docs/quickstarts/snippets/n3dr/docker/CONFIG_REPOSITORY_DEST.md b/docs/quickstarts/snippets/n3dr/docker/CONFIG_REPOSITORY_DEST.md new file mode 100644 index 00000000..572ace38 --- /dev/null +++ b/docs/quickstarts/snippets/n3dr/docker/CONFIG_REPOSITORY_DEST.md @@ -0,0 +1,11 @@ +# config repository docker dest + +```bash +./n3dr configRepository \ + -u admin \ + -p $(docker exec -it nexus3-n3dr-dest cat /nexus-data/admin.password) \ + -n localhost:9000 \ + --https=false \ + --configRepoName docker-images \ + --configRepoType docker +``` diff --git a/docs/quickstarts/snippets/n3dr/docker/POPULATE_ARTIFACTS.md b/docs/quickstarts/snippets/n3dr/docker/POPULATE_ARTIFACTS.md new file mode 100644 index 00000000..7d333758 --- /dev/null +++ b/docs/quickstarts/snippets/n3dr/docker/POPULATE_ARTIFACTS.md @@ -0,0 +1,13 @@ +# populate artifacts + +```bash +docker login localhost:8082 \ + -p $(docker exec -it nexus3-n3dr-src cat /nexus-data/admin.password) \ + -u admin && \ +for d in $(seq 5); do + docker_registry_tag=localhost:8082/repository/docker-images/utrecht/n3dr:6.${d}.0 + docker pull "utrecht/n3dr:6.${d}.0" + docker tag "utrecht/n3dr:6.${d}.0" localhost:8082/repository/docker-images/utrecht/n3dr:6.${d}.0 + docker push localhost:8082/repository/docker-images/utrecht/n3dr:6.${d}.0 +done +```