Skip to content

Commit

Permalink
Release preparations
Browse files Browse the repository at this point in the history
-v flag now prints version.
Dockerfile added.
CHANGELOG added.
Build hook for Docker Hub added.
  • Loading branch information
kaancfidan committed May 31, 2020
1 parent 56976f6 commit f70104b
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 1 deletion.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
There are currently no unreleased changes.

## v0.0.0 - 2020-06-01
This is the first version that includes the following functionality:
- YAML configuration support
- Route matching with standard wildcards
- Array and value claim checks
- HMAC, RSA and EC signing key support for JWT authentication
- Claims-based authorization
- Pure authorization server and reverse proxy modes

[Unreleased]: https://github.com/kaancfidan/bouncer/compare/v0.0.0...master
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM golang:1.13 AS builder
ARG VERSION
WORKDIR /go/src/github.com/kaancfidan/bouncer
COPY . .
RUN go get -d -v
RUN sed -i "s/0.0.0-VERSION/"$VERSION"/" main.go
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w"

FROM scratch
COPY --from=builder /go/src/github.com/kaancfidan/bouncer/bouncer bouncer
ENTRYPOINT ["./bouncer"]
3 changes: 3 additions & 0 deletions hooks/build
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

docker build -t $IMAGE_NAME --build-arg VERSION=`git describe --tags || git describe` .
8 changes: 7 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ func parseFlags() *flags {
expRequired: "true",
nbfRequired: "true",
}


printVersion := flag.Bool("v", false, "print version and exit")
flag.StringVar(&f.signingKey, "k",
lookupEnv("BOUNCER_SIGNING_KEY", ""),
"cryptographic signing key")
Expand Down Expand Up @@ -162,6 +163,11 @@ func parseFlags() *flags {

flag.Parse()

if *printVersion {
fmt.Printf("Bouncer version: %s\n", version)
os.Exit(0)
}

return &f
}

Expand Down

0 comments on commit f70104b

Please sign in to comment.