Skip to content

Commit

Permalink
Reorganize code to be importable (#8)
Browse files Browse the repository at this point in the history
* Reorganize project directory structure

- Move main.go into cmd/authenticator
- Move other go files into pkg/authenticator and relabel with `package
  authenticator`
- Make PublicCert and PrivateKey exportable for now, to allow access from main

* Move scripts into bin/ directory

- Also, update Jenkinsfile to point to the new location

* Bump version to 0.12.0

* Reorganize code in authenticator package

- Move functions relating to Login / Authenticate out of main.go and into
  authenticator package
- Add (some) comments
- Move utils into authenticator.go, as those functions were only used there

* Move generateCSR functionality into GenerateCSR

* Updates to fix govet / golint errors
  • Loading branch information
izgeri authored and John Tuttle committed Aug 2, 2018
1 parent 4542007 commit 870e2f4
Show file tree
Hide file tree
Showing 15 changed files with 413 additions and 372 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.12.0

- Reorganized file structure of project to make importable

# 0.11.1

- Fixed bug with request body during v4 authentication.
Expand Down
4 changes: 2 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pipeline {
stages {
stage('Build client Docker image') {
steps {
sh './build.sh'
sh './bin/build'
}
}

Expand All @@ -20,7 +20,7 @@ pipeline {
branch 'master'
}
steps {
sh './publish.sh'
sh './bin/publish'
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.11.1
0.12.0
131 changes: 0 additions & 131 deletions authenticator.go

This file was deleted.

47 changes: 0 additions & 47 deletions authenticator_error.go

This file was deleted.

2 changes: 1 addition & 1 deletion build.sh → bin/build
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ echo "building conjur-authn-k8s-client-go with tag ${TAG} <<"
docker build -t conjur-authn-k8s-client-go:builder .
docker run --rm -v $PWD:/go/src/github.com/cyberark/conjur-authn-k8s-client \
conjur-authn-k8s-client-go:builder env CGO_ENABLED=0 GOOS=linux \
go build -a -installsuffix cgo -o authenticator .
go build -a -installsuffix cgo -o authenticator ./cmd/authenticator
docker build -f Dockerfile.scratch -t "${TAG}" .
docker build --build-arg VERSION="$VERSION" -f Dockerfile.redhat -t "${TAG}-redhat" .

Expand Down
12 changes: 12 additions & 0 deletions bin/dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

cd $(dirname "$0")
docker build \
-t conjur-authn-k8s-client-go:builder \
../

docker run \
--rm -it \
-v $(cd ..; pwd):/go/src/github.com/cyberark/conjur-authn-k8s-client \
conjur-authn-k8s-client-go:builder \
bash
File renamed without changes.
Loading

0 comments on commit 870e2f4

Please sign in to comment.