|
1 | 1 | REPO_ROOT=$(git rev-parse --show-toplevel) |
2 | 2 | (cd $REPO_ROOT && go install ./utils/cmd/...) |
3 | 3 |
|
| 4 | +mkdir -p pki |
| 5 | +echo '*' >>./pki/.gitignore |
| 6 | + |
4 | 7 | function cleanup() { |
5 | | - set +e |
| 8 | + set +e |
6 | 9 |
|
7 | | - pkill -P $$ |
| 10 | + pkill -P $$ |
8 | 11 |
|
9 | | - if [ -f "docker-compose.yaml" ]; then |
10 | | - docker compose down -t 1 || : |
11 | | - docker compose rm -f || : |
12 | | - fi |
| 12 | + if [ -f "docker-compose.yaml" ]; then |
| 13 | + docker compose down -t 1 || : |
| 14 | + docker compose rm -f || : |
| 15 | + fi |
13 | 16 | } |
14 | 17 |
|
15 | 18 | trap cleanup EXIT SIGINT |
16 | 19 |
|
17 | 20 | function build_anubis_ko() { |
18 | | - ( |
19 | | - cd $REPO_ROOT && npm ci && npm run assets |
20 | | - ) |
21 | | - ( |
22 | | - cd $REPO_ROOT && |
23 | | - VERSION=devel ko build \ |
24 | | - --platform=all \ |
25 | | - --base-import-paths \ |
26 | | - --tags="latest" \ |
27 | | - --image-user=1000 \ |
28 | | - --image-annotation="" \ |
29 | | - --image-label="" \ |
30 | | - ./cmd/anubis \ |
31 | | - --local |
32 | | - ) |
| 21 | + ( |
| 22 | + cd $REPO_ROOT && npm ci && npm run assets |
| 23 | + ) |
| 24 | + ( |
| 25 | + cd $REPO_ROOT && |
| 26 | + VERSION=devel ko build \ |
| 27 | + --platform=all \ |
| 28 | + --base-import-paths \ |
| 29 | + --tags="latest" \ |
| 30 | + --image-user=1000 \ |
| 31 | + --image-annotation="" \ |
| 32 | + --image-label="" \ |
| 33 | + ./cmd/anubis \ |
| 34 | + --local |
| 35 | + ) |
33 | 36 | } |
34 | 37 |
|
35 | 38 | function mint_cert() { |
36 | | - if [ "$#" -ne 1 ]; then |
37 | | - echo "Usage: mint_cert <domain.name>" |
38 | | - fi |
39 | | - |
40 | | - domainName="$1" |
41 | | - |
42 | | - # If the transient local TLS certificate doesn't exist, mint a new one |
43 | | - if [ ! -f "${REPO_ROOT}/test/pki/${domainName}/cert.pem" ]; then |
44 | | - # Subshell to contain the directory change |
45 | | - ( |
46 | | - cd ${REPO_ROOT}/test/pki && |
47 | | - mkdir -p "${domainName}" && |
48 | | - go tool minica -domains "${domainName}" && |
49 | | - cd "${domainName}" && |
50 | | - chmod 666 * |
51 | | - ) |
52 | | - fi |
| 39 | + if [ "$#" -ne 1 ]; then |
| 40 | + echo "Usage: mint_cert <domain.name>" |
| 41 | + fi |
| 42 | + |
| 43 | + domainName="$1" |
| 44 | + |
| 45 | + # If the transient local TLS certificate doesn't exist, mint a new one |
| 46 | + if [ ! -f "./pki/${domainName}/cert.pem" ]; then |
| 47 | + # Subshell to contain the directory change |
| 48 | + ( |
| 49 | + cd ./pki && |
| 50 | + mkdir -p "${domainName}" && |
| 51 | + go tool minica -domains "${domainName}" && |
| 52 | + cd "${domainName}" && |
| 53 | + chmod 666 * |
| 54 | + ) |
| 55 | + fi |
53 | 56 | } |
0 commit comments