mirror of
https://github.com/goharbor/harbor
synced 2025-04-21 23:48:15 +00:00
Fix build base related issues (#14733)
1. Add build base image step in build package git action workflow; 2. Add build base step to UT test in CI, base image used by UI test should be built before building harbor image in the same runtime; 3. In build package workflow, trigger build base image step in condition of changing both in Dockerfile.base and VERSION; 4. Add tag for setup nightly test. Signed-off-by: danfengliu <danfengl@vmware.com>
This commit is contained in:
parent
c701ce09fa
commit
81b26418c1
13
.github/workflows/build-package.yml
vendored
13
.github/workflows/build-package.yml
vendored
@ -45,20 +45,11 @@ jobs:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
path: src/github.com/goharbor/harbor
|
||||
- name: Build Dev Base Image
|
||||
if: contains(steps.changed-files.outputs.modified, 'Dockerfile.base') && contains(github.ref, 'master')
|
||||
- name: Build Base Image
|
||||
if: contains(steps.changed-files.outputs.modified, 'Dockerfile.base') || contains(steps.changed-files.outputs.modified, 'VERSION')
|
||||
run: |
|
||||
set -x
|
||||
base_image_tag=$(cat ./VERSION)
|
||||
echo "Start to build base image for dev ......"
|
||||
cd src/github.com/goharbor/harbor
|
||||
sudo make build_base_docker -e BASEIMAGETAG=$base_image_tag -e REGISTRYUSER="${{ secrets.DOCKER_HUB_USERNAME }}" -e REGISTRYPASSWORD="${{ secrets.DOCKER_HUB_PASSWORD }}" -e PUSHBASEIMAGE=yes
|
||||
- name: Build Release Base Image
|
||||
if: contains(steps.changed-files.outputs.modified, 'VERSION')
|
||||
run: |
|
||||
set -x
|
||||
base_image_tag=$(cat ./VERSION)
|
||||
echo "Start to build base image for release $(base_image_tag) ......"
|
||||
cd src/github.com/goharbor/harbor
|
||||
sudo make build_base_docker -e BASEIMAGETAG=$base_image_tag -e REGISTRYUSER="${{ secrets.DOCKER_HUB_USERNAME }}" -e REGISTRYPASSWORD="${{ secrets.DOCKER_HUB_PASSWORD }}" -e PUSHBASEIMAGE=yes
|
||||
- name: Build Package
|
||||
|
5
Makefile
5
Makefile
@ -94,6 +94,7 @@ VERSIONTAG=dev
|
||||
PUSHBASEIMAGE=
|
||||
BASEIMAGETAG=dev
|
||||
BASEIMAGENAMESPACE=goharbor
|
||||
BUILDBASETARGET=chartserver trivy-adapter core db jobservice log nginx notary-server notary-signer portal prepare redis registry registryctl exporter
|
||||
# for harbor package name
|
||||
PKGVERSIONTAG=dev
|
||||
|
||||
@ -411,7 +412,7 @@ build_base_docker:
|
||||
else \
|
||||
echo "No docker credentials provided, please make sure enough priviledges to access docker hub!" ; \
|
||||
fi
|
||||
@for name in chartserver trivy-adapter core db jobservice log nginx notary-server notary-signer portal prepare redis registry registryctl exporter; do \
|
||||
@for name in $(BUILDBASETARGET); do \
|
||||
echo $$name ; \
|
||||
sleep 30 ; \
|
||||
$(DOCKERBUILD) --pull --no-cache -f $(MAKEFILEPATH_PHOTON)/$$name/Dockerfile.base -t $(BASEIMAGENAMESPACE)/harbor-$$name-base:$(BASEIMAGETAG) --label base-build-date=$(date +"%Y%m%d") . && \
|
||||
@ -421,7 +422,7 @@ build_base_docker:
|
||||
done
|
||||
|
||||
pull_base_docker:
|
||||
@for name in chartserver trivy-adapter core db jobservice log nginx notary-server notary-signer portal prepare redis registry registryctl; do \
|
||||
@for name in $(BUILDBASETARGET); do \
|
||||
echo $$name ; \
|
||||
$(DOCKERPULL) $(BASEIMAGENAMESPACE)/harbor-$$name-base:$(BASEIMAGETAG) ; \
|
||||
done
|
||||
|
@ -21,6 +21,7 @@ sudo rm -rf /data/*
|
||||
sudo -E env "PATH=$PATH" make go_check
|
||||
sudo ./tests/hostcfg.sh
|
||||
sudo ./tests/generateCerts.sh
|
||||
sudo make build_base_docker -e BUILDBASETARGET="db registry prepare"
|
||||
sudo make build -e BUILDTARGET="_build_db _build_registry _build_prepare"
|
||||
docker run --rm -v /:/hostfs:z goharbor/prepare:dev gencert -p /etc/harbor/tls/internal
|
||||
sudo MAKEPATH=$(pwd)/make ./make/prepare
|
||||
|
Loading…
x
Reference in New Issue
Block a user