mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-08 03:30:51 +01:00
75 lines
2.2 KiB
Makefile
75 lines
2.2 KiB
Makefile
|
# Makefile for a harbor project
|
||
|
#
|
||
|
# Targets:
|
||
|
#
|
||
|
# build: build harbor ubuntu images
|
||
|
# clean: clean ui and jobservice harbor images
|
||
|
|
||
|
# common
|
||
|
SHELL := /bin/bash
|
||
|
BUILDPATH=$(CURDIR)
|
||
|
DEPLOYPATH=$(BUILDPATH)/make
|
||
|
DEPLOYDEVPATH=$(DEPLOYPATH)/dev
|
||
|
SRCPATH=./src
|
||
|
TOOLSPATH=$(BUILDPATH)/tools
|
||
|
CHECKENVCMD=checkenv.sh
|
||
|
|
||
|
# docker parameters
|
||
|
DOCKERCMD=$(shell which docker)
|
||
|
DOCKERBUILD=$(DOCKERCMD) build
|
||
|
DOCKERRMIMAGE=$(DOCKERCMD) rmi
|
||
|
DOCKERIMASES=$(DOCKERCMD) images
|
||
|
|
||
|
# binary
|
||
|
UISOURCECODE=$(SRCPATH)/ui
|
||
|
UIBINARYPATH=$(DEPLOYDEVPATH)/ui
|
||
|
UIBINARYNAME=harbor_ui
|
||
|
JOBSERVICESOURCECODE=$(SRCPATH)/jobservice
|
||
|
JOBSERVICEBINARYPATH=$(DEPLOYDEVPATH)/jobservice
|
||
|
JOBSERVICEBINARYNAME=harbor_jobservice
|
||
|
|
||
|
# ubuntu dockerfile
|
||
|
DOCKERFILEPATH=$(DEPLOYPATH)/ubuntu
|
||
|
DOCKERFILEPATH_UI=$(DOCKERFILEPATH)/ui
|
||
|
DOCKERFILENAME_UI=Dockerfile
|
||
|
DOCKERIMAGENAME_UI=vmware/harbor-ui
|
||
|
DOCKERFILEPATH_JOBSERVICE=$(DOCKERFILEPATH)/jobservice
|
||
|
DOCKERFILENAME_JOBSERVICE=Dockerfile
|
||
|
DOCKERIMAGENAME_JOBSERVICE=vmware/harbor-jobservice
|
||
|
DOCKERFILEPATH_LOG=$(DOCKERFILEPATH)/log
|
||
|
DOCKERFILENAME_LOG=Dockerfile
|
||
|
DOCKERIMAGENAME_LOG=vmware/harbor-log
|
||
|
|
||
|
# version prepare
|
||
|
VERSIONFILEPATH=$(SRCPATH)/views/sections
|
||
|
VERSIONFILENAME=header-content.htm
|
||
|
GITCMD=$(shell which git)
|
||
|
GITTAG=$(GITCMD) describe --tags
|
||
|
VERSIONTAG=$(shell $(GITTAG))
|
||
|
|
||
|
check_environment:
|
||
|
@$(TOOLSPATH)/$(CHECKENVCMD)
|
||
|
|
||
|
build:
|
||
|
@echo "building ui container for ubuntu..."
|
||
|
$(DOCKERBUILD) -f $(DOCKERFILEPATH_UI)/$(DOCKERFILENAME_UI) -t $(DOCKERIMAGENAME_UI):$(VERSIONTAG) .
|
||
|
@echo "Done."
|
||
|
|
||
|
@echo "building jobservice container for ubuntu..."
|
||
|
$(DOCKERBUILD) -f $(DOCKERFILEPATH_JOBSERVICE)/$(DOCKERFILENAME_JOBSERVICE) -t $(DOCKERIMAGENAME_JOBSERVICE):$(VERSIONTAG) .
|
||
|
@echo "Done."
|
||
|
|
||
|
@echo "building log container for ubuntu..."
|
||
|
$(DOCKERBUILD) -f $(DOCKERFILEPATH_LOG)/$(DOCKERFILENAME_LOG) -t $(DOCKERIMAGENAME_LOG):$(VERSIONTAG) .
|
||
|
@echo "Done."
|
||
|
|
||
|
cleanimage:
|
||
|
@echo "cleaning image for ubuntu..."
|
||
|
- $(DOCKERRMIMAGE) -f $(DOCKERIMAGENAME_UI):$(VERSIONTAG)
|
||
|
- $(DOCKERRMIMAGE) -f $(DOCKERIMAGENAME_JOBSERVICE):$(VERSIONTAG)
|
||
|
- $(DOCKERRMIMAGE) -f $(DOCKERIMAGENAME_LOG):$(VERSIONTAG)
|
||
|
|
||
|
.PHONY: clean
|
||
|
clean: cleanimage
|
||
|
|