|
1 |
| -# Import the cloudposse/build-harness |
2 |
| -include $(shell curl -sSL -o .build-harness "https://git.io/build-harness"; echo .build-harness) |
3 |
| --include tasks/Makefile.* |
| 1 | +export DOCKER_ORG ?= cloudposse |
| 2 | +export DOCKER_IMAGE ?= $(DOCKER_ORG)/reference-architectures |
| 3 | +export DOCKER_TAG ?= latest |
| 4 | +export DOCKER_IMAGE_NAME ?= $(DOCKER_IMAGE):$(DOCKER_TAG) |
| 5 | +export APP_NAME ?= geodesic.sh |
| 6 | +GEODESIC_INSTALL_PATH ?= /usr/local/bin |
| 7 | +export INSTALL_PATH ?= $(GEODESIC_INSTALL_PATH) |
| 8 | +export SCRIPT = $(INSTALL_PATH)/$(APP_NAME) |
4 | 9 |
|
5 | 10 | # The target called when calling `make` with no arguments
|
6 | 11 | export DEFAULT_HELP_TARGET = help/short
|
7 | 12 |
|
| 13 | +# Import the cloudposse/build-harness |
| 14 | +-include $(shell curl -sSL -o .build-harness "https://git.io/build-harness"; echo .build-harness) |
| 15 | + |
| 16 | +## Initialize build-harness, install deps, build docker container, install wrapper script and run shell |
| 17 | +all: init deps build install run |
| 18 | + @exit 0 |
| 19 | + |
| 20 | +## Install dependencies (if any) |
| 21 | +deps: |
| 22 | + @exit 0 |
| 23 | + |
| 24 | +## Build docker image |
| 25 | +build: |
| 26 | + @make --no-print-directory docker/build |
| 27 | + |
| 28 | +## Push docker image to registry |
| 29 | +push: |
| 30 | + docker push $(DOCKER_IMAGE) |
| 31 | + |
| 32 | +## Install wrapper script from geodesic container |
| 33 | +install: |
| 34 | + @docker run --rm $(DOCKER_IMAGE_NAME) | bash -s $(DOCKER_TAG) || (echo "Try: sudo make install"; exit 1) |
| 35 | + |
| 36 | +## Start the geodesic shell by calling wrapper script |
| 37 | +run: |
| 38 | + $(SCRIPT) |
0 commit comments