/
snapcraft.yaml
63 lines (60 loc) · 1.46 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
name: lisk-core
summary: Lisk blockchain application platform
description: |
Run lisk-core
adopt-info: lisk-core
architectures: [amd64]
grade: stable
confinement: strict
base: core22
parts:
lisk-core:
build-packages:
- git
- curl
- jq
plugin: nil
build-environment:
- NODE_VERSION: 18.20.2
source: .
override-build: |
export PRV=$(pwd)
export NODE_ARCH=$SNAP_ARCH
if [[ $NODE_ARCH == "amd64" ]] ; then
export NODE_ARCH="x64"
fi
cd /opt
curl -o node.tar.gz https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$NODE_ARCH.tar.gz
tar -zxf node.tar.gz
mv node-v$NODE_VERSION-linux-$NODE_ARCH node
export PATH="/opt/node/bin:$PATH"
cd "$PRV"
snapcraftctl set-version "$(jq -r .version < package.json)"
cd ..
git clone https://github.com/LiskHQ/dev-cli || true
cd dev-cli
npm install --global yarn
npm install --global typescript
yarn
npm run build
cd ../build
npm ci
npm run build
../dev-cli/bin/run pack --targets=linux-x64
cd dist
find . -name \*linux\*.tar.gz -exec cp {} /root/parts/lisk-core/install \;
cd ../../install
tar -zvxf *.tar.gz
rm *.tar.gz
mkdir bin
cp /opt/node/bin/* bin
stage:
- lisk-core/*
- bin/*
apps:
lisk-core:
command: lisk-core/bin/lisk-core
plugs:
- network
- network-bind
- home