forked from controlplaneio/simulator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
50 lines (39 loc) · 1.3 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
42
43
44
45
46
47
48
49
NAME := simulator
CONTAINER_BASE_NAME := simulator-attack
GITHUB_ORG := controlplaneio
DOCKER_HUB_ORG ?= controlplane
VERSION := 0.1-dev
LOCAL_DEV_SIMULATION := $(abspath ../simulation-scripts/scenario/etcd-inverted-wedge)
include ../prelude.mk
.DEFAULT_GOAL := help
.PHONY: all
all: test
# --- DOCKER
.PHONY: docker-run
docker-run: docker-test ## Runs the attack container
docker run \
-h attack \
-v $(LOCAL_DEV_SIMULATION)/tasks.yaml:/tasks.yaml \
--rm --init -it $(CONTAINER_NAME_LATEST) \
bash
.PHONY: docker-build
docker-build: ## Builds the attack container
@docker build -f Dockerfile -t $(CONTAINER_NAME_LATEST) ..
.PHONY: docker-test
docker-test: docker-build ## Run the attack container tests
@docker run \
--rm -t $(CONTAINER_NAME_LATEST) \
goss validate
.PHONY: docker-push
docker-push: docker-test ## pushes the last build docker image
@echo "+ $@"
docker push "${CONTAINER_NAME}"
#docker push "${CONTAINER_NAME_LATEST}"
release: docker-build
ifndef RELEASE_TAG
$(error RELEASE_TAG is undefined)
endif
docker tag $(CONTAINER_NAME_LATEST) $(DOCKER_HUB_ORG)/simulator-attack:$(RELEASE_TAG)
docker push $(DOCKER_HUB_ORG)/simulator-attack:$(RELEASE_TAG)
docker tag $(CONTAINER_NAME_LATEST) $(DOCKER_HUB_ORG)/simulator-attack:latest
docker push $(DOCKER_HUB_ORG)/simulator-attack:latest