Skip to content

Commit f70104b

Browse files
committed
Release preparations
-v flag now prints version. Dockerfile added. CHANGELOG added. Build hook for Docker Hub added.
1 parent 56976f6 commit f70104b

File tree

4 files changed

+40
-1
lines changed

4 files changed

+40
-1
lines changed

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Changelog
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5+
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6+
7+
## [Unreleased]
8+
There are currently no unreleased changes.
9+
10+
## v0.0.0 - 2020-06-01
11+
This is the first version that includes the following functionality:
12+
- YAML configuration support
13+
- Route matching with standard wildcards
14+
- Array and value claim checks
15+
- HMAC, RSA and EC signing key support for JWT authentication
16+
- Claims-based authorization
17+
- Pure authorization server and reverse proxy modes
18+
19+
[Unreleased]: https://github.com/kaancfidan/bouncer/compare/v0.0.0...master

Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM golang:1.13 AS builder
2+
ARG VERSION
3+
WORKDIR /go/src/github.com/kaancfidan/bouncer
4+
COPY . .
5+
RUN go get -d -v
6+
RUN sed -i "s/0.0.0-VERSION/"$VERSION"/" main.go
7+
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w"
8+
9+
FROM scratch
10+
COPY --from=builder /go/src/github.com/kaancfidan/bouncer/bouncer bouncer
11+
ENTRYPOINT ["./bouncer"]

hooks/build

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
docker build -t $IMAGE_NAME --build-arg VERSION=`git describe --tags || git describe` .

main.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ func parseFlags() *flags {
119119
expRequired: "true",
120120
nbfRequired: "true",
121121
}
122-
122+
123+
printVersion := flag.Bool("v", false, "print version and exit")
123124
flag.StringVar(&f.signingKey, "k",
124125
lookupEnv("BOUNCER_SIGNING_KEY", ""),
125126
"cryptographic signing key")
@@ -162,6 +163,11 @@ func parseFlags() *flags {
162163

163164
flag.Parse()
164165

166+
if *printVersion {
167+
fmt.Printf("Bouncer version: %s\n", version)
168+
os.Exit(0)
169+
}
170+
165171
return &f
166172
}
167173

0 commit comments

Comments
 (0)