forked from thorjealousy/midgard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.cicd
20 lines (15 loc) · 823 Bytes
/
Makefile.cicd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
BRANCH=$(shell git rev-parse --abbrev-ref HEAD | sed 's/master/mocknet/g')
GITREF=$(shell git rev-parse --short HEAD)
# pull branch name from CI, if available
ifdef CI_COMMIT_BRANCH
BRANCH=$(shell echo ${CI_COMMIT_BRANCH} | sed 's/master/mocknet/g')
endif
# -------------------------- Gitlab -------------------------------- #
docker-gitlab-login:
docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
docker-gitlab-push:
docker push registry.gitlab.com/thorchain/midgard:latest
docker push registry.gitlab.com/thorchain/midgard:${BRANCH}
docker-gitlab-build:
docker build -t registry.gitlab.com/thorchain/midgard -t registry.gitlab.com/thorchain/midgard:${BRANCH} -t registry.gitlab.com/thorchain/midgard:${GITREF} .
# ------------------------------------------------------------------ #