mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-18 14:47:38 +01:00
build(gen-apis): fail early for gen apis if build swagger img fail
Signed-off-by: He Weiwei <hweiwei@vmware.com>
This commit is contained in:
parent
1ecc17311c
commit
55df0539ed
4
Makefile
4
Makefile
@ -284,11 +284,11 @@ SWAGGER_IMAGENAME=goharbor/swagger
|
|||||||
SWAGGER_VERSION=v0.21.0
|
SWAGGER_VERSION=v0.21.0
|
||||||
SWAGGER=$(DOCKERCMD) run --rm -u $(shell id -u):$(shell id -g) -v $(BUILDPATH):$(BUILDPATH) -w $(BUILDPATH) ${SWAGGER_IMAGENAME}:${SWAGGER_VERSION}
|
SWAGGER=$(DOCKERCMD) run --rm -u $(shell id -u):$(shell id -g) -v $(BUILDPATH):$(BUILDPATH) -w $(BUILDPATH) ${SWAGGER_IMAGENAME}:${SWAGGER_VERSION}
|
||||||
SWAGGER_GENERATE_SERVER=${SWAGGER} generate server --template-dir=$(TOOLSPATH)/swagger/templates --exclude-main
|
SWAGGER_GENERATE_SERVER=${SWAGGER} generate server --template-dir=$(TOOLSPATH)/swagger/templates --exclude-main
|
||||||
|
SWAAGER_IMAGE_BUILD_CMD=${DOCKERBUILD} -f ${TOOLSPATH}/swagger/Dockerfile --build-arg SWAGGER_VERSION=${SWAGGER_VERSION} -t ${SWAGGER_IMAGENAME}:$(SWAGGER_VERSION) .
|
||||||
|
|
||||||
SWAGGER_IMAGENAME:
|
SWAGGER_IMAGENAME:
|
||||||
@if [ "$(shell ${DOCKERIMASES} -q ${SWAGGER_IMAGENAME}:$(SWAGGER_VERSION) 2> /dev/null)" == "" ]; then \
|
@if [ "$(shell ${DOCKERIMASES} -q ${SWAGGER_IMAGENAME}:$(SWAGGER_VERSION) 2> /dev/null)" == "" ]; then \
|
||||||
${DOCKERBUILD} -f ${TOOLSPATH}/swagger/Dockerfile --build-arg SWAGGER_VERSION=${SWAGGER_VERSION} -t ${SWAGGER_IMAGENAME}:$(SWAGGER_VERSION) . ; \
|
${SWAAGER_IMAGE_BUILD_CMD} && echo "build swagger image successfully" || (echo "build swagger image failed" && exit 1) ; \
|
||||||
echo "build swagger image done"; \
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# $1 the path of swagger spec
|
# $1 the path of swagger spec
|
||||||
|
Loading…
Reference in New Issue
Block a user