-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjustfile
67 lines (55 loc) · 1.8 KB
/
justfile
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
set dotenv-load := true
# List recipes
list:
@just --list --unsorted
# Bring in all changes in submodules
pull-submodules:
git submodule foreach "(git checkout main; git pull origin main)"
just versions
# Show sub-module versions
versions:
@echo "mxm-server = $(cd mxm-server && just version)"
@echo " mxm-ui = $(cd mxm-ui && just version)"
# Prepare using UI version for git commit and tagging, push, ...
prepare_with_ui_version:
#!/bin/bash
version=$(cd mxm-ui && just version)
echo "export MXM_VERSION=$version" > .env
cat .env
# Prepare for git commit and tagging, push, ...
prepare version:
echo "export MXM_VERSION={{version}}" > .env
# TODO(lower prio) recipies to dockerize, push, etc.
# This is done via github actions.
# Full update of this repo
commit-and-push: commit-main-and-push tag-and-push
# Commit and push main branch
commit-main-and-push:
git add -u
git commit -m "build v${MXM_VERSION}"
git push origin main
# Create new tag and push it
tag-and-push force='':
git tag {{force}} v${MXM_VERSION}
git push {{force}} origin v${MXM_VERSION}
# Show latest few tags
tags:
git tag -l | sort -V | tail
# ---------------------------------
# CD recipes.
# Note: CD not triggered from release workflow because there's currently
# no proxy to use our watchtower instance API from external locations.
# Trigger container update on mxm
watchtower-mxm:
#!/bin/bash
if [[ -f ./setenv.sh ]]; then
source ./setenv.sh
fi
if [[ -z "${WATCHTOWER_HTTP_API_TOKEN}" ]]; then
echo "Error: WATCHTOWER_HTTP_API_TOKEN not set."
elif [[ -z "${MXM_WATCHTOWER_ENDPOINT}" ]]; then
echo "Error: MXM_WATCHTOWER_ENDPOINT not set."
else
AUTH="Authorization: Bearer ${WATCHTOWER_HTTP_API_TOKEN}"
curl -H "$AUTH" "${MXM_WATCHTOWER_ENDPOINT}"
fi