diff --git a/Dockerfile b/Dockerfile index 559ff47edf..365e63d6e1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,4 +2,4 @@ FROM centos:7 ENTRYPOINT ["jx", "version"] -COPY ./build/linux/jx /usr/bin/jx +COPY ./build/linux/jx /usr/bin/jx \ No newline at end of file diff --git a/Dockerfile.base b/Dockerfile.base index b3bbabc3c5..942e09e92c 100644 --- a/Dockerfile.base +++ b/Dockerfile.base @@ -1,3 +1,3 @@ FROM jenkinsxio/builder-base:latest -COPY build/linux/jx-linux-amd64 /usr/bin/jx +COPY build/linux/jx /usr/bin/jx diff --git a/Dockerfile.buildgo b/Dockerfile.buildgo index 154c79101f..a0826b95ef 100644 --- a/Dockerfile.buildgo +++ b/Dockerfile.buildgo @@ -1,4 +1,4 @@ # this is used for testing jx inside a cluster in development FROM jenkinsxio/builder-go:latest -COPY build/linux/jx-linux-amd64 /usr/bin/jx +COPY build/linux/jx /usr/bin/jx diff --git a/Dockerfile.maven b/Dockerfile.maven index 8cba438d8d..b75312d643 100644 --- a/Dockerfile.maven +++ b/Dockerfile.maven @@ -1,4 +1,4 @@ # this is used for testing jx inside a cluster in development FROM jenkinsxio/builder-maven:latest -COPY build/linux/jx-linux-amd64 /usr/bin/jx +COPY build/linux/jx /usr/bin/jx diff --git a/Dockerfile.nodejs b/Dockerfile.nodejs index f8fdfcd071..ad45a436b8 100644 --- a/Dockerfile.nodejs +++ b/Dockerfile.nodejs @@ -1,4 +1,4 @@ # this is used for testing jx inside a cluster in development FROM jenkinsxio/builder-nodejs:latest -COPY build/linux/jx-linux-amd64 /usr/bin/jx +COPY build/linux/ /usr/bin/jx diff --git a/Jenkinsfile b/Jenkinsfile index 23354139b4..3a933b5495 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,6 +4,7 @@ pipeline { } environment { GH_CREDS = credentials('jenkins-x-github') + CHARTMUSEUM_CREDS = credentials('jenkins-x-chartmuseum') BUILD_NUMBER = "$BUILD_NUMBER" GIT_USERNAME = "$GH_CREDS_USR" GIT_API_TOKEN = "$GH_CREDS_PSW" @@ -26,7 +27,7 @@ pipeline { container('go') { sh "make linux" sh "make test" - sh "./build/linux/jx-linux-amd64 --help" + sh "./build/linux/jx --help" sh "docker build -t docker.io/$ORG/$APP_NAME:$PREVIEW_VERSION ." @@ -36,7 +37,7 @@ pipeline { } } } - + stage('Build and Release') { when { branch 'master' @@ -52,7 +53,6 @@ pipeline { dir ('/home/jenkins/go/src/github.com/jenkins-x/jx/charts/jx') { container('go') { sh "helm init --client-only" - input 'ok' sh "make release" } } diff --git a/Makefile b/Makefile index ae0960d1a1..a52c305a71 100644 --- a/Makefile +++ b/Makefile @@ -77,27 +77,25 @@ vendoring: $(GO) get -u github.com/golang/dep/cmd/dep GO15VENDOREXPERIMENT=1 dep ensure -release: +release: check rm -rf build release && mkdir build release - #for os in linux darwin ; do \ - # CGO_ENABLED=$(CGO_ENABLED) GOOS=$$os GOARCH=amd64 $(GO) build $(BUILDFLAGS) -o build/$$os/$(NAME) cmd/jx/jx.go ; \ - #done - #CGO_ENABLED=$(CGO_ENABLED) GOOS=windows GOARCH=amd64 $(GO) build $(BUILDFLAGS) -o build/$(NAME)-windows-amd64.exe cmd/jx/jx.go - #zip --junk-paths release/$(NAME)-windows-amd64.zip build/$(NAME)-windows-amd64.exe README.md LICENSE - # CGO_ENABLED=$(CGO_ENABLED) GOOS=linux GOARCH=arm $(GO) build $(BUILDFLAGS) -o build/arm/$(NAME) cmd/jx/jx.go - CGO_ENABLED=$(CGO_ENABLED) GOOS=linux GOARCH=amd64 $(GO) build $(BUILDFLAGS) -o build/linux/$(NAME) cmd/jx/jx.go - ls -al ./build + for os in linux darwin ; do \ + CGO_ENABLED=$(CGO_ENABLED) GOOS=$$os GOARCH=amd64 $(GO) build $(BUILDFLAGS) -o build/$$os/$(NAME) cmd/jx/jx.go ; \ + done + CGO_ENABLED=$(CGO_ENABLED) GOOS=windows GOARCH=amd64 $(GO) build $(BUILDFLAGS) -o build/$(NAME)-windows-amd64.exe cmd/jx/jx.go + zip --junk-paths release/$(NAME)-windows-amd64.zip build/$(NAME)-windows-amd64.exe README.md LICENSE + CGO_ENABLED=$(CGO_ENABLED) GOOS=linux GOARCH=arm $(GO) build $(BUILDFLAGS) -o build/arm/$(NAME) cmd/jx/jx.go docker build -t docker.io/jenkinsxio/$(NAME):$(VERSION) . docker push docker.io/jenkinsxio/$(NAME):$(VERSION) - #chmod +x build/darwin/$(NAME) + chmod +x build/darwin/$(NAME) chmod +x build/linux/$(NAME) - #chmod +x build/arm/$(NAME) + chmod +x build/arm/$(NAME) - #cd ./build/darwin; tar -zcvf ../../release/jx-darwin-amd64.tar.gz jx + cd ./build/darwin; tar -zcvf ../../release/jx-darwin-amd64.tar.gz jx cd ./build/linux; tar -zcvf ../../release/jx-linux-amd64.tar.gz jx - #cd ./build/arm; tar -zcvf ../../release/jx-linux-arm.tar.gz jx + cd ./build/arm; tar -zcvf ../../release/jx-linux-arm.tar.gz jx go get -u github.com/progrium/gh-release gh-release checksums sha256 @@ -105,25 +103,25 @@ release: jx step changelog --header-file docs/dev/changelog-header.md --version $(VERSION) - #updatebot push-version --kind brew jx $(VERSION) - #updatebot push-version --kind docker JX_VERSION $(VERSION) - #updatebot push-regex -r "\s*release = \"(.*)\"" -v $(VERSION) config.toml - #updatebot update-loop + updatebot push-version --kind brew jx $(VERSION) + updatebot push-version --kind docker JX_VERSION $(VERSION) + updatebot push-regex -r "\s*release = \"(.*)\"" -v $(VERSION) config.toml + updatebot update-loop - #echo "Updating the JX CLI reference docs" - #git clone https://github.com/jenkins-x/jx-docs.git - #cd jx-docs/content/commands; \ - # ../../../build/linux/jx create docs; \ - # git config credential.helper store; \ - # git add *; \ - # git commit --allow-empty -a -m "updated jx commands from $(VERSION)"; \ - # git push origin + echo "Updating the JX CLI reference docs" + git clone https://github.com/jenkins-x/jx-docs.git + cd jx-docs/content/commands; \ + ../../../build/linux/jx create docs; \ + git config credential.helper store; \ + git add *; \ + git commit --allow-empty -a -m "updated jx commands from $(VERSION)"; \ + git push origin clean: rm -rf build release linux: - CGO_ENABLED=$(CGO_ENABLED) GOOS=linux GOARCH=amd64 $(GO) build $(BUILDFLAGS) -o build/linux/jx-linux-amd64 cmd/jx/jx.go + CGO_ENABLED=$(CGO_ENABLED) GOOS=linux GOARCH=amd64 $(GO) build $(BUILDFLAGS) -o build/linux/jx cmd/jx/jx.go docker: linux docker build --no-cache -t jenkinsxio/jx:dev . diff --git a/charts/jx/Makefile b/charts/jx/Makefile index 6fb9fab85e..8fb600976e 100644 --- a/charts/jx/Makefile +++ b/charts/jx/Makefile @@ -1,7 +1,7 @@ CHART_REPO := http://jenkins-x-chartmuseum:8080 NAME := jx OS := $(shell uname) -RELEASE_VERSION := $(cat ../../pkg/version/VERSION) +RELEASE_VERSION := $(shell cat ../../pkg/version/VERSION) setup: helm repo add jenkins-x https://chartmuseum.build.cd.jenkins-x.io @@ -38,5 +38,4 @@ endif helm package . curl --fail -u $(CHARTMUSEUM_CREDS_USR):$(CHARTMUSEUM_CREDS_PSW) --data-binary "@$(NAME)-$(RELEASE_VERSION).tgz" $(CHART_REPO)/api/charts rm -rf ${NAME}*.tgz - updatebot push-version --kind make CHART_VERSION $(RELEASE_VERSION)