-
Notifications
You must be signed in to change notification settings - Fork 1
/
rockcraft.yaml
54 lines (49 loc) · 1.61 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
name: hydra
base: bare
build-base: [email protected]
version: "2.2.0"
summary: Ory Hydra
description: |
Ory Hydra is a hardened and certified OAuth 2.0 and OpenID Connect provider.
license: Apache-2.0
run-user: _daemon_
platforms:
amd64:
services:
hydra:
override: replace
command: hydra serve all
startup: enabled
parts:
certificates:
plugin: nil
stage-packages:
- ca-certificates
hydra:
plugin: go
build-snaps:
- go/1.21/stable
override-build: |
src_config_path="github.com/ory/hydra/v2/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="-w \
-s \
-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)"
export CGO_ENABLED=0
go mod download all
go build -ldflags="${go_linker_flags}" -o "${CRAFT_PART_INSTALL}"/bin/hydra
source: https://github.com/ory/hydra
source-type: git
source-tag: v2.2.0
deb-security-manifest:
plugin: nil
after:
- certificates
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