-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathMakefile
41 lines (32 loc) · 1.54 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
OWNER = boozallen
REPO = sdp-images
IMAGE = jenkins
VERSION = dcar-2.1
JENKINS_VERSION=2.289.2
REGISTRY = docker.pkg.github.com/$(OWNER)/$(REPO)
TAG = $(REGISTRY)/$(IMAGE):$(VERSION)
.PHONY: help Makefile
.ONESHELL: push
# Put it first so that "make" without argument is like "make help".
help: ## Show target options
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
build: ## build container image
docker build . -t $(TAG)
push: ## builds and publishes container image
$(eval user := $(shell read -p "GitHub Username: " username; echo $$username))
$(eval pass := $(shell read -s -r -p "GitHub Token: " token; echo $$token))
@echo
@docker login $(REGISTRY) -u $(user) -p $(pass);
make build
docker push $(TAG)
build-dep: ## build container dependencies
$(eval dir := $(shell pwd))
docker run --user root -it -v $(dir)/prebuild:/var/jenkins_home/tmp jenkins/jenkins:${JENKINS_VERSION}-lts /var/jenkins_home/tmp/pull-plugins.sh
docker run --user root -it -v $(dir)/prebuild:/root/prebuild:z registry.access.redhat.com/ubi8/ubi:8.3 /root/prebuild/pull-from-centos.sh
docker run --user root -it -v $(dir)/prebuild:/root/prebuild:z registry.access.redhat.com/ubi8/ubi:8.3 /root/prebuild/build-dep.sh
info:
@echo "$(TAG) -> $$(dirname $$(git ls-files --full-name Makefile))"
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
echo "Make command $@ not found"