Skip to content

Commit

Permalink
v2.10.1 test
Browse files Browse the repository at this point in the history
  • Loading branch information
sbaedev committed Jun 25, 2024
1 parent f18a7ee commit 9d34cb2
Show file tree
Hide file tree
Showing 2 changed files with 126 additions and 134 deletions.
256 changes: 124 additions & 132 deletions .github/workflows/harbor-multi-arch-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,13 @@ jobs:
fail-fast: false
matrix:
component:
- chartserver
- trivy-adapter
- core
- db
- exporter
- jobservice
- log
- nginx
- notary-server
- notary-signer
- portal
- prepare
- redis
Expand Down Expand Up @@ -101,10 +98,8 @@ jobs:
- log
- nginx
- registryctl
- notary
- trivy_adapter
- redis
- chart_server
- standalone_db_migrator
- exporter

Expand Down Expand Up @@ -167,7 +162,6 @@ jobs:
core) make compile_core ${CTX} ;;
jobservice) make compile_jobservice ${CTX};;
registryctl) make compile_registryctl ${CTX};;
notary*) make compile_notary_migrate_patch ${CTX} ;;
standalone_db_migrator) make compile_standalone_db_migrator ${CTX} ;;
esac;
Expand All @@ -177,129 +171,127 @@ jobs:
*) make build BUILDTARGET="_build_${{ matrix.component }}" ${CTX} ;;
esac;
harbor-building:
needs:
- 'docker-image'

runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
fail-fast: false

defaults:
run:
working-directory: ./

steps:
- uses: actions/checkout@v4
with:
submodules: true

- uses: actions/setup-go@v5
with:
go-version: '^1.20.x'

- uses: docker/setup-qemu-action@v3

- uses: docker/setup-buildx-action@v3
with:
driver: docker-container
driver-opts: network=host

- run: make patch

- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- id: prepare
run: echo "tag=$(cat ./version)" >> $GITHUB_ENV

- name: Load remote Docker images
run: |
load_remote_image() {
image_name="$1"
docker pull --platform=linux/arm64 "ghcr.io/${{ github.repository }}/$image_name:${{ env.tag }}"
}
images=(
"harbor-log"
"harbor-exporter"
"harbor-db"
"harbor-jobservice"
"harbor-registryctl"
"harbor-portal"
"harbor-core"
"nginx-photon"
"redis-photon"
"trivy-adapter-photon"
"registry-photon"
"prepare"
"notary-server-photon"
"notary-signer-photon"
"chartmuseum-photon"
)
for image in "${images[@]}"; do
load_remote_image "$image"
done
- name: Retag Docker images
run: |
retag_image() {
image_name="$1"
docker tag "ghcr.io/${{ github.repository }}/$image_name:${{ env.tag }}" "goharbor/$image_name:${{ env.tag }}"
}
images=(
"harbor-log"
"harbor-exporter"
"harbor-db"
"harbor-jobservice"
"harbor-registryctl"
"harbor-portal"
"harbor-core"
"nginx-photon"
"redis-photon"
"trivy-adapter-photon"
"registry-photon"
"prepare"
"notary-server-photon"
"notary-signer-photon"
"chartmuseum-photon"
)
for image in "${images[@]}"; do
retag_image "$image"
done
- name: Docker packaging Offline installer
env:
version: ${{ env.tag }}
run: |
# Run the 'package_offline' command in ./harbor/Makefile
cd ./harbor
sed -i 's/package_offline: update_prepare_version compile build/package_offline: update_prepare_version/' Makefile
sed -i 's/PKGVERSIONTAG=dev/PKGVERSIONTAG='"${version}"'-arm64/' Makefile
sed -i 's/VERSIONTAG=dev/VERSIONTAG='"${version}"'/' Makefile
sed -i 's/TRIVYFLAG=false/TRIVYFLAG=true/' Makefile
sed -i 's/NOTARYFLAG=false/NOTARYFLAG=true/' Makefile
sed -i 's/CHARTFLAG=false/CHARTFLAG=true/' Makefile
make package_offline
- name: Synology Upload Action
uses: bungabear/synology_upload_action@v1.0.0
with:
host: ${{ secrets.NAS_DOMAIN }}
username: ${{ secrets.NAS_ID }}
password: ${{ secrets.NAS_PW }}
filepath: ./harbor/harbor-offline-installer-${{ env.tag }}-arm64.tgz
uploadpath: ${{ secrets.NAS_PATH }}
filename: harbor-offline-installer-${{ env.tag }}-arm64.tgz
overwrite: true
createparent: true
# harbor-building:
# needs:
# - 'docker-image'

# runs-on: ubuntu-latest
# permissions:
# contents: read
# packages: write
# strategy:
# fail-fast: false

# defaults:
# run:
# working-directory: ./

# steps:
# - uses: actions/checkout@v4
# with:
# submodules: true

# - uses: actions/setup-go@v5
# with:
# go-version: '^1.20.x'

# - uses: docker/setup-qemu-action@v3

# - uses: docker/setup-buildx-action@v3
# with:
# driver: docker-container
# driver-opts: network=host

# - run: make patch

# - uses: docker/login-action@v3
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}

# - id: prepare
# run: echo "tag=$(cat ./version)" >> $GITHUB_ENV

# - name: Load remote Docker images
# run: |
# load_remote_image() {
# image_name="$1"
# docker pull --platform=linux/arm64 "ghcr.io/${{ github.repository }}/$image_name:${{ env.tag }}"
# }

# images=(
# "harbor-log"
# "harbor-exporter"
# "harbor-db"
# "harbor-jobservice"
# "harbor-registryctl"
# "harbor-portal"
# "harbor-core"
# "nginx-photon"
# "redis-photon"
# "trivy-adapter-photon"
# "registry-photon"
# "prepare"
# "notary-server-photon"
# "notary-signer-photon"
# "chartmuseum-photon"
# )

# for image in "${images[@]}"; do
# load_remote_image "$image"
# done

# - name: Retag Docker images
# run: |
# retag_image() {
# image_name="$1"
# docker tag "ghcr.io/${{ github.repository }}/$image_name:${{ env.tag }}" "goharbor/$image_name:${{ env.tag }}"
# }

# images=(
# "harbor-log"
# "harbor-exporter"
# "harbor-db"
# "harbor-jobservice"
# "harbor-registryctl"
# "harbor-portal"
# "harbor-core"
# "nginx-photon"
# "redis-photon"
# "trivy-adapter-photon"
# "registry-photon"
# "prepare"
# "notary-server-photon"
# "notary-signer-photon"
# "chartmuseum-photon"
# )

# for image in "${images[@]}"; do
# retag_image "$image"
# done

# - name: Docker packaging Offline installer
# env:
# version: ${{ env.tag }}
# run: |
# # Run the 'package_offline' command in ./harbor/Makefile
# cd ./harbor
# sed -i 's/package_offline: update_prepare_version compile build/package_offline: update_prepare_version/' Makefile
# sed -i 's/PKGVERSIONTAG=dev/PKGVERSIONTAG='"${version}"'-arm64/' Makefile
# sed -i 's/VERSIONTAG=dev/VERSIONTAG='"${version}"'/' Makefile
# sed -i 's/TRIVYFLAG=false/TRIVYFLAG=true/' Makefile

# make package_offline

# - name: Synology Upload Action
# uses: bungabear/synology_upload_action@v1.0.0
# with:
# host: ${{ secrets.NAS_DOMAIN }}
# username: ${{ secrets.NAS_ID }}
# password: ${{ secrets.NAS_PW }}
# filepath: ./harbor/harbor-offline-installer-${{ env.tag }}-arm64.tgz
# uploadpath: ${{ secrets.NAS_PATH }}
# filename: harbor-offline-installer-${{ env.tag }}-arm64.tgz
# overwrite: true
# createparent: true
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ dep:

patch:
bash -c "git clone --branch $(VERSION) https://github.com/goharbor/harbor.git"
bash -c "cp -r template/harbor/v2.7.4/Makefile harbor/Makefile"
bash -c "cp -r template/harbor/v2.7.4/make/photon/* harbor/make/photon/"
bash -c "cp -r template/harbor/$(VERSION)/Makefile harbor/Makefile"
bash -c "cp -r template/harbor/$(VERSION)/make/photon/* harbor/make/photon/"
# cd harbor && sh -c "curl https://github.com/goharbor/harbor/compare/$(VERSION)...morlay:patch-$(CHK_VERSION).patch | git apply -v"

0 comments on commit 9d34cb2

Please sign in to comment.