Skip to content

Commit

Permalink
Merge pull request #175 from wlan0/master
Browse files Browse the repository at this point in the history
ensure that a statically linked binary is created
  • Loading branch information
ublubu authored Dec 18, 2017
2 parents c6c63ea + f66c3e9 commit 9e91ee1
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 3 deletions.
28 changes: 28 additions & 0 deletions docs/user-guide/drone.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
## Drone Plugin for Koki Short

Define all your Kubernetes manifests using Koki Short, and use this drone plugin to automatically convert the Short manifests into K8s manifests on the fly

### Use Koki Short in your Projects

```
workspace:
base: /go
path: src/github.com/koki/short-drone-plugin
pipeline:
koki-short:
image: kokster/short-drone-plugin:0.3.0
files:
- deployment.yaml
```

This will convert `deployment.yaml` to `kube_deployment.yaml`, which is the kubernetes manifest equivalent to `deployment.yaml`. The next steps in the pipeline will now be able to use `kube_deployment.yaml`

### Configuration Options

| Option | Type | Description |
|--------|------|-------------|
| files | []string | Input files relative to root of the project which is being built using drone |
| overwrite | bool | Set to `true` to allow output files to be overwritten. (default `false`) |
| in_place | bool | Set to `true` to translate files in place. (default `false`). Should always be used with `overwrite: true` |
| prefix | string | The prefix of the output file created. (default `kube_`) |
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ pages:
- Command Line: user-guide/command-line.md
- Getting Help: user-guide/getting-help.md
- Best Practices: user-guide/best-practices.md
- Integrating with Drone: user-guide/drone.md
- Resources:
- Introduction: resources/index.md
- ConfigMap: resources/config-map.md
Expand Down
2 changes: 1 addition & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ cd $src_dir/..
mkdir -p bin

#build a static go binary
CGO_ENABLED=0 go build -ldflags "-X github.com/koki/short/cmd.GITCOMMIT=$VERSION -linkmode external -extldflags -static -w" -o bin/short
CGO_ENABLED=0 go build -ldflags "-X github.com/koki/short/cmd.GITCOMMIT=$VERSION -extldflags -static -w" -o bin/short
14 changes: 12 additions & 2 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,22 @@ set -e
script_dir=$(dirname $0)

#import version details
source $script_dir/version.sh
source $script_dir/build.sh

#build from parent dir
cd $script_dir/..

#create output dir if none exists
mkdir -p bin

docker run -v $GOPATH:/go -t kokster/gox gox -ldflags "-X github.com/koki/short/cmd.GITCOMMIT=$VERSION" -output="src/github.com/koki/short/bin/short_{{.OS}}_{{.Arch}}" -os="linux darwin" -arch="386 amd64" github.com/koki/short
GOOS=linux GOARCH=amd64 ./scripts/build.sh
mv bin/short bin/short_linux_amd64

GOOS=linux GOARCH=386 ./scripts/build.sh
mv bin/short bin/short_linux_386

GOOS=darwin GOARCH=amd64 ./scripts/build.sh
mv bin/short bin/short_darwin_amd64

GOOS=darwin GOARCH=386 ./scripts/build.sh
mv bin/short bin/short_darwin_386

0 comments on commit 9e91ee1

Please sign in to comment.