mirror of
https://github.com/ipedrazas/drone-helm.git
synced 2026-06-04 18:24:13 +08:00
trying to make the build work per fork as well as grabbing a couple new version options
This commit is contained in:
+9
-5
@@ -1,6 +1,6 @@
|
||||
workspace:
|
||||
base: /go
|
||||
path: src/github.com/josmo/drone-helm
|
||||
path: src/github.com/${DRONE_REPO_OWNER}/${DRONE_REPO_NAME}
|
||||
pipeline:
|
||||
deps:
|
||||
image: golang:1.10
|
||||
@@ -23,7 +23,13 @@ pipeline:
|
||||
- GOARCH=amd64
|
||||
- CGO_ENABLED=0
|
||||
commands:
|
||||
- go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/amd64/drone-helm
|
||||
- |
|
||||
if test "${DRONE_TAG}" = ""; then
|
||||
go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/amd64/${DRONE_REPO_NAME}
|
||||
else
|
||||
go build -v -ldflags "-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/amd64/{DRONE_REPO_NAME}
|
||||
fi
|
||||
# - go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/amd64/drone-helm
|
||||
|
||||
# build_linux_arm64:
|
||||
# image: golang:1.10
|
||||
@@ -49,10 +55,8 @@ pipeline:
|
||||
publish_linux_amd64:
|
||||
image: plugins/docker
|
||||
group: publish
|
||||
username: josmo
|
||||
repo: peloton/drone-helm
|
||||
auto_tag: true
|
||||
secrets: [ docker_password ]
|
||||
secrets: [ docker_password, plugin_repo ]
|
||||
dockerfile: Dockerfile
|
||||
when:
|
||||
event: [ tag, push ]
|
||||
|
||||
@@ -9,14 +9,17 @@ import (
|
||||
"os"
|
||||
)
|
||||
|
||||
var build = "0" // build number set at compile-time
|
||||
var (
|
||||
version = "0.0.0"
|
||||
build = "0"
|
||||
)
|
||||
|
||||
func main() {
|
||||
app := cli.NewApp()
|
||||
app.Name = "helm plugin"
|
||||
app.Usage = "helm plugin"
|
||||
app.Action = run
|
||||
app.Version = fmt.Sprintf("1.0.%s", build)
|
||||
app.Version = fmt.Sprintf("%s+%s",version, build)
|
||||
app.Flags = []cli.Flag{
|
||||
cli.StringFlag{
|
||||
Name: "helm_command",
|
||||
|
||||
Reference in New Issue
Block a user