Skip to content

Commit b7ef181

Browse files
authored
Fix bitbucket sh scripts force flag (#672)
1 parent c1313d4 commit b7ef181

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

app/util/bitbucket/populate_db.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,16 @@ if [[ ! "${SUPPORTED_BITBUCKET_VERSIONS[*]}" =~ ${BITBUCKET_VERSION} ]]; then
6767
echo "e.g. ./populate_db.sh --force 6.10.0"
6868
echo "!!! Warning !!! This may break your Bitbucket instance. Also, note that downgrade is not supported by Bitbucket."
6969
# Check if --force flag is passed into command
70-
if [[ "$1" == "--force" ]]; then
70+
if [[ ${force} == 1 ]]; then
7171
# Check if version was specified after --force flag
72-
if [[ -z "$2" ]]; then
72+
if [[ -z ${version} ]]; then
7373
echo "Error: --force flag requires version after it."
7474
echo "Specify one of these versions: ${SUPPORTED_BITBUCKET_VERSIONS[*]}"
7575
exit 1
7676
fi
7777
# Check if passed Bitbucket version is in list of supported
78-
if [[ " ${SUPPORTED_BITBUCKET_VERSIONS[@]} " =~ " ${2} " ]]; then
79-
DB_DUMP_URL="${DATASETS_AWS_BUCKET}/$2/${DATASETS_SIZE}/${DB_DUMP_NAME}"
78+
if [[ " ${SUPPORTED_BITBUCKET_VERSIONS[@]} " =~ " ${version} " ]]; then
79+
DB_DUMP_URL="${DATASETS_AWS_BUCKET}/${version}/${DATASETS_SIZE}/${DB_DUMP_NAME}"
8080
echo "Force mode. Dataset URL: ${DB_DUMP_URL}"
8181
else
8282
LAST_DATASET_VERSION=${SUPPORTED_BITBUCKET_VERSIONS[${#SUPPORTED_BITBUCKET_VERSIONS[@]}-1]}

app/util/bitbucket/upload_attachments.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ if [[ ! "${SUPPORTED_BITBUCKET_VERSIONS[*]}" =~ ${BITBUCKET_VERSION} ]]; then
5050
echo "e.g. ./upload_attachments --force 6.10.0"
5151
echo "!!! Warning !!! This may broke your Bitbucket instance."
5252
# Check if --force flag is passed into command
53-
if [[ "$1" == "--force" ]]; then
53+
if [[ ${force} == 1 ]]; then
5454
# Check if passed Bitbucket version is in list of supported
55-
if [[ "${SUPPORTED_BITBUCKET_VERSIONS[*]}" =~ ${2} ]]; then
56-
ATTACHMENTS_TAR_URL="${DATASETS_AWS_BUCKET}/$2/${DATASETS_SIZE}/${ATTACHMENTS_TAR}"
55+
if [[ "${SUPPORTED_BITBUCKET_VERSIONS[*]}" =~ ${version} ]]; then
56+
ATTACHMENTS_TAR_URL="${DATASETS_AWS_BUCKET}/${version}/${DATASETS_SIZE}/${ATTACHMENTS_TAR}"
5757
echo "Force mode. Dataset URL: ${ATTACHMENTS_TAR_URL}"
5858
else
5959
LAST_DATASET_VERSION=${SUPPORTED_BITBUCKET_VERSIONS[${#SUPPORTED_BITBUCKET_VERSIONS[@]}-1]}

app/util/confluence/upload_attachments.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ fi
7373

7474
echo "Step1: Download msrcync"
7575
# https://github.com/jbd/msrsync
76-
cd ${TMP_DIR} || exit
76+
cd ${TMP_DIR} || exit 1
7777
if [[ -s msrsync ]]; then
7878
echo "msrsync already downloaded"
7979
else

app/util/jira/upload_attachments.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ fi
107107

108108
echo "Step1: Download msrcync"
109109
# https://github.com/jbd/msrsync
110-
cd ${TMP_DIR}
110+
cd ${TMP_DIR} || exit 1
111111
if [[ -s msrsync ]]; then
112112
echo "msrsync already downloaded"
113113
else

0 commit comments

Comments
 (0)