forked from Hubs-Foundation/hubs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplan.sh
48 lines (38 loc) · 1.27 KB
/
plan.sh
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
pkg_name=hubs
pkg_origin=mozillareality
pkg_maintainer="Mozilla Mixed Reality <[email protected]>"
pkg_version="1.0.0"
pkg_license=('MPLv2')
pkg_description="Duck-powered web-based social VR."
pkg_upstream_url="https://hubs.mozilla.com/"
pkg_build_deps=(
core/coreutils
core/bash
core/node10/10.16.1/20190801173856 # Latest node10 fails during npm ci due to a permissions error creating tmp dir
core/git
)
pkg_deps=(
core/aws-cli/1.16.118/20190305224525 # AWS cli used for run hook when uploading to S3
)
do_build() {
ln -s "$(hab pkg path core/coreutils)/bin/env" /usr/bin/env
# main client
npm ci --verbose --no-progress
# We inject a random token into the build for the base assets path
export BASE_ASSETS_PATH="$(echo "base_assets_path" | sha256sum | cut -d' ' -f1)/" # HACK need a trailing slash so webpack'ed semantics line up
export BUILD_VERSION="${pkg_version}.$(echo $pkg_prefix | cut -d '/' -f 7)"
npm run build
# admin
cd admin
npm ci --verbose --no-progress
npm run build
cp -R dist/* ../dist # it will get packaged with the rest of the stuff, below
cd ..
mkdir -p dist/pages
mv dist/*.html dist/pages
mv dist/hub.service.js dist/pages
mv dist/schema.toml dist/pages
}
do_install() {
cp -R dist "${pkg_prefix}"
}