forked from phsmith/rundeck_exporter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
36 lines (28 loc) · 893 Bytes
/
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
PROJECT_NAME = $(notdir $(PWD))
VERSION = $(shell sed -nr "s/__version__ = '(.*)'/\1/p" rundeck_exporter.py)
.SILENT: push
default: build
build:
docker run --rm -i hadolint/hadolint:latest < Dockerfile
docker build \
--rm \
--network host \
--tag="$(PROJECT_NAME):$(VERSION)" \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg VERSION="$(VERSION)" .
clean:
docker rmi --force $(PROJECT_NAME):$(VERSION)
push:
[ -z "$(git status --short --untracked-files=no)" ] && (echo -e "\nNeed to commit changes before push.\n"; exit 1)
git tag -d latest
git tag latest
git push origin :latest
git tag "v$(VERSION)"
git push --all
debug:
docker run --rm -it $(PROJECT_NAME):$(VERSION) /bin/sh
run:
docker run --rm $(PROJECT_NAME):$(VERSION) \
--host 0.0.0.0 \
--rundeck.skip_ssl