-
Notifications
You must be signed in to change notification settings - Fork 85
/
.snapcraft.yaml
60 lines (54 loc) · 1.59 KB
/
.snapcraft.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
name: travis-worker
base: core18
version: git
grade: stable
summary: Travis CI worker
description: |-
This snap is for internal use by Travis to run worker nodes.
confinement: strict
apps:
daemon:
command: daemon.start
daemon: simple
plugs:
- lxd
- network
- network-bind
travis-worker:
command: bin/travis-worker
plugs:
- lxd
- network
- network-bind
parts:
travis-worker:
source: .
build-packages:
- gcc
plugin: go
go-packages:
- github.com/travis-ci/worker/cmd/travis-worker
go-importpath: github.com/travis-ci/worker
go-channel: 1.21/stable
prime:
- bin/travis-worker
override-build: |-
set -eux
cd ${SNAPCRAFT_PROJECT_DIR}
VERSION="$(git describe --always --dirty --tags 2>/dev/null)"
REVISION="$(git rev-parse HEAD)"
REVISION_URL="https://github.com/travis-ci/worker/tree/${REVISION}"
GENERATED="$(date -u +'%Y-%m-%dT%H:%M:%S%z')"
COPYRIGHT="$(grep -i ^copyright LICENSE | sed 's/^[Cc]opyright //')"
cd ${SNAPCRAFT_PART_SRC}
sed -i "s#VersionString =.*#VersionString = \"${VERSION}\"#g" version.go
sed -i "s#RevisionString =.*#RevisionString = \"${REVISION}\"#g" version.go
sed -i "s#RevisionURLString =.*#RevisionURLString = \"${REVISION_URL}\"#g" version.go
sed -i "s#GeneratedString =.*#GeneratedString = \"${GENERATED}\"#g" version.go
sed -i "s#CopyrightString =.*#CopyrightString = \"${COPYRIGHT}\"#g" version.go
set +ex
snapcraftctl build
set -ex
wrappers:
plugin: dump
source: .snapcraft/