Skip to content
This repository has been archived by the owner on Jun 13, 2023. It is now read-only.

Commit

Permalink
Setup circle ci (#20)
Browse files Browse the repository at this point in the history
* scripts: re organize by verify / update verbs
* setup circleci
* Hardcode the locale to get a stable sort
  • Loading branch information
JulienBalestra authored May 14, 2018
1 parent ec569e3 commit 8625647
Show file tree
Hide file tree
Showing 10 changed files with 118 additions and 40 deletions.
46 changes: 46 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
version: 2

templates:
job_template: &job_template
docker:
- image: golang:1.10
working_directory: /go/src/github.com/DataDog/pupernetes

jobs:
build:
<<: *job_template
steps:
- checkout
- run:
name: build
command: make

tests:
<<: *job_template
steps:
- checkout
- run:
name: run tests
command: make check

verify:
<<: *job_template
steps:
- checkout
- run:
name: verify-gofmt
command: make verify-gofmt
- run:
name: verify-docs
command: make verify-docs
- run:
name: verify-license
command: make verify-license

workflows:
version: 2
build_test_verify:
jobs:
- tests
- verify
- build
38 changes: 19 additions & 19 deletions LICENSE-3rdparty.csv
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,22 @@ core,"github.com/gogo/protobuf/proto",NewBSD
core,"github.com/gogo/protobuf/sortkeys",NewBSD
core,"github.com/golang/glog",Apache-2.0
core,"github.com/golang/protobuf/proto",NewBSD
core,"github.com/golang/protobuf/ptypes",NewBSD
core,"github.com/golang/protobuf/ptypes/any",NewBSD
core,"github.com/golang/protobuf/ptypes/duration",NewBSD
core,"github.com/golang/protobuf/ptypes",NewBSD
core,"github.com/golang/protobuf/ptypes/timestamp",NewBSD
core,"github.com/golang/snappy",NewBSD
core,"github.com/google/gofuzz",Apache-2.0
core,"github.com/googleapis/gnostic/OpenAPIv2",Apache-2.0
core,"github.com/googleapis/gnostic/compiler",Apache-2.0
core,"github.com/googleapis/gnostic/extensions",Apache-2.0
core,"github.com/googleapis/gnostic/OpenAPIv2",Apache-2.0
core,"github.com/google/gofuzz",Apache-2.0
core,"github.com/gorilla/context",NewBSD
core,"github.com/gorilla/mux",NewBSD
core,"github.com/hashicorp/errwrap",MPL-2.0
core,"github.com/hashicorp/go-cleanhttp",MPL-2.0
core,"github.com/hashicorp/go-multierror",MPL-2.0
core,"github.com/hashicorp/go-rootcerts",MPL-2.0
core,"github.com/hashicorp/hcl",MPL-2.0
core,"github.com/hashicorp/hcl/hcl/ast",MPL-2.0
core,"github.com/hashicorp/hcl/hcl/parser",MPL-2.0
core,"github.com/hashicorp/hcl/hcl/printer",MPL-2.0
Expand All @@ -38,7 +39,6 @@ core,"github.com/hashicorp/hcl/hcl/token",MPL-2.0
core,"github.com/hashicorp/hcl/json/parser",MPL-2.0
core,"github.com/hashicorp/hcl/json/scanner",MPL-2.0
core,"github.com/hashicorp/hcl/json/token",MPL-2.0
core,"github.com/hashicorp/hcl",MPL-2.0
core,"github.com/hashicorp/vault/api",MPL-2.0
core,"github.com/hashicorp/vault/helper/compressutil",MPL-2.0
core,"github.com/hashicorp/vault/helper/jsonutil",MPL-2.0
Expand Down Expand Up @@ -69,14 +69,14 @@ core,"github.com/stretchr/testify/assert",MIT
core,"github.com/stretchr/testify/require",MIT
core,"golang.org/x/crypto/ssh/terminal",NewBSD
core,"golang.org/x/net/context",NewBSD
core,"golang.org/x/net/http2/hpack",NewBSD
core,"golang.org/x/net/http2",NewBSD
core,"golang.org/x/net/http2/hpack",NewBSD
core,"golang.org/x/net/idna",NewBSD
core,"golang.org/x/net/lex/httplex",NewBSD
core,"golang.org/x/sys/unix",NewBSD
core,"golang.org/x/sys/windows",NewBSD
core,"golang.org/x/text/collate/build",NewBSD
core,"golang.org/x/text/collate",NewBSD
core,"golang.org/x/text/collate/build",NewBSD
core,"golang.org/x/text/internal/colltab",NewBSD
core,"golang.org/x/text/internal/gen",NewBSD
core,"golang.org/x/text/internal/tag",NewBSD
Expand Down Expand Up @@ -110,12 +110,22 @@ core,"k8s.io/api/certificates/v1beta1",Apache-2.0
core,"k8s.io/api/core/v1",Apache-2.0
core,"k8s.io/api/events/v1beta1",Apache-2.0
core,"k8s.io/api/extensions/v1beta1",Apache-2.0
core,"k8s.io/api/networking/v1",Apache-2.0
core,"k8s.io/api/policy/v1beta1",Apache-2.0
core,"k8s.io/api/rbac/v1",Apache-2.0
core,"k8s.io/api/rbac/v1alpha1",Apache-2.0
core,"k8s.io/api/rbac/v1beta1",Apache-2.0
core,"k8s.io/api/scheduling/v1alpha1",Apache-2.0
core,"k8s.io/api/settings/v1alpha1",Apache-2.0
core,"k8s.io/api/storage/v1",Apache-2.0
core,"k8s.io/api/storage/v1alpha1",Apache-2.0
core,"k8s.io/api/storage/v1beta1",Apache-2.0
core,"k8s.io/apimachinery/pkg/api/errors",Apache-2.0
core,"k8s.io/apimachinery/pkg/api/meta",Apache-2.0
core,"k8s.io/apimachinery/pkg/api/resource",Apache-2.0
core,"k8s.io/apimachinery/pkg/apis/meta/v1",Apache-2.0
core,"k8s.io/apimachinery/pkg/apis/meta/v1beta1",Apache-2.0
core,"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured",Apache-2.0
core,"k8s.io/apimachinery/pkg/apis/meta/v1beta1",Apache-2.0
core,"k8s.io/apimachinery/pkg/conversion",Apache-2.0
core,"k8s.io/apimachinery/pkg/conversion/queryparams",Apache-2.0
core,"k8s.io/apimachinery/pkg/fields",Apache-2.0
Expand Down Expand Up @@ -145,16 +155,6 @@ core,"k8s.io/apimachinery/pkg/util/yaml",Apache-2.0
core,"k8s.io/apimachinery/pkg/version",Apache-2.0
core,"k8s.io/apimachinery/pkg/watch",Apache-2.0
core,"k8s.io/apimachinery/third_party/forked/golang/reflect",Apache-2.0
core,"k8s.io/api/networking/v1",Apache-2.0
core,"k8s.io/api/policy/v1beta1",Apache-2.0
core,"k8s.io/api/rbac/v1alpha1",Apache-2.0
core,"k8s.io/api/rbac/v1",Apache-2.0
core,"k8s.io/api/rbac/v1beta1",Apache-2.0
core,"k8s.io/api/scheduling/v1alpha1",Apache-2.0
core,"k8s.io/api/settings/v1alpha1",Apache-2.0
core,"k8s.io/api/storage/v1alpha1",Apache-2.0
core,"k8s.io/api/storage/v1",Apache-2.0
core,"k8s.io/api/storage/v1beta1",Apache-2.0
core,"k8s.io/client-go/discovery",Apache-2.0
core,"k8s.io/client-go/kubernetes",Apache-2.0
core,"k8s.io/client-go/kubernetes/scheme",Apache-2.0
Expand All @@ -178,13 +178,13 @@ core,"k8s.io/client-go/kubernetes/typed/events/v1beta1",Apache-2.0
core,"k8s.io/client-go/kubernetes/typed/extensions/v1beta1",Apache-2.0
core,"k8s.io/client-go/kubernetes/typed/networking/v1",Apache-2.0
core,"k8s.io/client-go/kubernetes/typed/policy/v1beta1",Apache-2.0
core,"k8s.io/client-go/kubernetes/typed/rbac/v1alpha1",Apache-2.0
core,"k8s.io/client-go/kubernetes/typed/rbac/v1",Apache-2.0
core,"k8s.io/client-go/kubernetes/typed/rbac/v1alpha1",Apache-2.0
core,"k8s.io/client-go/kubernetes/typed/rbac/v1beta1",Apache-2.0
core,"k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1",Apache-2.0
core,"k8s.io/client-go/kubernetes/typed/settings/v1alpha1",Apache-2.0
core,"k8s.io/client-go/kubernetes/typed/storage/v1alpha1",Apache-2.0
core,"k8s.io/client-go/kubernetes/typed/storage/v1",Apache-2.0
core,"k8s.io/client-go/kubernetes/typed/storage/v1alpha1",Apache-2.0
core,"k8s.io/client-go/kubernetes/typed/storage/v1beta1",Apache-2.0
core,"k8s.io/client-go/pkg/apis/clientauthentication",Apache-2.0
core,"k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1",Apache-2.0
Expand Down
22 changes: 16 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,30 @@ clean:

re: clean pupernetes

fmt:
./scripts/update-gofmt.sh
gofmt:
./scripts/update/gofmt.sh

gen-docs:
$(CC) run ./scripts/docs.go
$(CC) run ./scripts/update/docs.go

gen-license:
./scripts/update/license.sh

PKG=job options setup util
$(PKG): %:
$(CC) test -v ./pkg/$@
check: $(PKG)

verify:
./scripts/verify-gofmt.sh
./scripts/verify-generated-docs.sh
verify-gofmt:
./scripts/verify/gofmt.sh

verify-docs:
./scripts/verify/docs.sh

verify-license:
./scripts/verify/license.sh

verify: verify-gofmt verify-docs verify-license

sha512sum: pupernetes
$@ ./$^ > $^.$@
9 changes: 0 additions & 9 deletions scripts/run.sh

This file was deleted.

File renamed without changes.
4 changes: 2 additions & 2 deletions scripts/update-gofmt.sh → scripts/update/gofmt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ set -o errexit
set -o nounset
set -o pipefail

PKG=$(dirname $0)/../pkg
CMD=$(dirname $0)/../cmd
PKG=$(dirname $0)/../../pkg
CMD=$(dirname $0)/../../cmd
SCRIPT=$(dirname $0)


Expand Down
6 changes: 4 additions & 2 deletions scripts/update-license.sh → scripts/update/license.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

set -ex

go get -u github.com/frapposelli/wwhrd
export LC_ALL=C

cd $(dirname $0)/..
go get github.com/frapposelli/wwhrd

cd $(dirname $0)/../..

wwhrd list

Expand Down
3 changes: 2 additions & 1 deletion scripts/verify-generated-docs.sh → scripts/verify/docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
set -o errexit
set -o nounset
set -o pipefail
set -e

cd $(dirname $0)/..
cd $(dirname $0)/../..

make gen-docs

Expand Down
2 changes: 1 addition & 1 deletion scripts/verify-gofmt.sh → scripts/verify/gofmt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ set -o errexit
set -o nounset
set -o pipefail

cd $(dirname "$0}")/..
cd $(dirname "$0}")/../..


find_files() {
Expand Down
28 changes: 28 additions & 0 deletions scripts/verify/license.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

set -o errexit
set -o nounset
set -o pipefail
set -e

cd $(dirname $0)/../..

make gen-license

DIFF=$(git --no-pager diff LICENSE-3rdparty.csv)
if [[ "${DIFF}x" != "x" ]]
then
echo "License outdated:" >&2
git --no-pager diff LICENSE-3rdparty.csv >&2
exit 2
fi

DIFF=$(git ls-files docs/ --exclude-standard --others)
if [[ "${DIFF}x" != "x" ]]
then
echo "License removed:" >&2
echo ${DIFF} >&2
exit 2
fi

exit 0

0 comments on commit 8625647

Please sign in to comment.