This repository has been archived by the owner on Mar 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
snapcraft.yaml
81 lines (74 loc) · 1.96 KB
/
snapcraft.yaml
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: <name>-device-config
version: "0.1"
summary: Ubuntu Device Configuration
description: |
Device configuration for Ubuntu Core.
confinement: strict
grade: stable
base: core18
plugs:
web-resources:
interface: content
target: $SNAP/static/custom
# this privileged interface for factory reset
# boot-config:
# interface: system-files
# write:
# - /var/lib/snapd/hostfs/boot/grub/grubenv
apps:
run:
command: bin/run
daemon: simple
plugs:
- network
- network-bind
- network-setup-control
- time-control
- timeserver-control
- timezone-control
- system-observe
# - snapd-control # this privileged interface for proxy setting
# - boot-config # this privileged interface for factory reset
# - shutdown # this privileged interface for factory reset
parts:
react:
plugin: nil
source: .
override-build: |
# Install node and npm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
export NVM_DIR="$HOME/.nvm"
. "$NVM_DIR/nvm.sh"
. "$NVM_DIR/bash_completion"
nvm install lts/*
nvm run node --version
cd webapp
npm install --unsafe-perm
npm run build
mkdir -p $SNAPCRAFT_PART_INSTALL/static/
cp -r build/static/css $SNAPCRAFT_PART_INSTALL/static/
cp -r build/static/js $SNAPCRAFT_PART_INSTALL/static/
cp -r build/static/images $SNAPCRAFT_PART_INSTALL/static/
cp -r build/static/custom $SNAPCRAFT_PART_INSTALL/static/
cp build/* $SNAPCRAFT_PART_INSTALL/static/ || :
build-packages:
- curl
- python-minimal
- python-dev
application:
plugin: go
source: .
source-type: git
build-packages:
- gcc
bin:
source: snap/local
plugin: dump
organize:
"*": bin/
# this is need for factory reset
# grub:
# plugin: nil
# stage-packages:
# - to amd64:
# - grub-common