Skip to content

Commit dff6231

Browse files
committed
build: replace prep & chart justfiles with centralised remote files
1 parent 3cca7b1 commit dff6231

File tree

6 files changed

+17
-443
lines changed

6 files changed

+17
-443
lines changed

Justfile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ mod build 'tasks/build'
2727
mod test 'tasks/test'
2828
mod config 'tasks/config'
2929
mod manage 'tasks/manage'
30-
mod prep 'tasks/prep'
31-
mod chart 'tasks/chart'
3230
mod docs 'tasks/docs'
3331
mod i18n 'tasks/i18n'
3432

@@ -41,6 +39,18 @@ default:
4139
help:
4240
just --justfile {{justfile()}} --list
4341

42+
# Prep module from https://github.com/hotosm/justfiles
43+
prep *args:
44+
@curl -sS https://raw.githubusercontent.com/hotosm/justfiles/main/prep.just \
45+
-o {{justfile_directory()}}/tasks/prep.just;
46+
@just --justfile {{justfile_directory()}}/tasks/prep.just {{args}}
47+
48+
# Chart module from https://github.com/hotosm/justfiles
49+
chart *args:
50+
@curl -sS https://raw.githubusercontent.com/hotosm/justfiles/main/chart.just \
51+
-o {{justfile_directory()}}/tasks/chart.just;
52+
@just --justfile {{justfile_directory()}}/tasks/chart.just --set chart_name "field-tm" {{args}}
53+
4454
# Delete local database, S3, and ODK Central data
4555
clean:
4656
{{docker}} compose down -v

tasks/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Justfiles imported from https://github.com/hotosm/justfiles
2+
*.just

tasks/chart

Lines changed: 0 additions & 195 deletions
This file was deleted.

tasks/config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ generate-dotenv branch="dev":
5959
# By default we deploy from 'dev' branch, but can be overridden
6060

6161
cd {{justfile_directory()}}
62-
just manage _install_envsubst
62+
just prep envsubst
6363

6464
if [ -f .env ]; then
6565
just _echo-yellow "'.env' already exists. Skipping generation."

tasks/manage

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,6 @@
2121
default:
2222
just --justfile {{justfile()}} --list manage
2323

24-
# Install envsubst
25-
[no-cd]
26-
[no-exit-message]
27-
_install_envsubst:
28-
#!/usr/bin/env bash
29-
just prep _curl
30-
31-
echo
32-
# Get a8m/envsubst (required for default vals syntax ${VAR:-default})
33-
# Use local version, as envsubst may be installed on system already
34-
if [ -f ./envsubst ]; then
35-
echo "envsubst already exists. Continuing."
36-
else
37-
echo "Downloading a8m/envsubst"
38-
echo
39-
curl -L "https://github.com/a8m/envsubst/releases/download/v1.2.0/envsubst-$(uname -s)-$(uname -m)" -o envsubst
40-
chmod +x envsubst
41-
fi
42-
4324
# Rename docker volume
4425
[no-cd]
4526
rename-volume oldname newname:
@@ -64,7 +45,7 @@ upgrade-dev-db:
6445

6546
cd {{justfile_directory()}}
6647

67-
just manage _install_envsubst
48+
just prep envsubst
6849

6950
./envsubst -i contrib/pg-upgrade/compose.yaml | \
7051
docker compose -f - up --abort-on-container-failure
@@ -82,7 +63,7 @@ upgrade-db:
8263
GIT_BRANCH="development"
8364
fi
8465

85-
just manage _install_envsubst
66+
just prep envsubst
8667

8768
export VOLUME_NAME=field-tm-db-data-${GIT_BRANCH}
8869

0 commit comments

Comments
 (0)