-
Notifications
You must be signed in to change notification settings - Fork 1
/
rockcraft.yaml
65 lines (59 loc) · 1.91 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
name: kratos
base: bare
build-base: [email protected]
version: "1.3.1"
summary: Ory Kratos identity server
description: |
Ory Kratos is an Identity and User Management system.
license: Apache-2.0
run-user: _daemon_
platforms:
amd64:
services:
kratos:
override: replace
command: kratos serve all
startup: enabled
parts:
util:
plugin: nil
stage-packages:
# This is needed to pipe the stdout/stderr to a file for log forwarding and to update certificates
- coreutils
shell:
plugin: nil
stage-packages:
# This is needed to pipe the stdout/stderr to a file for log forwarding
- dash
kratos:
plugin: go
build-snaps:
- go/1.23/stable
build-environment:
- CGO_ENABLED: "0"
source: https://github.com/ory/kratos
source-type: git
source-tag: v1.3.1
override-build: |
# Set the necessary flags
src_config_path="github.com/ory/kratos/driver"
build_ver="${src_config_path}/config.Version"
build_hash="${src_config_path}/config.Commit"
build_date="${src_config_path}/config.Date"
go_linker_flags="-s \
-w \
-X ${build_ver}=$(git -C "${CRAFT_PART_SRC}" describe --tags) \
-X ${build_hash}=$(git -C "${CRAFT_PART_SRC}" rev-parse HEAD) \
-X ${build_date}=$(date -u +%Y-%m-%dT%H:%M:%SZ)"
# Build the binary
go mod download
go build -ldflags="${go_linker_flags}" -o ${CRAFT_PART_INSTALL}/bin/kratos
deb-security-manifest:
plugin: nil
after:
- util
- shell
override-prime: |
set -x
mkdir -p $CRAFT_PRIME/usr/share/rocks/
(echo "# os-release" && cat /etc/os-release && echo "# dpkg-query" && dpkg-query --admindir=$CRAFT_PRIME/var/lib/dpkg/ -f '${db:Status-Abbrev},${binary:Package},${Version},${source:Package},${Source:Version}\n' -W) > $CRAFT_PRIME/usr/share/rocks/dpkg.query