Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: First pass at a tutorial #120

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 36 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,34 @@
include ./scripts/init.mk
include ./scripts/test.mk

# This dependency list means that `make build` will only rebuild if
# any of the Dockerfiles in the `infrastructure/images` directory are
# newer than a timestamp file we leave under tmp/. We're looking for
# 'Dockerfile*' so that, for instance, `Dockerfile.test` is spotted
SOURCES:=$(shell find infrastructure/images -name 'Dockerfile*') docker-compose.yaml

# Example targets are: dependencies, build, publish, deploy, clean, etc.

dependencies: # Install dependencies needed to build and test the project
# TODO: Implement installation of your project dependencies

build: # Build the project artefact
# TODO: Implement the artefact build step
tmp/build_timestamp: $(SOURCES)
make _project name="build"
mkdir -p tmp
touch tmp/build_timestamp

build: tmp/build_timestamp # Build the project for local execution

up: build # Run your code
make _project name="up"

publish: # Publish the project artefact
down: # Stop your code
make _project name="down"

sh: up # Get a shell inside your running project, running it first if necessary
make _project name="sh"

zpublish: # Publish the project artefact
# TODO: Implement the artefact publishing step

deploy: # Deploy the project artefact to the target environment
Expand All @@ -28,9 +47,23 @@ config:: # Configure development environment
python-install \
terraform-install

_project:
set -e
SCRIPT="./scripts/projecthooks/${name}.sh"
if [ -e "$${SCRIPT}" ]; then
exec $$SCRIPT
else
echo "make ${name} not implemented: $${SCRIPT} not found" >&2
fi

.SILENT: \
_project \
build \
clean \
config \
dependencies \
deploy \
down \
sh \
tmp/build_timestamp \
up \
9 changes: 9 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This file is for you! Edit it as you wish.
version: "3.8"

services:
# This service is an example. Remove and edit for your own purposes.
web:
image: nginx
ports:
- "8080:80"
Loading