diff --git a/docs/user-guide/drone.md b/docs/user-guide/drone.md new file mode 100644 index 00000000..dbd37e98 --- /dev/null +++ b/docs/user-guide/drone.md @@ -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_`) | diff --git a/mkdocs.yml b/mkdocs.yml index eb05d6bb..443b0ddb 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -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 diff --git a/scripts/build.sh b/scripts/build.sh index dcb43f14..8add4cea 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -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 diff --git a/scripts/release.sh b/scripts/release.sh index 161823b3..c0ce875e 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -5,7 +5,7 @@ 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/.. @@ -13,4 +13,14 @@ 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