-
Notifications
You must be signed in to change notification settings - Fork 97
Expand file tree
/
Copy pathmelange.yaml
More file actions
160 lines (142 loc) · 4.36 KB
/
Copy pathmelange.yaml
File metadata and controls
160 lines (142 loc) · 4.36 KB
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
package:
name: kotsadm-head
version: "1000.0.0"
epoch: 0
description: KOTS Admin Console for managing Kubernetes Off-The-Shelf software applications v${{vars.major-minor-version}}
copyright:
- license: Apache-2.0
dependencies:
runtime:
- glibc-posix-utils
provides:
- kotsadm=${{package.full-version}}
var-transforms:
- from: ${{package.version}}
match: ^(\d+\.\d+)\.\d+$
replace: "$1"
to: major-minor-version
- from: ${{package.version}}
match: ^(\d+).*
replace: $1
to: major-version
environment:
contents:
repositories:
- https://apk.cve0.io
keyring:
- https://apk.cve0.io/key/cve0-signing.rsa.pub
packages:
- busybox
- build-base
- ca-certificates-bundle
- go
- gcc-15.1
- libgcc
- libstdc++
- libstdc++-dev
- make-bootstrap-4.4
- binutils
- bash
- git
- curl
- nodejs-22.16
- yarn-1.22
- py3.12-dateutil
- py3.12-s3cmd
- schemahero~0.26.1
- wget
environment:
GOPROXY: 'https://proxy.golang.org,direct'
GOSUMDB: 'sum.golang.org'
pipeline:
- uses: git-checkout
with:
repository: https://github.com/replicatedhq/kots
tag: v${{package.version}}
- name: Build kotsadm and kots binaries
runs: |
export PATH="/usr/bin:$PATH"
export GOSUMDB=off
export GOPROXY=direct
export CGO_ENABLED=1
export CC=gcc
export VERSION="${VERSION:-v${{package.version}}}"
export GIT_TAG="${GIT_TAG:-v${{package.version}}}"
mkdir -p ${{targets.destdir}}/usr/bin
mkdir -p ${{targets.destdir}}/scripts
# Copy scripts
cp -r deploy/assets/* ${{targets.destdir}}/scripts/
# Set environment from .image.env (use . instead of source for POSIX compatibility)
. ./.image.env
# Install web dependencies and build
export PACT_SKIP_BINARY_INSTALL=true
cd web
yarn install --production --frozen-lockfile
# Install webpack-cli separately to avoid interactive prompt
yarn add -D webpack-cli
make build-kotsadm
cd ..
# Build binaries
make kots build
# Copy binaries to /usr/local/bin
mkdir -p ${{targets.destdir}}/usr/local/bin
cp bin/kotsadm ${{targets.destdir}}/usr/local/bin/kotsadm
cp bin/kots ${{targets.destdir}}/usr/local/bin/kots
- uses: strip
data:
- name: "Main repository"
items:
version: ${{package.version}}
subpackages:
- name: ${{package.name}}-migrations
description: KOTS Admin Console migration tables and schemahero binary v${{vars.major-minor-version}}
dependencies:
runtime:
- schemahero-rqlite~0.26.1
provides:
- kotsadm-migrations=${{package.full-version}}
pipeline:
- runs: |
export DESTDIR="${{targets.subpkgdir}}"
mkdir -p "${DESTDIR}"
mkdir -p "${DESTDIR}/usr/local/bin"
mv migrations/tables "${DESTDIR}/tables"
cp /usr/bin/schemahero "${DESTDIR}/usr/local/bin/schemahero"
- name: ${{package.name}}-kurl-proxy
description: KOTS kurl-proxy service for managing Kubernetes application deployments v${{vars.major-minor-version}}
dependencies:
provides:
- kurl-proxy=${{package.full-version}}
pipeline:
- runs: |
export PATH="/usr/bin:$PATH"
export GOSUMDB=off
export GOPROXY=direct
export CGO_ENABLED=1
export CC=gcc
mkdir -p ${{targets.subpkgdir}}/usr/local/bin
mkdir -p ${{targets.subpkgdir}}/assets
cp -r kurl_proxy/assets/* ${{targets.subpkgdir}}/assets/
# Build kurl_proxy to /usr/local/bin
cd kurl_proxy
go build -ldflags="-w -s" -o ${{targets.subpkgdir}}/usr/local/bin/kurl_proxy ./cmd
- uses: strip
test:
environment:
contents:
packages:
- kurl-proxy=${{package.full-version}}
pipeline:
- runs: |
# Test that binary exists and is executable as running kurl_proxy
# without a valid KUBERNETES_SERVICE_HOST will cause it to panic
test -x /usr/local/bin/kurl_proxy
test:
environment:
contents:
packages:
- ${{package.name}}=${{package.full-version}}
pipeline:
- runs: |
/usr/local/bin/kotsadm --help
/usr/local/bin/kots --help