-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/full-traceback-in-raw' of github.com:minvws/nl-…
…kat-coordination into feature/full-traceback-in-raw
- Loading branch information
Showing
24 changed files
with
249 additions
and
244 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ concurrency: | |
cancel-in-progress: true | ||
|
||
on: | ||
create: | ||
push: | ||
tags: | ||
- v* | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,94 +1,82 @@ | ||
SHELL := bash | ||
.ONESHELL: | ||
.NOTPARALLEL: | ||
|
||
# use HIDE to run commands invisibly, unless VERBOSE defined | ||
HIDE:=$(if $(VERBOSE),,@) | ||
UNAME := $(shell uname) | ||
|
||
.PHONY: kat rebuild update clean migrate build itest debian-build-image ubuntu-build-image | ||
.PHONY: $(MAKECMDGOALS) | ||
|
||
# Export Docker buildkit options | ||
export DOCKER_BUILDKIT=1 | ||
export COMPOSE_DOCKER_CLI_BUILD=1 | ||
|
||
kat: env-if-empty clean # This should give you a clean install | ||
make build | ||
make up | ||
# Build and bring up all containers (default target) | ||
kat: env-if-empty build up | ||
|
||
rebuild: clean | ||
make build | ||
make up | ||
# Update using git pull and bring up containers | ||
update: pull kat | ||
|
||
update: down pull | ||
make build | ||
make up | ||
|
||
clean: down # This should clean up all persistent data | ||
-docker volume rm nl-kat-coordination_postgres-data nl-kat-coordination_bytes-data nl-kat-coordination_xtdb-data | ||
|
||
export version | ||
|
||
upgrade: fetch down # Upgrade to the latest release without losing persistent data. Usage: `make upgrade version=v1.5.0` (version is optional) | ||
ifeq ($(version),) | ||
version=$(shell curl --silent "https://api.github.com/repos/minvws/nl-kat-coordination/tags" | jq -r '.[].name' | grep -v "rc" | head -n 1) | ||
make upgrade version=$$version | ||
else | ||
make checkout branch=$(version) | ||
make build-all | ||
make up | ||
endif | ||
|
||
reset: | ||
-docker-compose down --remove-orphans --volumes --timeout 0 | ||
make up | ||
make -C boefjes build | ||
make -C rocky almost-flush | ||
# Bring down containers, remove all volumes, and bring them up again | ||
reset: clean kat | ||
|
||
# Bring up containers | ||
up: | ||
docker-compose up -d --force-recreate | ||
docker-compose up --detach | ||
|
||
# Bring down containers without data loss | ||
down: | ||
-docker-compose down | ||
|
||
# Bring down containers and remove all volumes | ||
clean: | ||
-docker-compose down --timeout 0 --volumes --remove-orphans | ||
|
||
# Fetch the latest changes from the Git remote | ||
fetch: | ||
-git fetch | ||
git fetch --all --prune --tags | ||
|
||
# Pull the latest changes from the default upstream | ||
pull: | ||
-git pull | ||
git pull | ||
|
||
# Upgrade to the latest release without losing persistent data. Usage: `make upgrade version=v1.5.0` (version is optional) | ||
VERSION?=$(shell curl -sSf "https://api.github.com/repos/minvws/nl-kat-coordination/tags" | jq -r '[.[].name | select(. | contains("rc") | not)][0]') | ||
upgrade: down fetch | ||
git checkout $(VERSION) | ||
make kat | ||
|
||
# Create .env file only if it does not exist | ||
env-if-empty: | ||
ifeq ("$(wildcard .env)","") | ||
make env | ||
endif | ||
|
||
env: # Create .env file from the env-dist with randomly generated credentials from vars annotated by "{%EXAMPLE_VAR}" | ||
$(HIDE) cp .env-dist .env | ||
# Create .env file from the env-dist with randomly generated credentials from vars annotated by "{%EXAMPLE_VAR}" | ||
env: | ||
cp .env-dist .env | ||
echo "Initializing .env with random credentials" | ||
ifeq ($(UNAME), Darwin) # Different sed on MacOS | ||
$(HIDE) grep -o "{%\([_A-Z]*\)}" .env-dist | sort -u | while read v; do sed -i '' "s/$$v/$$(openssl rand -hex 25)/g" .env; done | ||
else | ||
$(HIDE) grep -o "{%\([_A-Z]*\)}" .env-dist | sort -u | while read v; do sed -i "s/$$v/$$(openssl rand -hex 25)/g" .env; done | ||
endif | ||
|
||
checkout: # Usage: `make checkout branch=develop` | ||
-git checkout $(branch) | ||
|
||
pull-reset: | ||
-git reset --hard HEAD | ||
-git pull | ||
|
||
build-all: # Build should prepare all other services: migrate them, seed them, etc. | ||
ifeq ($(UNAME), Darwin) | ||
docker-compose build --build-arg USER_UID="$$(id -u)" | ||
# Build will prepare all services: migrate them, seed them, etc. | ||
build: | ||
ifeq ($(UNAME),Darwin) | ||
docker-compose build --pull --parallel --build-arg USER_UID="$$(id -u)" | ||
else | ||
docker-compose build --build-arg USER_UID="$$(id -u)" --build-arg USER_GID="$$(id -g)" | ||
docker-compose build --pull --parallel --build-arg USER_UID="$$(id -u)" --build-arg USER_GID="$$(id -g)" | ||
endif | ||
|
||
build: build-all | ||
make -C rocky build | ||
make -C boefjes build | ||
|
||
# Build Debian build image | ||
debian-build-image: | ||
docker build -t kat-debian-build-image packaging/debian | ||
|
||
# Build Ubuntu build image | ||
ubuntu-build-image: | ||
docker build -t kat-ubuntu-build-image packaging/ubuntu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.