mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-22 08:38:03 +01:00
feat(cicd) add build date for base images
Signed-off-by: Ziming Zhang <zziming@vmware.com>
This commit is contained in:
parent
9cc7a5547a
commit
3c51ab556e
2
Makefile
2
Makefile
@ -383,7 +383,7 @@ build:
|
|||||||
build_base_docker:
|
build_base_docker:
|
||||||
@for name in chartserver clair clair-adapter trivy-adapter core db jobservice log nginx notary-server notary-signer portal prepare redis registry registryctl; do \
|
@for name in chartserver clair clair-adapter trivy-adapter core db jobservice log nginx notary-server notary-signer portal prepare redis registry registryctl; do \
|
||||||
echo $$name ; \
|
echo $$name ; \
|
||||||
$(DOCKERBUILD) --pull -f $(MAKEFILEPATH_PHOTON)/$$name/Dockerfile.base -t $(BASEIMAGENAMESPACE)/harbor-$$name-base:$(BASEIMAGETAG) . && \
|
$(DOCKERBUILD) --pull -f $(MAKEFILEPATH_PHOTON)/$$name/Dockerfile.base -t $(BASEIMAGENAMESPACE)/harbor-$$name-base:$(BASEIMAGETAG) --label base-build-date=$(date +"%Y%m%d") . && \
|
||||||
$(PUSHSCRIPTPATH)/$(PUSHSCRIPTNAME) $(BASEIMAGENAMESPACE)/harbor-$$name-base:$(BASEIMAGETAG) $(REGISTRYUSER) $(REGISTRYPASSWORD) || exit 1; \
|
$(PUSHSCRIPTPATH)/$(PUSHSCRIPTNAME) $(BASEIMAGENAMESPACE)/harbor-$$name-base:$(BASEIMAGETAG) $(REGISTRYUSER) $(REGISTRYPASSWORD) || exit 1; \
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -138,7 +138,7 @@ function publishImage {
|
|||||||
# rename the images with tag "dev" and push to Docker Hub
|
# rename the images with tag "dev" and push to Docker Hub
|
||||||
docker images
|
docker images
|
||||||
docker login -u $DOCKER_HUB_USERNAME -p $DOCKER_HUB_PASSWORD
|
docker login -u $DOCKER_HUB_USERNAME -p $DOCKER_HUB_PASSWORD
|
||||||
docker images | sed -n "s|\(goharbor/[-._a-z0-9]*\)\s*\(.*$Harbor_Assets_Version\).*|docker tag \1:\2 \1:$image_tag;docker push \1:$image_tag|p" | bash
|
docker images | grep goharbor | grep -v "\-base" | sed -n "s|\(goharbor/[-._a-z0-9]*\)\s*\(.*$Harbor_Assets_Version\).*|docker tag \1:\2 \1:$image_tag;docker push \1:$image_tag|p" | bash
|
||||||
echo "Images are published successfully"
|
echo "Images are published successfully"
|
||||||
docker images
|
docker images
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user