From 0e1a35a91cdd3ca9b1180f3bdc0e749b97fa5b83 Mon Sep 17 00:00:00 2001 From: Paul Horton Date: Wed, 5 Apr 2023 14:14:09 +0100 Subject: [PATCH 1/6] feat: add GitHub Workflow to periodically sync the upstream Signed-off-by: Paul Horton --- .github/workflows/sync-upstream.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/sync-upstream.yml diff --git a/.github/workflows/sync-upstream.yml b/.github/workflows/sync-upstream.yml new file mode 100644 index 00000000..3aeb6467 --- /dev/null +++ b/.github/workflows/sync-upstream.yml @@ -0,0 +1,17 @@ +name: Sync Fork + +on: + schedule: + - cron: '0 */5 * * *' # every 5 hours + workflow_dispatch: # on button click + +jobs: + sync: + runs-on: ubuntu-latest + steps: + - uses: tgymnich/fork-sync@v1.8 + with: + token: ${{ secrets.PERSONAL_TOKEN }} + owner: sonatype + base: main + head: main \ No newline at end of file From 8f12b3bcbb8f9ee6539028a8a91db8fa981693a2 Mon Sep 17 00:00:00 2001 From: Paul Horton Date: Thu, 21 Sep 2023 08:33:03 +0100 Subject: [PATCH 2/6] Create docker-image.yml --- .github/workflows/docker-image.yml | 39 ++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/docker-image.yml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 00000000..85cab4a9 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,39 @@ +name: Docker Image CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Determine Version + run: echo "NXRM_VERSION=$(grep release Dockerfile | cut -d "=" -f2 | tr -d '" \')" >> $GITHUB_ENV + + - run: echo "Building NXRM ${{ env.NXRM_VERSION }} for ARM" + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.REGISTRY_USERNAME }} + password: ${{ secrets.REGISTRY_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v4 + with: + context: . + file: ./Dockerfile + platforms: linux/arm64,linux/amd64 + push: true + tags: sonatypecommunity/nexus3:latest , sonatypecommunity/nexus3:${{ env.NXIQ_VERSION }} From d9e68c577bc3176c6a9e42aa048c8a4f02636567 Mon Sep 17 00:00:00 2001 From: Paul Horton Date: Thu, 21 Sep 2023 08:36:16 +0100 Subject: [PATCH 3/6] Update docker-image.yml --- .github/workflows/docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 85cab4a9..0f3938db 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -36,4 +36,4 @@ jobs: file: ./Dockerfile platforms: linux/arm64,linux/amd64 push: true - tags: sonatypecommunity/nexus3:latest , sonatypecommunity/nexus3:${{ env.NXIQ_VERSION }} + tags: sonatypecommunity/nexus3:latest , sonatypecommunity/nexus3:${{ env.NXRM_VERSION }} From e2d8a7e1c0213b010c00b4dabaf5c1e8c445f97e Mon Sep 17 00:00:00 2001 From: Paul Horton Date: Wed, 3 Apr 2024 08:06:37 +0100 Subject: [PATCH 4/6] ci: update to build and publish Java 11 version Signed-off-by: Paul Horton --- .github/workflows/docker-image.yml | 73 ++++++++++++++++-------------- 1 file changed, 40 insertions(+), 33 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 0f3938db..26796bad 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -1,39 +1,46 @@ name: Docker Image CI on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] + push: + branches: ['main'] + pull_request: + branches: ['main'] jobs: + build: + runs-on: ubuntu-latest - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - name: Determine Version - run: echo "NXRM_VERSION=$(grep release Dockerfile | cut -d "=" -f2 | tr -d '" \')" >> $GITHUB_ENV - - - run: echo "Building NXRM ${{ env.NXRM_VERSION }} for ARM" - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{ secrets.REGISTRY_USERNAME }} - password: ${{ secrets.REGISTRY_TOKEN }} - - - name: Build and push - uses: docker/build-push-action@v4 - with: - context: . - file: ./Dockerfile - platforms: linux/arm64,linux/amd64 - push: true - tags: sonatypecommunity/nexus3:latest , sonatypecommunity/nexus3:${{ env.NXRM_VERSION }} + steps: + - uses: actions/checkout@v3 + + - name: Determine Version + run: echo "NXRM_VERSION=$(grep release Dockerfile | cut -d "=" -f2 | tr -d '" \')" >> $GITHUB_ENV + + - run: echo "Building NXRM ${{ env.NXRM_VERSION }} for ARM" + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.REGISTRY_USERNAME }} + password: ${{ secrets.REGISTRY_TOKEN }} + + - name: Build and push Java 8 + uses: docker/build-push-action@v4 + with: + context: . + file: ./Dockerfile + platforms: linux/arm64,linux/amd64 + push: true + tags: sonatypecommunity/nexus3:latest , sonatypecommunity/nexus3:${{ env.NXRM_VERSION }} + + - name: Build and push Java 11 + uses: docker/build-push-action@v4 + with: + context: . + file: ./Dockerfile.java11 + platforms: linux/arm64,linux/amd64 + push: true + tags: sonatypecommunity/nexus3:${{ env.NXRM_VERSION }}-java11 From b0d8dd9e7044d143ad979af3e0d1c3d52470f778 Mon Sep 17 00:00:00 2001 From: Paul Horton Date: Fri, 12 Apr 2024 12:54:57 +0100 Subject: [PATCH 5/6] chore(ci): update actions Signed-off-by: Paul Horton --- .github/workflows/docker-image.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 26796bad..d0482eea 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Determine Version run: echo "NXRM_VERSION=$(grep release Dockerfile | cut -d "=" -f2 | tr -d '" \')" >> $GITHUB_ENV @@ -19,16 +19,16 @@ jobs: - run: echo "Building NXRM ${{ env.NXRM_VERSION }} for ARM" - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Login to Docker Hub - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.REGISTRY_USERNAME }} password: ${{ secrets.REGISTRY_TOKEN }} - name: Build and push Java 8 - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 with: context: . file: ./Dockerfile @@ -37,7 +37,7 @@ jobs: tags: sonatypecommunity/nexus3:latest , sonatypecommunity/nexus3:${{ env.NXRM_VERSION }} - name: Build and push Java 11 - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 with: context: . file: ./Dockerfile.java11 From d2daa5cddec4d99b1fc40bc505aa4c0776fdd768 Mon Sep 17 00:00:00 2001 From: Paul Horton Date: Fri, 12 Apr 2024 13:04:15 +0100 Subject: [PATCH 6/6] resolve depednency Signed-off-by: Paul Horton --- Dockerfile | 52 +++++++++++++++++++++++------------------------ Dockerfile.java11 | 52 +++++++++++++++++++++++------------------------ 2 files changed, 52 insertions(+), 52 deletions(-) diff --git a/Dockerfile b/Dockerfile index a612da0f..edcf3ce9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,26 +15,26 @@ FROM registry.access.redhat.com/ubi8/ubi-minimal LABEL name="Nexus Repository Manager" \ - maintainer="Sonatype " \ - vendor=Sonatype \ - version="3.67.1-01" \ - release="3.67.1" \ - url="https://sonatype.com" \ - summary="The Nexus Repository Manager server \ - with universal support for popular component formats." \ - description="The Nexus Repository Manager server \ - with universal support for popular component formats." \ - run="docker run -d --name NAME \ - -p 8081:8081 \ - IMAGE" \ - stop="docker stop NAME" \ - com.sonatype.license="Apache License, Version 2.0" \ - com.sonatype.name="Nexus Repository Manager base image" \ - io.k8s.description="The Nexus Repository Manager server \ - with universal support for popular component formats." \ - io.k8s.display-name="Nexus Repository Manager" \ - io.openshift.expose-services="8081:8081" \ - io.openshift.tags="Sonatype,Nexus,Repository Manager" + maintainer="Sonatype " \ + vendor=Sonatype \ + version="3.67.1-01" \ + release="3.67.1" \ + url="https://sonatype.com" \ + summary="The Nexus Repository Manager server \ + with universal support for popular component formats." \ + description="The Nexus Repository Manager server \ + with universal support for popular component formats." \ + run="docker run -d --name NAME \ + -p 8081:8081 \ + IMAGE" \ + stop="docker stop NAME" \ + com.sonatype.license="Apache License, Version 2.0" \ + com.sonatype.name="Nexus Repository Manager base image" \ + io.k8s.description="The Nexus Repository Manager server \ + with universal support for popular component formats." \ + io.k8s.display-name="Nexus Repository Manager" \ + io.openshift.expose-services="8081:8081" \ + io.openshift.tags="Sonatype,Nexus,Repository Manager" ARG NEXUS_VERSION=3.67.1-01 ARG JAVA_VERSION=java8 @@ -52,7 +52,7 @@ ENV NEXUS_HOME=${SONATYPE_DIR}/nexus \ # Install Java & tar RUN microdnf update -y \ && microdnf --setopt=install_weak_deps=0 --setopt=tsflags=nodocs install -y \ - java-1.8.0-openjdk-headless tar procps shadow-utils gzip \ + java-1.8.0-openjdk-headless tar procps shadow-utils gzip \ && microdnf clean all \ && groupadd --gid 200 -r nexus \ && useradd --uid 200 -r nexus -g nexus -s /bin/false -d /opt/sonatype/nexus -c 'Nexus Repository Manager user' @@ -74,12 +74,12 @@ RUN curl -L ${NEXUS_DOWNLOAD_URL} --output nexus-${NEXUS_VERSION}-${JAVA_VERSION RUN sed -i '/^-Xms/d;/^-Xmx/d;/^-XX:MaxDirectMemorySize/d' $NEXUS_HOME/bin/nexus.vmoptions RUN echo "#!/bin/bash" >> ${SONATYPE_DIR}/start-nexus-repository-manager.sh \ - && echo "cd /opt/sonatype/nexus" >> ${SONATYPE_DIR}/start-nexus-repository-manager.sh \ - && echo "exec ./bin/nexus run" >> ${SONATYPE_DIR}/start-nexus-repository-manager.sh \ - && chmod a+x ${SONATYPE_DIR}/start-nexus-repository-manager.sh \ - && sed -e '/^nexus-context/ s:$:${NEXUS_CONTEXT}:' -i ${NEXUS_HOME}/etc/nexus-default.properties + && echo "cd /opt/sonatype/nexus" >> ${SONATYPE_DIR}/start-nexus-repository-manager.sh \ + && echo "exec ./bin/nexus run" >> ${SONATYPE_DIR}/start-nexus-repository-manager.sh \ + && chmod a+x ${SONATYPE_DIR}/start-nexus-repository-manager.sh \ + && sed -e '/^nexus-context/ s:$:${NEXUS_CONTEXT}:' -i ${NEXUS_HOME}/etc/nexus-default.properties -RUN microdnf remove -y gzip shadow-utils +#RUN microdnf remove -y gzip shadow-utils VOLUME ${NEXUS_DATA} diff --git a/Dockerfile.java11 b/Dockerfile.java11 index 84ad3ce8..6c6a2c62 100644 --- a/Dockerfile.java11 +++ b/Dockerfile.java11 @@ -15,26 +15,26 @@ FROM registry.access.redhat.com/ubi8/ubi-minimal LABEL name="Nexus Repository Manager" \ - maintainer="Sonatype " \ - vendor=Sonatype \ - version="3.67.1-01" \ - release="3.67.1" \ - url="https://sonatype.com" \ - summary="The Nexus Repository Manager server \ - with universal support for popular component formats." \ - description="The Nexus Repository Manager server \ - with universal support for popular component formats." \ - run="docker run -d --name NAME \ - -p 8081:8081 \ - IMAGE" \ - stop="docker stop NAME" \ - com.sonatype.license="Apache License, Version 2.0" \ - com.sonatype.name="Nexus Repository Manager base image" \ - io.k8s.description="The Nexus Repository Manager server \ - with universal support for popular component formats." \ - io.k8s.display-name="Nexus Repository Manager" \ - io.openshift.expose-services="8081:8081" \ - io.openshift.tags="Sonatype,Nexus,Repository Manager" + maintainer="Sonatype " \ + vendor=Sonatype \ + version="3.67.1-01" \ + release="3.67.1" \ + url="https://sonatype.com" \ + summary="The Nexus Repository Manager server \ + with universal support for popular component formats." \ + description="The Nexus Repository Manager server \ + with universal support for popular component formats." \ + run="docker run -d --name NAME \ + -p 8081:8081 \ + IMAGE" \ + stop="docker stop NAME" \ + com.sonatype.license="Apache License, Version 2.0" \ + com.sonatype.name="Nexus Repository Manager base image" \ + io.k8s.description="The Nexus Repository Manager server \ + with universal support for popular component formats." \ + io.k8s.display-name="Nexus Repository Manager" \ + io.openshift.expose-services="8081:8081" \ + io.openshift.tags="Sonatype,Nexus,Repository Manager" ARG NEXUS_VERSION=3.67.1-01 ARG JAVA_VERSION=java11 @@ -52,7 +52,7 @@ ENV NEXUS_HOME=${SONATYPE_DIR}/nexus \ # Install Java & tar RUN microdnf update -y \ && microdnf --setopt=install_weak_deps=0 --setopt=tsflags=nodocs install -y \ - java-11-openjdk-headless tar procps shadow-utils gzip \ + java-11-openjdk-headless tar procps shadow-utils gzip \ && microdnf clean all \ && groupadd --gid 200 -r nexus \ && useradd --uid 200 -r nexus -g nexus -s /bin/false -d /opt/sonatype/nexus -c 'Nexus Repository Manager user' @@ -74,12 +74,12 @@ RUN curl -L ${NEXUS_DOWNLOAD_URL} --output nexus-${NEXUS_VERSION}-${JAVA_VERSION RUN sed -i '/^-Xms/d;/^-Xmx/d;/^-XX:MaxDirectMemorySize/d' $NEXUS_HOME/bin/nexus.vmoptions RUN echo "#!/bin/bash" >> ${SONATYPE_DIR}/start-nexus-repository-manager.sh \ - && echo "cd /opt/sonatype/nexus" >> ${SONATYPE_DIR}/start-nexus-repository-manager.sh \ - && echo "exec ./bin/nexus run" >> ${SONATYPE_DIR}/start-nexus-repository-manager.sh \ - && chmod a+x ${SONATYPE_DIR}/start-nexus-repository-manager.sh \ - && sed -e '/^nexus-context/ s:$:${NEXUS_CONTEXT}:' -i ${NEXUS_HOME}/etc/nexus-default.properties + && echo "cd /opt/sonatype/nexus" >> ${SONATYPE_DIR}/start-nexus-repository-manager.sh \ + && echo "exec ./bin/nexus run" >> ${SONATYPE_DIR}/start-nexus-repository-manager.sh \ + && chmod a+x ${SONATYPE_DIR}/start-nexus-repository-manager.sh \ + && sed -e '/^nexus-context/ s:$:${NEXUS_CONTEXT}:' -i ${NEXUS_HOME}/etc/nexus-default.properties -RUN microdnf remove -y gzip shadow-utils +# RUN microdnf remove -y gzip shadow-utils VOLUME ${NEXUS_DATA}