Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

chore(travis): fix deploy conditions #16296

Merged
merged 1 commit into from
Oct 25, 2017
Merged

Conversation

Narretz
Copy link
Contributor

@Narretz Narretz commented Oct 24, 2017

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

What is the current behavior? (You can also link to an open issue here)

What is the new behavior (if this is a feature change)?

Does this PR introduce a breaking change?

Please check if the PR fulfills these requirements

Other information:

@@ -62,6 +64,8 @@ case "$JOB" in
# - or the branch distTag from package.json is "latest" (i.e. stable branch)
if [[ "$TRAVIS_TAG" != '' || "$TRAVIS_BRANCH" == master || "$DIST_TAG" == latest ]]; then
DEPLOY_CODE=true
else
DEPLOY_CODE=false
fi

if [[ "$DEPLOY_DOCS" || "$DEPLOY_CODE" ]]; then
Copy link
Member

Choose a reason for hiding this comment

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

I think this will always evaluate to true, even if both are false (because false is truthy 😃)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's right, good catch. Bash script doesn't have boolean true / false.
You can see here how this condition fails, but the actual deploy conditions are correct: https://travis-ci.org/angular/angular.js/jobs/290626171

@@ -90,5 +99,5 @@ jobs:
on:
repo: angular/angular.js
all_branches: true
condition: $DEPLOY_CODE
condition: "$DEPLOY_CODE == true"
Copy link
Member

Choose a reason for hiding this comment

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

Are you sure this works? (I would expect this to always evaluate to true).
Maybe condition: env(DEPLOY_CODE) = true?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that works. https://unix.stackexchange.com/a/16110
I've just added the quote marks to make it explicit that this belongs together. The quote marks are only for yaml.

Copy link
Member

Choose a reason for hiding this comment

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

I was referring to accessing $DEPLOY_CODE directly. I thought these docs applied to condition as well, but I now see it is only for ifs. These docs apply to condition, so it is fine indeed 😃

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I was less than thrilled when I noticed that they are using a special language for the deploy conditions. I should visit them some time and chew them out for lack of consistency ... (they are from Berlin)

@@ -78,7 +87,7 @@ jobs:
on:
repo: angular/angular.js
all_branches: true
condition: $DEPLOY_DOCS
condition: "$DEPLOY_DOCS == true"
Copy link
Member

Choose a reason for hiding this comment

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

Are you sure this works? (I would expect this to always evaluate to true).
Maybe condition: env(DEPLOY_DOCS) = true?

@Narretz Narretz merged commit 202f180 into angular:master Oct 25, 2017
@Narretz Narretz deleted the chore-fix-deploy branch October 25, 2017 08:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants