From 589ad957cfc839f5969e719cbc91f93f7d161570 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Thu, 12 Jul 2018 11:21:46 +0200 Subject: [PATCH 1/3] Update action so it also sets a version for all the runner files. --- actions/st2_prep_release_for_st2.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/actions/st2_prep_release_for_st2.sh b/actions/st2_prep_release_for_st2.sh index 92539112..870d5ff2 100644 --- a/actions/st2_prep_release_for_st2.sh +++ b/actions/st2_prep_release_for_st2.sh @@ -77,7 +77,12 @@ files=( "st2client/st2client/__init__.py" ) -for f in "${files[@]}" +# Add all the runners +runner_init_files=($(find contrib/runners -maxdepth 3 -name __init__.py -not -path "*tests*" -not -path "*query*" -not -path "*callback*" -not -path "*functions*")) + +init_files=("${files[@]}" "${runner_init_files[@]}") + +for f in "${init_files[@]}" do if [[ ! -e "$f" ]]; then >&2 echo "ERROR: Version file ${f} does not exist." From 968abcd3cdaeb9f83c92e9eb1364a47956ddbc89 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Thu, 12 Jul 2018 14:41:49 +0200 Subject: [PATCH 2/3] Also update action which sets version for patch release and use consistent upper case variable names. --- actions/st2_chg_ver_for_st2.sh | 10 +++++++--- actions/st2_prep_release_for_st2.sh | 6 +++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/actions/st2_chg_ver_for_st2.sh b/actions/st2_chg_ver_for_st2.sh index 58fbc123..901da247 100644 --- a/actions/st2_chg_ver_for_st2.sh +++ b/actions/st2_chg_ver_for_st2.sh @@ -38,14 +38,18 @@ git clone -b ${BRANCH} --single-branch ${GIT_REPO} ${LOCAL_REPO} cd ${LOCAL_REPO} echo "Currently at directory `pwd`..." - # SET ST2 VERSION INFO -INIT_FILES=( +COMMON_INIT_FILES=( "st2common/st2common/__init__.py" "st2client/st2client/__init__.py" ) -for INIT_FILE in "${INIT_FILES[@]}" +# Add all the runners +RUNNER_INIT_FILES=($(find contrib/runners -maxdepth 3 -name __init__.py -not -path "*tests*" -not -path "*query*" -not -path "*callback*" -not -path "*functions*")) + +ALL_INIT_FILES=("${COMMON_INIT_FILES[@]}" "${RUNNER_INIT_FILES[@]}") + +for INIT_FILE in "${ALL_INIT_FILES[@]}" do if [[ ! -e "${INIT_FILE}" ]]; then >&2 echo "ERROR: Version file ${INIT_FILE} does not exist." diff --git a/actions/st2_prep_release_for_st2.sh b/actions/st2_prep_release_for_st2.sh index 870d5ff2..7c5d844d 100644 --- a/actions/st2_prep_release_for_st2.sh +++ b/actions/st2_prep_release_for_st2.sh @@ -72,15 +72,15 @@ fi echo "Creating new branch ${BRANCH}..." git checkout -b ${BRANCH} origin/master -files=( +COMMON_INIT_FILES=( "st2common/st2common/__init__.py" "st2client/st2client/__init__.py" ) # Add all the runners -runner_init_files=($(find contrib/runners -maxdepth 3 -name __init__.py -not -path "*tests*" -not -path "*query*" -not -path "*callback*" -not -path "*functions*")) +RUNNER_INIT_FILES=($(find contrib/runners -maxdepth 3 -name __init__.py -not -path "*tests*" -not -path "*query*" -not -path "*callback*" -not -path "*functions*")) -init_files=("${files[@]}" "${runner_init_files[@]}") +ALL_INIT_FILES=("${COMMON_INIT_FILES[@]}" "${RUNNER_INIT_FILES[@]}") for f in "${init_files[@]}" do From d76f171fe1855a7c266f97f341316233a05ed8af Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Tue, 17 Jul 2018 21:00:55 +0200 Subject: [PATCH 3/3] Log a message, also specify mindepth argument. --- actions/st2_chg_ver_for_st2.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/actions/st2_chg_ver_for_st2.sh b/actions/st2_chg_ver_for_st2.sh index 901da247..07ccbd0d 100644 --- a/actions/st2_chg_ver_for_st2.sh +++ b/actions/st2_chg_ver_for_st2.sh @@ -45,12 +45,14 @@ COMMON_INIT_FILES=( ) # Add all the runners -RUNNER_INIT_FILES=($(find contrib/runners -maxdepth 3 -name __init__.py -not -path "*tests*" -not -path "*query*" -not -path "*callback*" -not -path "*functions*")) +RUNNER_INIT_FILES=($(find contrib/runners -mindepth 3 -maxdepth 3 -name __init__.py -not -path "*tests*" -not -path "*query*" -not -path "*callback*" -not -path "*functions*")) ALL_INIT_FILES=("${COMMON_INIT_FILES[@]}" "${RUNNER_INIT_FILES[@]}") for INIT_FILE in "${ALL_INIT_FILES[@]}" do + echo "Setting version in: ${INIT_FILE}" + if [[ ! -e "${INIT_FILE}" ]]; then >&2 echo "ERROR: Version file ${INIT_FILE} does not exist." exit 1