Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Adopt new release pipeline #171

Merged
merged 6 commits into from
Apr 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 16 additions & 59 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@ jobs:
command: |
echo 'export GO111MODULE=on' >> $BASH_ENV
source $BASH_ENV
- run: curl -L https://git.io/vp6lP | sh
- run: mv ./bin/* $GOPATH/bin
- run: curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.16.0
- run: go mod download
- run: go mod vendor
- run: GO111MODULE=off gometalinter --disable-all --enable=goimports --enable=vet --vendor ./...
- run: golangci-lint run ./...

# swagger:
# docker:
Expand Down Expand Up @@ -71,27 +69,23 @@ jobs:
- run: go-acc -o coverage.txt ./... -- -failfast -timeout=20m
- run: test -z "$CIRCLE_PR_NUMBER" && goveralls -service=circle-ci -coverprofile=coverage.txt -repotoken=$COVERALLS_REPO_TOKEN || echo "forks are not allowed to push to coveralls"

build-docker:
docker:
- image: library/docker:17.10
steps:
- checkout
- setup_remote_docker:
version: 17.10.0-ce
- run: docker build -f Dockerfile -t oathkeeper-test .
- run: docker run oathkeeper-test version

release-docker:
release:
docker:
- image: circleci/golang:1.12
working_directory: /go/src/github.com/ory/oathkeeper
steps:
- run:
name: Enable go1.12 modules
command: |
echo 'export GO111MODULE=on' >> $BASH_ENV
echo 'export DOCKER_FULL_TAG=$(echo $CIRCLE_TAG | tr '+' '_')' >> $BASH_ENV
echo 'export DOCKER_SHORT_TAG=$(echo $CIRCLE_TAG | cut -d '+' -f1)' >> $BASH_ENV
source $BASH_ENV
- checkout
- setup_remote_docker:
version: 17.10.0-ce
- run: docker build --build-arg git_tag=$(git describe --tags) --build-arg git_commit=$(git rev-parse HEAD) -f Dockerfile -t oryd/oathkeeper:$(echo $CIRCLE_TAG | tr '+' '_') .
- setup_remote_docker
- run: docker login --username "$DOCKER_USERNAME" --password "$DOCKER_PASSWORD"
- run: docker push oryd/oathkeeper:$(echo $CIRCLE_TAG | tr '+' '_')
- run: cp ./.releaser/LICENSE.txt ./LICENSE.txt
- run: curl -sL https://git.io/goreleaser | bash

release-docs:
docker:
Expand Down Expand Up @@ -125,23 +119,6 @@ jobs:
- run: git remote add origin https://arekkas:$GITHUB_TOKEN@github.com/ory/oathkeeper.git
- run: git push origin HEAD:master || true

release-binaries:
docker:
- image: circleci/golang:1.12
working_directory: /go/src/github.com/ory/oathkeeper
steps:
- run:
name: Enable go1.12 modules
command: |
echo 'export GO111MODULE=on' >> $BASH_ENV
source $BASH_ENV
- checkout
- run: go mod download
- run: go install github.com/mitchellh/gox github.com/tcnksm/ghr
- run: |
gox -parallel=2 -ldflags "-X github.com/ory/oathkeeper/cmd.Version=`git describe --tags` -X github.com/ory/oathkeeper/cmd.BuildTime=`TZ=UTC date -u '+%Y-%m-%dT%H:%M:%SZ'` -X github.com/ory/oathkeeper/cmd.GitHash=`git rev-parse HEAD`" -output "dist/{{.Dir}}-{{.OS}}-{{.Arch}}";
- run: ghr -t $GITHUB_TOKEN -u $CIRCLE_PROJECT_USERNAME -r $CIRCLE_PROJECT_REPONAME --replace `git describe --tags` dist/

release-npm:
docker:
- image: circleci/node:8.9.3
Expand Down Expand Up @@ -171,46 +148,26 @@ workflows:
filters:
branches:
only: master
# - swagger:
# filters:
# tags:
# only: /.*/
- build-docker:
- release:
requires:
- test
# - swagger
- format
filters:
tags:
only: /.*/
- release-binaries:
requires:
- build-docker
filters:
tags:
only: /.*/
branches:
ignore: /.*/
- release-docker:
requires:
- build-docker
filters:
tags:
only: /.*/
branches:
ignore: /.*/
- release-npm:
requires:
- build-docker
- release
filters:
tags:
only: /.*/
branches:
ignore: /.*/
- release-changelog:
requires:
- release-docker
- release-binaries
- release
- release-npm
filters:
tags:
Expand Down
6 changes: 6 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
linters:
enable-all: false
disable-all: true
enable:
- vet
- goimports
76 changes: 76 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# This is an example goreleaser.yaml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
project_name: oathkeeper

env:
- GO111MODULE=on
before:
hooks:
- go mod download
builds:
-
flags:
- -a
ldflags:
- -s -w -X github.com/ory/oathkeeper/cmd.Version={{.Tag}} -X github.com/ory/oathkeeper/cmd.Commit={{.FullCommit}} -X github.com/ory/oathkeeper/cmd.Date={{.Date}}
binary: oathkeeper
env:
- CGO_ENABLED=0
goarch:
- amd64
- 386
- arm
- arm64
goarm:
- 5
- 6
- 7
goos:
- freebsd
- linux
- windows
- darwin
archive:
replacements:
darwin: macOS
linux: Linux
windows: Windows
386: 32-bit
amd64: 64-bit
format_overrides:
- goos: windows
format: zip
files:
- LICENSE.txt
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
brew:
github:
owner: ory
name: homebrew-oathkeeper
homepage: https://www.ory.sh
commit_author:
name: ory
email: hi@ory.sh

scoop:
bucket:
owner: ory
name: scoop-oathkeeper
homepage: https://www.ory.sh
commit_author:
name: ory
email: hi@ory.sh

dockers:
- image_templates:
- "oryd/oathkeeper:v{{ .Major }}"
- "oryd/oathkeeper:v{{ .Major }}.{{ .Minor }}"
- "oryd/oathkeeper:v{{ .Major }}.{{ .Minor }}.{{ .Patch }}"
- "oryd/oathkeeper:{{ .Env.DOCKER_FULL_TAG }}"
- "oryd/oathkeeper:{{ .Env.DOCKER_SHORT_TAG }}"
- "oryd/oathkeeper:latest"
extra_files:
- .releaser/LICENSE.txt
84 changes: 84 additions & 0 deletions .releaser/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
ORY Oathkeeper
Copyright (c) 2019 ORY GmbH

*** END USER LICENSE AGREEMENT ***

IMPORTANT: PLEASE READ THIS LICENSE CAREFULLY BEFORE USING THIS SOFTWARE.

1. LICENSE

By receiving, opening the file package, and/or using ORY Oathkeeper ("Software") containing this software, you agree that
this End User User License Agreement(EULA) is a legally binding and valid contract and agree to be bound by it.
You agree to abide by the intellectual property laws and all of the terms and conditions of this Agreement.

Unless you have a different license agreement signed by ORY GmbH your use of ORY Oathkeeper indicates
your acceptance of this license agreement and warranty.

Subject to the terms of this Agreement, ORY GmbH grants to you a limited, non-exclusive, non-transferable
license, without right to sub-license, to use ORY Oathkeeper in accordance with this Agreement and any other written
agreement with ORY GmbH. ORY GmbH does not transfer the title of ORY Oathkeeper to you; the license granted to you is not a
sale. This agreement is a binding legal agreement between ORY GmbH and the purchasers or users of ORY Oathkeeper.

If you do not agree to be bound by this agreement, remove ORY Oathkeeper from your computer now and, if applicable,
promptly return to ORY GmbH by mail any copies of ORY Oathkeeper and related documentation and packaging in your possession.

2. DISTRIBUTION

ORY Oathkeeper and the license herein granted shall not be copied, shared, distributed, re-sold, offered for re-sale,
transferred or sub-licensed in whole or in part except that you may make one copy for archive purposes only. For
information about redistribution of ORY Oathkeeper contact ORY GmbH.

3. USER AGREEMENT

3.1 Use

Your license to use ORY Oathkeeper is limited to the number of licenses purchased by you. You shall not allow others to use,
copy or evaluate copies of ORY Oathkeeper.

3.2 Use Restrictions

You shall use ORY Oathkeeper in compliance with all applicable laws and not for any unlawful purpose. Without limiting the
foregoing, use, display or distribution of ORY Oathkeeper together with material that is pornographic, racist, vulgar,
obscene, defamatory, libelous, abusive, promoting hatred, discriminating or displaying prejudice based on religion,
ethnic heritage, race, sexual orientation or age is strictly prohibited.

Each licensed copy of ORY Oathkeeper may be used on one single computer location by one user. Use of ORY Oathkeeper means that you have loaded, installed, or run ORY Oathkeeper on a computer or similar device. If you install ORY Oathkeeper onto a multi-user platform, server or network, each and every individual user of ORY Oathkeeper must be licensed separately.

You may make one copy of ORY Oathkeeper for backup purposes, providing you only have one copy installed on one computer being used by one person. Other users may not use your copy of ORY Oathkeeper . The assignment, sublicense, networking, sale, or distribution of copies of ORY Oathkeeper are strictly forbidden without the prior written consent of ORY GmbH. It is a violation of this agreement to assign, sell, share, loan, rent, lease, borrow, network or transfer the use of ORY Oathkeeper. If any person other than yourself uses ORY Oathkeeper registered in your name, regardless of whether it is at the same time or different times, then this agreement is being violated and you are responsible for that violation!

3.3 Copyright Restriction

This Software contains copyrighted material, trade secrets and other proprietary material. You shall not, and shall not attempt to, modify, reverse engineer, disassemble or decompile ORY Oathkeeper. Nor can you create any derivative works or other works that are based upon or derived from ORY Oathkeeper in whole or in part.

ORY GmbH's name, logo and graphics file that represents ORY Oathkeeper shall not be used in any way to promote products developed with ORY Oathkeeper . ORY GmbH retains sole and exclusive ownership of all right, title and interest in and to ORY Oathkeeper and all Intellectual Property rights relating thereto.

Copyright law and international copyright treaty provisions protect all parts of ORY Oathkeeper, products and services. No program, code, part, image, audio sample, or text may be copied or used in any way by the user except as intended within the bounds of the single user program. All rights not expressly granted hereunder are reserved for ORY GmbH.

3.4 Limitation of Responsibility

You will indemnify, hold harmless, and defend ORY GmbH , its employees, agents and distributors against any and all claims, proceedings, demand and costs resulting from or in any way connected with your use of ORY GmbH's Software.

In no event (including, without limitation, in the event of negligence) will ORY GmbH , its employees, agents or distributors be liable for any consequential, incidental, indirect, special or punitive damages whatsoever (including, without limitation, damages for loss of profits, loss of use, business interruption, loss of information or data, or pecuniary loss), in connection with or arising out of or related to this Agreement, ORY Oathkeeper or the use or inability to use ORY Oathkeeper or the furnishing, performance or use of any other matters hereunder whether based upon contract, tort or any other theory including negligence.

ORY GmbH's entire liability, without exception, is limited to the customers' reimbursement of the purchase price of the Software (maximum being the lesser of the amount paid by you and the suggested retail price as listed by ORY GmbH ) in exchange for the return of the product, all copies, registration papers and manuals, and all materials that constitute a transfer of license from the customer back to ORY GmbH.

3.5 Warranties

Except as expressly stated in writing, ORY GmbH makes no representation or warranties in respect of this Software and expressly excludes all other warranties, expressed or implied, oral or written, including, without limitation, any implied warranties of merchantable quality or fitness for a particular purpose.

3.6 Governing Law

This Agreement shall be governed by the law of the Germany applicable therein. You hereby irrevocably attorn and submit to the non-exclusive jurisdiction of the courts of Germany therefrom. If any provision shall be considered unlawful, void or otherwise unenforceable, then that provision shall be deemed severable from this License and not affect the validity and enforceability of any other provisions.

3.7 Termination

Any failure to comply with the terms and conditions of this Agreement will result in automatic and immediate termination of this license. Upon termination of this license granted herein for any reason, you agree to immediately cease use of ORY Oathkeeper and destroy all copies of ORY Oathkeeper supplied under this Agreement. The financial obligations incurred by you shall survive the expiration or termination of this license.

4. DISCLAIMER OF WARRANTY

THIS SOFTWARE AND THE ACCOMPANYING FILES ARE SOLD "AS IS" AND WITHOUT WARRANTIES AS TO PERFORMANCE OR MERCHANTABILITY OR ANY OTHER WARRANTIES WHETHER EXPRESSED OR IMPLIED. THIS DISCLAIMER CONCERNS ALL FILES GENERATED AND EDITED BY ORY Oathkeeper AS WELL.

5. CONSENT OF USE OF DATA

You agree that ORY GmbH may collect and use information gathered in any manner as part of the product support services provided to you, if any, related to ORY Oathkeeper.ORY GmbH may also use this information to provide notices to you which may be of use or interest to you.

13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,16 @@ sdk:
rm -f ./sdk/js/swagger/package.json
rm -rf ./sdk/js/swagger/test
rm -rf ./vendor

.PHONY: install-stable
install-stable:
OATHKEEPER_LATEST=$$(git describe --abbrev=0 --tags)
git checkout $$OATHKEEPER_LATEST
GO111MODULE=on go install \
-ldflags "-X github.com/ory/oathkeeper/cmd.Version=$$OATHKEEPER_LATEST -X github.com/ory/oathkeeper/cmd.Date=`TZ=UTC date -u '+%Y-%m-%dT%H:%M:%SZ'` -X github.com/ory/oathkeeper/cmd.Commit=`git rev-parse HEAD`" \
.
git checkout master

.PHONY: install
install:
GO111MODULE=on go install .
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ This service is stable, but under active development and may introduce breaking


- [Installation](#installation)
- [Download binaries](#download-binaries)
- [Using Docker](#using-docker)
- [Building from source](#building-from-source)
- [Ecosystem](#ecosystem)
- [ORY Security Console: Administrative User Interface](#ory-security-console-administrative-user-interface)
- [ORY Hydra: OAuth2 & OpenID Connect Server](#ory-hydra-oauth2--openid-connect-server)
Expand All @@ -61,7 +58,8 @@ This service is stable, but under active development and may introduce breaking

## Installation

There are various ways of installing ORY Oathkeeper on your system.
Head over to the [ORY Developer Documentation](https://www.ory.sh/docs/oathkeeper/install) to learn how to install ORY
Oathkeeper on Linux, macOS, Windows, and Docker and how to build ORY Oathkeeper from source.

### Download binaries

Expand Down
7 changes: 3 additions & 4 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ package cmd
import (
"fmt"
"os"
"time"

"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
Expand All @@ -33,9 +32,9 @@ import (
var cfgFile string

var (
Version = "dev-master"
BuildTime = time.Now().String()
GitHash = "undefined"
Version = "master"
Date = "undefined"
Commit = "undefined"
)

// RootCmd represents the base command when called without any subcommands
Expand Down
4 changes: 2 additions & 2 deletions cmd/serve_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ HTTP CONTROLS
WriteKey: "MSx9A6YQ1qodnkzEFOv22cxOmOCJXMFa",
WhitelistedPaths: []string{"/rules", "/.well-known/jwks.json", "/judge"},
BuildVersion: Version,
BuildTime: BuildTime,
BuildHash: GitHash,
BuildTime: Date,
BuildHash: Commit,
},
)
n.Use(metrics)
Expand Down
4 changes: 2 additions & 2 deletions cmd/serve_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ OTHER CONTROLS
WriteKey: "MSx9A6YQ1qodnkzEFOv22cxOmOCJXMFa",
WhitelistedPaths: []string{"/"},
BuildVersion: Version,
BuildTime: GitHash,
BuildHash: BuildTime,
BuildTime: Commit,
BuildHash: Date,
},
)
n.Use(metrics)
Expand Down
4 changes: 2 additions & 2 deletions cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ var versionCmd = &cobra.Command{
Short: "Display this binary's version, build time and git hash of this build",
Run: func(cmd *cobra.Command, args []string) {
fmt.Printf("Version: %s\n", Version)
fmt.Printf("Git Hash: %s\n", GitHash)
fmt.Printf("Build Time: %s\n", BuildTime)
fmt.Printf("Git Hash: %s\n", Commit)
fmt.Printf("Build Time: %s\n", Date)
},
}

Expand Down
Loading