-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrockcraft.yaml
74 lines (66 loc) · 1.71 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
name: kratos
base: bare
build-base: ubuntu:22.04
version: "1.0.0"
summary: Ory Kratos identity server
description: |
Ory Kratos is an Identity and User Management system.
license: Apache-2.0
run-user: _daemon_
platforms:
amd64:
environment:
TMPDIR: /
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
- coreutils
shell:
plugin: nil
stage-packages:
# This is needed to pipe the stdout/stderr to a file for log forwarding
- dash
certificates:
plugin: nil
stage-packages:
- ca-certificates
sed:
plugin: nil
stage-packages:
- sed
find:
plugin: nil
stage-packages:
- findutils
prime:
- usr/bin/find
kratos:
plugin: go
build-snaps:
- go/1.19/stable
build-environment:
- CGO_ENABLED: 0
source: https://github.com/ory/kratos
source-type: git
source-tag: v1.0.0
override-build: |
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)"
go mod download
go build -ldflags="${go_linker_flags}" -o ${CRAFT_PART_INSTALL}/bin/kratos
stage-packages:
- ca-certificates_data