-
Notifications
You must be signed in to change notification settings - Fork 551
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
Conversation
@@ -1,10 +1,10 @@ | |||
#!/bin/sh | |||
set -e | |||
|
|||
export DEPLOY_BRANCH=${DEPLOY_BRANCH:-development} | |||
export PUBLISH_BRANCH=${PUBLISH_BRANCH:-master} |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
ae436ea
to
62a5d13
Compare
@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 |
62a5d13
to
bd0c726
Compare
[[ $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 |
There was a problem hiding this comment.
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 ]]
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will see
4cd09fe
to
9e0110d
Compare
9e0110d
to
5bac919
Compare
5bac919
to
f50d53d
Compare
f50d53d
to
639e0f8
Compare
6333049
to
a4ce534
Compare
a4ce534
to
fa4aa47
Compare
There was a problem hiding this 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 I'll look into possiblities and get back to you if I found a nice workaround |
git release is failing after fastlane release https://travis-ci.org/fossasia/open-event-attendee-android/builds/623111500?utm_source=github_status&utm_medium=notification |
@iamareebjamal sure, just give me a moment |
Signed-off-by: rcs10 <dhanueshrc28@gmail.com>
Fixes #2395