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
/
Copy pathrockcraft.yaml
87 lines (78 loc) · 3.07 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: magma-orc8r-controller
summary: Magma Orchestrator Controller
description: |
Magma's Orchestrator is a centralized controller for a set of networks. Orchestrator handles the
control plane for various types of gateways in Magma.
version: "1.8.0"
license: Apache-2.0
base: ubuntu:22.04
platforms:
amd64:
cmd: ["orchestrator", "-run_echo_server=true", "-logtostderr=true", "-v=0"]
env:
- DATABASE_SOURCE: f"dbname=magma user=username password=password host=127.0.0.1 sslmode=disable"
- SQL_DRIVER: postgres
- SQL_DIALECT: psql
- SERVICE_HOSTNAME: magma-orc8r-orchestrator
- SERVICE_REGISTRY_MODE": k8s
- SERVICE_REGISTRY_NAMESPACE": namespace
parts:
orchestrator:
plugin: go
source: https://github.com/magma/magma/
source-type: git
source-tag: v1.8.0
source-subdir: orc8r/cloud/go
build-snaps:
- go
configs:
plugin: dump
source: https://github.com/magma/magma/
source-type: git
source-tag: v1.8.0
source-subdir: orc8r/cloud/
organize:
configs: etc/magma/configs/orc8r/
stage:
- etc/magma/configs/orc8r/
swagger-ui:
plugin: dump
source: https://github.com/swagger-api/swagger-ui/archive/v3.52.2.zip
source-type: zip
organize:
swagger-ui-3.52.2/dist/: var/opt/magma/static/swagger-ui/dist/
stage:
- var/opt/magma/static/swagger-ui/
swagger:
plugin: nil
after:
- orchestrator
source: https://github.com/magma/magma/
source-type: git
source-tag: v1.8.0
build-packages:
- apt-transport-https
- gnupg
- curl
- debian-keyring
- debian-archive-keyring
build-snaps:
- go
build-environment:
- MAGMA_ROOT: $CRAFT_PART_SRC
- MAGMA_MODULES: $MAGMA_ROOT/orc8r
override-build: |
set -x
mkdir -p $CRAFT_PART_INSTALL/etc/magma/swagger/ $CRAFT_PART_INSTALL/var/opt/magma/static/swagger/v1/ui/ $CRAFT_PART_INSTALL/var/opt/magma/static/swagger/v1/static/ $CRAFT_PART_INSTALL/var/opt/magma/static/swagger/v1/spec/
rm -rf /usr/share/keyrings/go-swagger-go-swagger-archive-keyring.gpg
rm -rf /etc/apt/sources.list.d/go-swagger-go-swagger.list
curl -1sLf 'https://dl.cloudsmith.io/public/go-swagger/go-swagger/gpg.2F8CB673971B5C9E.key' | gpg --dearmor -o /usr/share/keyrings/go-swagger-go-swagger-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/go-swagger/go-swagger/config.deb.txt?distro=debian&codename=any-version' > /etc/apt/sources.list.d/go-swagger-go-swagger.list
apt update
apt install swagger
cd orc8r/cloud
make swagger
cp -r $CRAFT_PART_SRC/orc8r/cloud/swagger/ $CRAFT_PART_INSTALL/etc/magma/
cp $CRAFT_PART_SRC/orc8r/cloud/go/services/obsidian/swagger/v1/index.html $CRAFT_PART_INSTALL/var/opt/magma/static/swagger/v1/ui/index.html
cp $CRAFT_PART_SRC/orc8r/cloud/go/services/obsidian/swagger/v1/css/sidebar.css $CRAFT_PART_INSTALL/var/opt/magma/static/swagger/v1/static/sidebar.css
cp $CRAFT_PART_SRC/orc8r/cloud/go/services/obsidian/swagger/v1/swagger.yml $CRAFT_PART_INSTALL/var/opt/magma/static/swagger/v1/spec/swagger.yml