forked from aristanetworks/eos-external-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbarney.yaml
137 lines (128 loc) · 4.13 KB
/
barney.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
129
130
131
132
133
134
135
136
137
---
# yamllint disable rule:line-length
generators:
go: barney.ci/golang%generator
images:
internal/alma-9.1-bootstrap:
units:
- image: barney.ci/docker%image/quay.io/almalinuxorg/9-minimal//9.1-20230222
- sources: []
build: |
mkdir -p /dest/etc
touch /dest/etc/resolv.conf
finalizers:
- |
export DNF_HOST="https://artifactory.infra.corp.arista.io/artifactory"
export DNF_ARCH="$(arch)"
export DNF_DISTRO_REPO="alma-vault/9.1"
export DNF_EPEL9_REPO="eext-sources/epel9-frozen-subsets"
export DNF_EPEL9_REPO_VERSION="v20230901-1"
echo '#!/bin/sh
microdnf --assumeyes --installroot=/dest --noplugins --config=/etc/dnf/dnf.conf \
--setopt=cachedir=/var/cache/microdnf --setopt=reposdir=/etc/yum.repos.d \
--setopt=varsdir=/etc/dnf --releasever=9.1 install "$@"
' > /usr/bin/install-rpms
chmod 755 /usr/bin/install-rpms
rm -rf /etc/yum.repos.d
mkdir -p /etc/yum.repos.d
echo "[epel9-subset]
baseurl=${DNF_HOST}/${DNF_EPEL9_REPO}/${DNF_EPEL9_REPO_VERSION}/
enabled=1
gpgcheck=0
" > /etc/yum.repos.d/eext-externaldeps.repo
echo "[BaseOS]
baseurl=${DNF_HOST}/${DNF_DISTRO_REPO}/BaseOS/${DNF_ARCH}/os/
enabled=1
" > /etc/yum.repos.d/BaseOS.repo
echo "[AppStream]
baseurl=${DNF_HOST}/${DNF_DISTRO_REPO}/AppStream/${DNF_ARCH}/os/
exclude=podman
enabled=1
" > /etc/yum.repos.d/AppStream.repo
entry:
share-net: true
mounts:
- source: /etc/resolv.conf
target: /etc/resolv.conf
options: ro,bind
mutables:
- /var/cache
- /var/lib/dnf
base-image:
units:
- floor: .%internal/alma-9.1-bootstrap
sources: []
build: install-rpms automake coreutils git rpm rpmdevtools rpm-build make mock python3-devel quilt
go-binaries:
description: |
This image is a copy of .%go/static, but with /usr/bin
permissions changed to 0555, so that it can combine properly
with redhat-style images.
units:
- mappings:
/src/static: .%go/static
build: |
mkdir -p /dest/usr
cp -a /src/static/usr/bin /dest/usr/bin
chmod 555 /dest/usr/bin
eext:
units:
- image: .%base-image
- image: .%go-binaries
- build: |
mkdir -p $DESTDIR/usr/share/eext
cp -a ./configfiles/* $DESTDIR/usr/share/eext
mkdir -p $DESTDIR/etc/pki/eext
cp -a ./pki/* $DESTDIR/etc/pki/eext
mkdir -p $DESTDIR/etc
touch $DESTDIR/etc/resolv.conf
entry:
mutables: &eext-mutables
- /var/eext
- /var/cache
- /var/lib/mock
- /var/lib/rpm
- /var/tmp
mounts:
- source: /etc/resolv.conf
target: /etc/resolv.conf
options: ro,bind
# We need access to artifactory.infra.corp.arista.io
# to make mock work
share-net: true
eext-testfloor:
units:
- image: .%go/modules
- build: |
mkdir -p /dest/var/cache/go
mkdir -p /dest/var/ext
- floor: .%internal/alma-9.1-bootstrap
sources: []
build: |
install-rpms coreutils rpm rpm-build rpmdevtools automake mock quilt git golang
touch $DESTDIR/etc/resolv.conf
entry:
env:
GOCACHE: /tmp/gocache
GOMODCACHE: /go/pkg/mod
mutables: *eext-mutables
mounts:
- source: /etc/resolv.conf
target: /etc/resolv.conf
options: ro,bind
# We need access to artifactory.infra.corp.arista.io
# to make mock work
share-net: true
test/eext:
units:
- floor: .%eext-testfloor
build: |
go test code.arista.io/eos/tools/eext/...
go test code.arista.io/eos/tools/eext/... -tags privileged
go vet code.arista.io/eos/tools/eext/...
test -z "$(gofmt -l .)"
# go test runs on separate test-floor
# so validate build here
test/eext-build:
units:
- image: .%eext