This repository has been archived by the owner on Nov 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rockcraft.yaml
59 lines (53 loc) · 1.67 KB
/
rockcraft.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
name: magma-orc8r-nms-magmalte
version: "1.8.0"
base: ubuntu:22.04
summary: Magma Orchestrator NMS Magmalte
description: Magma Orcestrator NMS Magmalte
license: Apache-2.0
platforms:
amd64:
services:
nms:
override: replace
command: yarn run start:prod
environment:
PORT: 8080
HOST: 0.0.0.0
MYSQL_DIALECT: postgres
MYSQL_PASS: password
MYSQL_USER: username
MYSQL_DB: magma
MYSQL_PORT: 5432
MYSQL_HOST: postgres_container
parts:
magma-nms-magmalte:
plugin: nil
source: https://github.com/magma/magma
source-type: git
source-tag: v1.8.0
build-environment:
- PUPPETEER_SKIP_DOWNLOAD: "true"
build-snaps:
- node/16/stable
stage-packages:
- busybox
override-build: |
set -x
curl -s https://nodejs.org/dist/v16.14.1/node-v16.14.1-linux-x64.tar.gz | tar xzf - -C ${CRAFT_PART_INSTALL}/ --no-same-owner --strip-components=1
npm install --global yarn
# Install dependencies
mkdir -p ${CRAFT_PART_INSTALL}/usr/local/bin/
cp ${CRAFT_PART_SRC}/nms/wait-for-it.sh ${CRAFT_PART_INSTALL}/usr/local/bin/
cp ${CRAFT_PART_SRC}/nms/package.json ${CRAFT_PART_SRC}/nms/yarn.lock ${CRAFT_PART_SRC}/nms/babel.config.js ${CRAFT_PART_INSTALL}/
cd ${CRAFT_PART_INSTALL}/
yarn install --mutex network --frozen-lockfile
yarn cache clean
# Build
cp -rf ${CRAFT_PART_SRC}/nms/* ${CRAFT_PART_INSTALL}/
cd ${CRAFT_PART_INSTALL}/
yarn run build
override-stage: |
set -x
npm install yarn --global
ln -s ${CRAFT_PART_INSTALL}/node_modules/yarn/bin/yarn ${CRAFT_PART_INSTALL}/usr/local/bin/yarn
craftctl default