diff --git a/.gitignore b/.gitignore index a470e245f5..44444c9d60 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ # build and test outputs -/bin/ /_output/ /_artifacts/ @@ -21,7 +20,10 @@ *.sublime-workspace *~ +/bin/.gimme +/bin/cloud-provisioner* deploy-recorder.lst /hack/go /hack/pkg /hack/*.tar.gz +deploy-recorder.lst \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile index dbed6c1580..a35ef94540 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,9 +10,10 @@ hose { UPSTREAM_VERSION = '0.17.0' DEPLOYONPRS = true GRYPE_TEST = false + MODULE_LIST = [ "paas.cloud-provisioner:cloud-provisioner:tar.gz"] DEV = { config -> doPackage(conf: config, parameters: "GOCACHE=/tmp") - doDeploy(conf:config) + doDeploy(conf: config) } } \ No newline at end of file diff --git a/Makefile b/Makefile index f2e162dc33..369ae056f4 100644 --- a/Makefile +++ b/Makefile @@ -87,7 +87,7 @@ test: # ================================= Cleanup ==================================== # standard cleanup target clean: - rm -rf "$(OUT_DIR)/" + find $(OUT_DIR)/ -name 'cloud-provisioner*' -delete && rm -rf "$(OUT_DIR)/.gimme" ################################################################################ # ============================== Auto-Update =================================== # update generated code, gofmt, etc. @@ -111,16 +111,14 @@ lint: shellcheck: hack/make-rules/verify/shellcheck.sh - - package: - go build -v -o "$(OUT_DIR)/$(KIND_BINARY_NAME)" $(KIND_BUILD_FLAGS) + make build && bin/package.sh $(version) deploy: - hack/custom/deploy.sh + bin/deploy.sh $(version) change-version: - hack/custom/change-version.sh $(version) + bin/change-version.sh $(version) ################################################################################# .PHONY: all kind build install unit clean update generate gofmt verify lint shellcheck \ No newline at end of file diff --git a/hack/custom/change-version.sh b/bin/change-version.sh similarity index 87% rename from hack/custom/change-version.sh rename to bin/change-version.sh index 041e1e6dc1..ceeb23a468 100755 --- a/hack/custom/change-version.sh +++ b/bin/change-version.sh @@ -1,6 +1,6 @@ #!/bin/bash -e -BASEDIR=`dirname $0`/../.. +BASEDIR=`dirname $0`/.. cd $BASEDIR diff --git a/hack/custom/deploy.sh b/bin/deploy.sh similarity index 57% rename from hack/custom/deploy.sh rename to bin/deploy.sh index 620069f0ea..411385abd5 100755 --- a/hack/custom/deploy.sh +++ b/bin/deploy.sh @@ -2,18 +2,17 @@ DIR=bin BASEDIR=`dirname $0`/../.. -VERSION=`cat $BASEDIR/VERSION` +VERSION=$1 EXTENSION="tar.gz" GROUP_ID="repository.paas.cloud-provisioner" GROUP_ID_NEXUS=${GROUP_ID//.//} +FILE="$DIR"/cloud-provisioner-${VERSION}.${EXTENSION} - -if [ -d "$DIR" ] || [ -r "$DIR"/cloud-provisioner]; then +if [ -d "$DIR" ] || [ -r "$FILE" ]; then echo "Uploading cloud-provisioner-$VERSION..." - tar czf "$DIR"/cloud-provisioner-${VERSION}.${EXTENSION} "$DIR"/cloud-provisioner curl -sS -u stratio:${NEXUSPASS} --upload-file "$DIR"/cloud-provisioner-${VERSION}.${EXTENSION} http://qa.int.stratio.com/${GROUP_ID_NEXUS}/ - echo "$GROUP_ID:cloud-provisioner:$EXTENSION" >> "$BASEDIR/deploy-recorder.lst" - rm -rf $BASEDIR/hack/go + echo "$GROUP_ID:cloud-provisioner:$EXTENSION" >> "$BASEDIR/deploy-recorder.lst" + rm -rf $BASEDIR/hack/go else echo "Run 'make build' first" exit 1 diff --git a/bin/package.sh b/bin/package.sh new file mode 100755 index 0000000000..c7de5e2f52 --- /dev/null +++ b/bin/package.sh @@ -0,0 +1,14 @@ +#!/bin/bash -e + +DIR=bin +BASEDIR=`dirname $0`/../.. +VERSION=$1 +EXTENSION="tar.gz" + +if [ -d "$DIR" ] || [ -r "$DIR"/cloud-provisioner]; then + echo "Packaging cloud-provisioner-$VERSION..." + tar czf "$DIR"/cloud-provisioner-${VERSION}.${EXTENSION} "$DIR"/cloud-provisioner +else + echo "Run 'make build' first" + exit 1 +fi \ No newline at end of file