@@ -2,32 +2,17 @@ DOCKER_OWNER=gremlin
22DOCKER_NAME =gremlin-python-api
33DOCKER_IMAGE =$(DOCKER_OWNER ) /$(DOCKER_NAME )
44
5- MAJOR_VERSION_FILE =docker-build-major-version.txt
6- MINOR_VERSION_FILE =docker-build-minor-version.txt
7- BUILD_VERSION_FILE =docker-build-version.txt
8- BUILD_VERSION =$(shell cat $(MAJOR_VERSION_FILE ) ) .$(shell cat $(MINOR_VERSION_FILE ) )
95BUILD_DATE =$(shell date -u +'% Y-% m-% dT% H:% M:% SZ')
10-
11- KUBECTL_VERSION =$(shell curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)
12-
136ENV_VARS =env.vars
147
15- all : docker-build # docker-push
8+ all : docker-build
169
17- docker-build : $(MINOR_VERSION_FILE )
18- BUILD_VERSION=$(shell cat $(MAJOR_VERSION_FILE ) ) .$(shell cat $(MINOR_VERSION_FILE ) )
10+ docker-build :
1911 docker build --no-cache=true \
2012 --build-arg BUILD_DATE=$(BUILD_DATE ) \
2113 --build-arg IMAGE_NAME=$(DOCKER_IMAGE ) \
22- --build-arg KUBECTL_VERSION=$(KUBECTL_VERSION ) \
23- -t $(DOCKER_IMAGE ) :$(BUILD_VERSION ) \
2414 -t $(DOCKER_IMAGE ) :latest \
2515 .
26- echo ${BUILD_VERSION} > $(BUILD_VERSION_FILE )
27-
28- docker-push :
29- docker push $(DOCKER_IMAGE ) :$(BUILD_VERSION )
30- docker push $(DOCKER_IMAGE ) :latest
3116
3217docker-run :
3318 @if ! test -f $(ENV_VARS ) ; then touch $(ENV_VARS ) ; fi
@@ -38,13 +23,3 @@ docker-run-interactive:
3823 @if ! test -f $(ENV_VARS ) ; then touch $(ENV_VARS ) ; fi
3924 docker run -it --rm -v ~ /.ssh/:/root/.ssh --mount type=bind,source=" $( PWD) " ,target=/opt/gremlin-python \
4025 --env-file=env.vars --name $(DOCKER_NAME ) --entrypoint " /bin/ash" $(DOCKER_IMAGE ) :latest
41-
42- $(MAJOR_VERSION_FILE ) :
43- @if ! test -f $(MAJOR_VERSION_FILE ) ; then echo 0 > $(MAJOR_VERSION_FILE ) ; fi
44- @echo $$(($$(shell cat $(MAJOR_VERSION_FILE ) ) + 1 ) ) > $(MAJOR_VERSION_FILE )
45- @echo $$(($$(shell cat $(MAJOR_VERSION_FILE ) ) .$(shell cat $(MINOR_VERSION_FILE ) ) ) ) > $(BUILD_VERSION_FILE )
46-
47- $(MINOR_VERSION_FILE ) :
48- @if ! test -f $(MINOR_VERSION_FILE ) ; then echo 0 > $(MINOR_VERSION_FILE ) ; fi
49- @echo $$(($$(shell cat $(MINOR_VERSION_FILE ) ) + 1 ) ) > $(MINOR_VERSION_FILE )
50- @echo $$(($$(shell cat $(MAJOR_VERSION_FILE ) ) .$(shell cat $(MINOR_VERSION_FILE ) ) ) ) > $(BUILD_VERSION_FILE )
0 commit comments