From 75b2973eb1c35809f96aadc2aa30ed814222b9ec Mon Sep 17 00:00:00 2001 From: Mohammed Ahmed Date: Fri, 1 May 2020 02:20:08 +0530 Subject: [PATCH] Adding messaging and script updates to ensure smoother golang updates (#3049) - Updated rpm spec and rpm-prepare script to template golang version - Docs now contain a warning about golang version update Signed-off-by: Mohammed Zeeshan Ahmed --- docs/dev/development.adoc | 7 ++++++- rpms/openshift-odo.spec | 3 ++- scripts/rpm-prepare.sh | 9 +++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/docs/dev/development.adoc b/docs/dev/development.adoc index d9a030fe2..e5585504c 100644 --- a/docs/dev/development.adoc +++ b/docs/dev/development.adoc @@ -7,7 +7,12 @@ toc::[] == Setting up -Requires *Go 1.13* +Requires *Go 1.12* + +**WARNING**: If you are adding any features that require a higher version of golang, such as golang 1.13 +for example, please contact maintainers to check of the releasing systems can handle the newer versions. + +If that is ok, please ensure you update the required golang version, both here and in the file link:/scripts/rpm-prepare.sh[`scripts/rpm-prepare.sh`] . link:https://help.github.com/en/articles/fork-a-repo[Fork] the link:https://github.com/openshift/odo[`odo`] repository. diff --git a/rpms/openshift-odo.spec b/rpms/openshift-odo.spec index 9480698c2..24e3f9615 100644 --- a/rpms/openshift-odo.spec +++ b/rpms/openshift-odo.spec @@ -3,7 +3,8 @@ %global debug_package %{nil} %global package_name openshift-odo %global product_name odo -%global golang_version 1.12 +%global golang_version ${GOLANG_VERSION} +%global golang_version_nodot ${GOLANG_VERSION_NODOT} %global odo_version ${ODO_RPM_VERSION} %global odo_release ${ODO_RELEASE} %global git_commit ${GIT_COMMIT} diff --git a/scripts/rpm-prepare.sh b/scripts/rpm-prepare.sh index 39b311655..096754805 100755 --- a/scripts/rpm-prepare.sh +++ b/scripts/rpm-prepare.sh @@ -11,12 +11,19 @@ export ODO_RELEASE=${ODO_RELEASE:=1} export GIT_COMMIT=${GIT_COMMIT:=`git rev-parse --short HEAD 2>/dev/null`} export ODO_RPM_VERSION=${ODO_VERSION//-} +# Golang version variables, if you are bumping this, please contact redhat maintainers to ensure that internal +# build systems can handle these versions +export GOLANG_VERSION=${GOLANG_VERSION:-1.12} +export GOLANG_VERSION_NODOT=${GOLANG_VERSION_NODOT:-112} + # Print env for verifcation echo "Printing envs for verification" echo "ODO_VERSION=$ODO_VERSION" echo "ODO_RELEASE=$ODO_RELEASE" echo "GIT_COMMIT=$GIT_COMMIT" echo "ODO_RPM_VERSION=$ODO_RPM_VERSION" +echo "GOLANG_VERSION=$GOLANG_VERSION" +echo "GOLANG_VERSION_NODO=$GOLANG_VERSION_NODOT" OUT_DIR=".rpmbuild" DIST_DIR="$(pwd)/dist" @@ -73,6 +80,8 @@ echo "ODO_VERSION=$ODO_VERSION" > $OUT_DIR/version echo "ODO_RELEASE=$ODO_RELEASE" >> $OUT_DIR/version echo "GIT_COMMIT=$GIT_COMMIT" >> $OUT_DIR/version echo "ODO_RPM_VERSION=$ODO_RPM_VERSION" >> $OUT_DIR/version +echo "GOLANG_VERSION=$GOLANG_VERSION" >> $OUT_DIR/version +echo "GOLANG_VERSION_NODOT=$GOLANG_VERSION_NODOT" >> $OUT_DIR/version # After success copy stuff to actual location