-
Notifications
You must be signed in to change notification settings - Fork 34
/
build.yaml
100 lines (92 loc) · 2.89 KB
/
build.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
build-env:
build_only: true
from:
type: docker
url: ${{STACKER_BUILD_BASE_IMAGE}}
imports:
- https://github.com/json-c/json-c/archive/refs/tags/json-c-0.16-20220414.tar.gz
- https://gitlab.com/cryptsetup/cryptsetup/-/archive/v2.6.0/cryptsetup-v2.6.0.tar.gz
- https://github.com/lvmteam/lvm2/archive/refs/tags/v2_03_18.tar.gz
run: |
#!/bin/sh -ex
# libapparmor is only in testing
head -n1 /etc/apk/repositories | sed 's/main/testing/g' >> /etc/apk/repositories
apk add git findutils go automake autoconf make gcc libtool \
acl-dev acl-static build-base \
libseccomp-dev libseccomp-static \
libcap-dev libcap-static \
libapparmor-dev \
zlib-static lz4-static \
zstd-dev zstd-static \
xz \
gettext-dev \
lvm2-dev util-linux-dev \
linux-headers \
util-linux-static \
po4a
# json-c doesn't have static binaries in alpine
apk add cmake
tar -xf /stacker/imports/json-c-*
cd json-c-*
mkdir build
cd build
cmake ..
make -j$(grep -c processor /proc/cpuinfo) install
cd /
# build libdevmapper.a
tar -xf /stacker/imports/v2_03_18.tar.gz
cd lvm2-*
./configure --enable-static_link
make install_device-mapper
cd /
# build static cryptsetup without all the command line tools
apk add gettext gettext-dev zlib-static lz4-static openssl-dev \
openssl-libs-static popt-dev bash
tar -xf /stacker/imports/cryptsetup*
cd cryptsetup*
./autogen.sh
CFLAGS="-D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE" \
./configure --enable-static \
--disable-cryptsetup --disable-veritysetup --disable-integritysetup \
--disable-nls --disable-ssh-token \
--disable-asciidoc
make -j$(grep -c processor /proc/cpuinfo) install
cd /
# build lxc
apk add meson ninja docbook2x docbook2x-doc curl
git clone --depth 1 ${{LXC_CLONE_URL}} -b ${{LXC_BRANCH}}
mkdir /etc/default
cd lxc
meson setup -Dprefix=/usr -Dman=false -Dsd-bus=disabled -Dinit-script=sysvinit build
meson compile -C build
meson install -C build
cd /
# build lzma
git clone -b v5.2.6 https://github.com/xz-mirror/xz.git
cd xz
./autogen.sh
./configure --enable-static --enable-shared --prefix=/usr
make -j$(grep -c processor /proc/cpuinfo) install
cd /
build:
build_only: true
from:
type: built
tag: build-env
binds:
- . -> /stacker-tree
- ${{BUILD_D}} -> /build
run: |
#!/bin/sh -ex
# golang wants somewhere to put its garbage
export HOME=/root
export LXC_VERSION=$(git -C /lxc rev-parse HEAD)
export VERSION_FULL=${{VERSION_FULL}}
cd /stacker-tree
make BUILD_D=/build show-info
make BUILD_D=/build -C cmd/stacker/lxc-wrapper clean
if [ x${{WITH_COV}} = x"yes" ]; then
make BUILD_D=/build stacker-static-cov
else
make -C /stacker-tree stacker-static
fi