Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: improve bash script for release #2396

Merged
merged 3 commits into from Nov 7, 2019

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

@@ -1,10 +1,10 @@
#!/bin/sh
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


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

@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
Signed-off-by: rcs10 <dhanueshrc28@gmail.com>
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