Skip to content

Conversation

@adityastic
Copy link
Contributor

Fixes #2395

@auto-label auto-label bot added the chore label Oct 16, 2019
@adityastic
Copy link
Contributor Author

@iamareebjamal

set -e

export DEPLOY_BRANCH=${DEPLOY_BRANCH:-development}
export PUBLISH_BRANCH=${PUBLISH_BRANCH:-master}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use this. We can override this from environment variables

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok let me add export to the conditions

[[ $TRAVIS_PULL_REQUEST =~ ^(false)$ && $TRAVIS_REPO_SLUG =~ ^(fossasia/open-event-attendee-android)$ && $TRAVIS_BRANCH =~ ^(development|master)$ ]] && DEV_OR_MASTER_BUILD=true || DEV_OR_MASTER_BUILD=false
[[ $TRAVIS_BRANCH =~ ^(master)$ && $TRAVIS_REPO_SLUG =~ ^(fossasia/open-event-attendee-android)$ && $TRAVIS_PULL_REQUEST_SLUG =~ ^(fossasia/open-event-attendee-android)$ ]] && PR_FOR_RELEASE=true || PR_FOR_RELEASE=false

if [ "$TRAVIS_PULL_REQUEST" != "false" -o "$TRAVIS_REPO_SLUG" != "fossasia/open-event-attendee-android" ] || ! [ "$TRAVIS_BRANCH" == "$DEPLOY_BRANCH" -o "$TRAVIS_BRANCH" == "$PUBLISH_BRANCH" ]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous code is more readable, modify yours like this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great, let me try to break the conditions down

@adityastic
Copy link
Contributor Author

@iamareebjamal I've added export to both the major conditions so that they can be overridden with travis if you want. I've also broke down the conditions more precisely. Please have a look

[[ $TRAVIS_REPO_SLUG =~ ^(fossasia/open-event-attendee-android)$ ]] && IS_FOSS_SLUG=true || IS_FOSS_SLUG=false
[[ $TRAVIS_PULL_REQUEST_SLUG =~ ^(fossasia/open-event-attendee-android)$ ]] && IS_FOSS_PR=true || IS_FOSS_PR=false
[[ $TRAVIS_BRANCH =~ ^(development|master)$ && $IS_FOSS_SLUG ]] && BRANCH_DEPLOYORDEV=true || BRANCH_DEPLOYORDEV=false
[[ $TRAVIS_BRANCH =~ ^(master)$ && $IS_FOSS_SLUG ]] && IS_PUBLISH_BRANCH=true || IS_PUBLISH_BRANCH=false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not IS_PUBLISH_BRANCH = [[ $TRAVIS_BRANCH =~ ^(master)$ && $IS_FOSS_SLUG ]]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, conditional assignments don't work like this in bash. This was my first thought as well, but unfortunately.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will see

@adityastic adityastic force-pushed the patch-2395 branch 3 times, most recently from 4cd09fe to 9e0110d Compare October 18, 2019 12:25
@fossasia fossasia deleted a comment Oct 18, 2019
@fossasia fossasia deleted a comment Oct 18, 2019
@fossasia fossasia deleted a comment Oct 18, 2019
@fossasia fossasia deleted a comment Oct 18, 2019
@adityastic adityastic force-pushed the patch-2395 branch 3 times, most recently from 6333049 to a4ce534 Compare October 18, 2019 13:01
@fossasia fossasia deleted a comment Oct 18, 2019
@fossasia fossasia deleted a comment Oct 25, 2019
@fossasia fossasia deleted a comment Nov 6, 2019
Copy link
Member

@iamareebjamal iamareebjamal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving for now as I don't have much time nowadays

@iamareebjamal iamareebjamal merged commit 4dddb78 into fossasia:development Nov 7, 2019
@adityastic
Copy link
Contributor Author

@iamareebjamal I'll look into possiblities and get back to you if I found a nice workaround

@iamareebjamal
Copy link
Member

@adityastic
Copy link
Contributor Author

@iamareebjamal sure, just give me a moment

@adityastic adityastic deleted the patch-2395 branch December 10, 2019 21:01
rcs10 pushed a commit to rcs10/open-event-attendee-android that referenced this pull request Jun 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

improve script for release

2 participants