-
Notifications
You must be signed in to change notification settings - Fork 290
/
Copy pathhttp-echo.yaml
51 lines (44 loc) · 1.33 KB
/
http-echo.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
package:
name: http-echo
version: 1.0.0
epoch: 3
description: A tiny go web server that echos what you start it with!
copyright:
- license: MPL-2.0
dependencies:
runtime:
- ca-certificates-bundle
environment:
contents:
packages:
- busybox
- ca-certificates-bundle
- go
environment:
CGO_ENABLED: "0"
pipeline:
- uses: git-checkout
with:
repository: https://github.com/hashicorp/http-echo
tag: v${{package.version}}
expected-commit: 866d8f8313e92d96f940c2f0cf807abe934ab145
- runs: |
# https://github.com/hashicorp/http-echo/blob/f375b4ddff406ff94e661212fea488785ea7f809/Makefile#L50
# https://github.com/hashicorp/http-echo/blob/f375b4ddff406ff94e661212fea488785ea7f809/scripts/compile.sh
rm -rf .gitconfig
GIT_COMMIT="$(git rev-parse --short HEAD)"
GIT_DIRTY="$(test -n $(git status --porcelain) && echo +CHANGES || true)"
LDFLAGS="-s -w"
LDFLAGS="$LDFLAGS -X main.Name=${{package.name}}"
LDFLAGS="$LDFLAGS -X main.Version=${{package.version}}"
LDFLAGS="$LDFLAGS -X main.GitCommit=${GIT_COMMIT}${GIT_DIRTY}"
go build \
-ldflags="$LDFLAGS" \
-o ${{targets.destdir}}/usr/bin/http-echo \
.
- uses: strip
update:
enabled: true
github:
identifier: hashicorp/http-echo
strip-prefix: v