forked from canonical/rockcraft
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rockcraft.yaml
128 lines (119 loc) · 3.22 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# Run the container:
# docker run --rm -v $PWD:/project \
# --device /dev/fuse \
# --cap-add SYS_ADMIN \
# --security-opt apparmor:unconfined \
# <rock>
name: rockcraft
# Other bases are automatically built by the CI
base: [email protected]
# Until adopt-info is supported, we'll just build dev images based on whatever
# is committed to the main branch
version: "dev"
summary: A Rockcraft rock
description: |
This is a rock that offers Rockcraft's capabilities from inside a container.
The default behavior is to pack a rock in destructive mode.
license: GPL-3.0
platforms:
amd64:
services:
rockcraft:
override: replace
startup: enabled
command: /usr/libexec/rockcraft/rockcraft-entrypoint.sh [ -v ]
working-dir: /workdir
on-success: shutdown
on-failure: shutdown
parts:
rockcraft:
plugin: python
source: .
python-packages:
- wheel
- pip
- setuptools
python-requirements:
- requirements-jammy.txt
- requirements.txt
build-environment:
- "CFLAGS": "$(pkg-config python-3.10 yaml-0.1 --cflags)"
build-attributes:
- enable-patchelf
build-packages:
- libapt-pkg-dev
- aspell
- aspell-en
stage-packages:
- binutils
- snapd
- python3-venv
- fuse-overlayfs
- rsync
- g++
organize:
bin/craftctl: usr/libexec/rockcraft/craftctl
bin/rockcraft: usr/libexec/rockcraft/rockcraft
# The custom script makes sure the build happens in a different path from
# the host's bind mount, to avoid polluting that space.
startup-script:
plugin: dump
source: tools
organize:
rock/rockcraft-entrypoint.sh: usr/libexec/rockcraft/rockcraft-entrypoint.sh
prime:
- usr/libexec/rockcraft/rockcraft-entrypoint.sh
workdirs:
plugin: nil
override-build: |
# This is where Rockcraft projects on the host should be mounted
mkdir -p ${CRAFT_PART_INSTALL}/project
# This is where Rockcraft actually builds the rocks, to avoid polluting
# the host
mkdir -p ${CRAFT_PART_INSTALL}/workdir
umoci:
plugin: make
source: https://github.com/opencontainers/umoci.git
source-tag: v0.4.7
make-parameters:
- umoci.static
override-build: |
make umoci.static
mkdir "$CRAFT_PART_INSTALL"/bin
install -m755 umoci.static "$CRAFT_PART_INSTALL"/bin/umoci
build-packages:
- golang-go
- make
skopeo:
plugin: nil
source: https://github.com/containers/skopeo.git
source-tag: v1.9.0
override-build: |
CGO=1 go build -ldflags -linkmode=external ./cmd/skopeo
mkdir -p "$CRAFT_PART_INSTALL"/bin
install -m755 skopeo "$CRAFT_PART_INSTALL"/bin/skopeo
stage-packages:
- libgpgme11
- libassuan0
- libbtrfs0
- libdevmapper1.02.1
build-attributes:
- enable-patchelf
build-snaps:
- go/1.17/stable
build-packages:
- libgpgme-dev
- libassuan-dev
- libbtrfs-dev
- libdevmapper-dev
- pkg-config
overlay-packages:
- ca-certificates
chisel:
plugin: nil
stage-snaps:
- chisel/latest/candidate
organize:
bin/chisel: usr/libexec/rockcraft/chisel
stage:
- usr/libexec/rockcraft/chisel