-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathprep-sources
executable file
·55 lines (48 loc) · 1.17 KB
/
prep-sources
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
#!/bin/bash
#
# Build UI with npm
# Requires:
# - libpam0g-dev on Ubuntu
# - pam-devel on Fedora
#
# Exit 1 on error
set -xe
# Prepare dist
mkdir -p dist
#
# Clean old versions
#
rm -rf dist/ui.tar.gz
rm -rf dist/api
rm -rf dist/tasks
#
# Build UI
#
pushd ui
buildah build --force-rm --layers --jobs "$(nproc)" --tag nethesis/nethvoice-report-ui
ui_container="$(podman run --rm -d nethesis/nethvoice-report-ui:latest tail -f /dev/null)"
podman cp "$ui_container":/app/dist dist
podman stop -t 0 "$ui_container"
tar cvzf ui.tar.gz -C dist .
cp ui.tar.gz ../dist/
popd
#
# Build API
#
pushd api
buildah build --force-rm --layers --jobs "$(nproc)" --tag nethesis/nethvoice-report-api
api_container="$(podman run --rm -d nethesis/nethvoice-report-api:latest tail -f /dev/null)"
podman cp "$api_container":/app/api api
podman stop -t 0 "$api_container"
cp api ../dist/
popd
#
# Build Tasks
#
pushd tasks
buildah build --force-rm --layers --jobs "$(nproc)" --tag nethesis/nethvoice-report-tasks
tasks_container="$(podman run --rm -d nethesis/nethvoice-report-tasks:latest tail -f /dev/null)"
podman cp "$tasks_container":/app/tasks tasks
podman stop -t 0 "$tasks_container"
cp tasks ../dist/
popd