Skip to content

ci(aio): deploy from CI to staging#14102

Merged
IgorMinar merged 2 commits into
angular:masterfrom
gkalpak:angular.io-staging
Jan 27, 2017
Merged

ci(aio): deploy from CI to staging#14102
IgorMinar merged 2 commits into
angular:masterfrom
gkalpak:angular.io-staging

Conversation

@gkalpak

@gkalpak gkalpak commented Jan 25, 2017

Copy link
Copy Markdown
Member

TODO (not as part of this PR):

  • Add proper build/pre-deploy task.
  • Add tests.

  • Set up Firebase project.
  • Update angular.io/.firebaserc with the project ID.
  • Set up FIREBASE_TOKEN env var in Travis.

  • Set up notifications for failed deployment of angular.io
  • (Possibly set up a Slack WebHook for something like slack-notify.)

@googlebot

Copy link
Copy Markdown

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that they're okay with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

@gkalpak gkalpak changed the title docs: deploy from CI to staging WIP - docs: deploy from CI to staging Jan 25, 2017
@gkalpak gkalpak force-pushed the angular.io-staging branch 2 times, most recently from 4200aae to 72cc04e Compare January 25, 2017 18:24
@gkalpak gkalpak changed the title WIP - docs: deploy from CI to staging docs: deploy from CI to staging Jan 25, 2017

@IgorMinar IgorMinar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

there reset looks good!

please rebase since my PR that this was based on now landed. thanks!

Comment thread angular.io/package.json Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I caught this earlier today and fixed it.

my PR has landed so you can now rebase and get this PR ready to be merged.

Comment thread scripts/ci-lite/install.sh Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

oops. thanks

Comment thread angular.io/package.json Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

do we have to use "public"?

I'd rather have this directory to be named an a way where it's clear to everyone that it contains build artifacts. we already use "dist" in this repo. Could we use that name?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Switched to dist/.

Comment thread angular.io/package.json Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

isn't this going to leak the token via console output?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think not (unless I missed your point). code.material.angular.org has a similar configuration. The console output (as you can see for example here) contains $FIREBASE_TOKEN (not the actual value of the FIREBASE_TOKEN env var).

The slight difference is that they are running the command directly and not through an npm script, but I tried it locally (on Ubuntu 16.04) and it is the same (it logs $FIREBASE_TOKEN, not the value).

Comment thread angular.io/package.json Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we'll also need to setup the FIREBASE_TOKEN, right?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Right. I assume this has to be set up as an env var in Repository Settings on Travis.

Comment thread angular.io/package.json Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

could we rename this task to something that we wouldn't try to run from terminal?

the task doesn't set the environment to deploy, so whatever is set to be the current firebase environment that will be used as the target and that could result in some bad surprises (accidental push to production).

I would typically add a weird prefix or suffix to this name task name: ~~deploy or deploy~~

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done.

@gkalpak gkalpak force-pushed the angular.io-staging branch from 72cc04e to ceb59b3 Compare January 26, 2017 07:20
@googlebot

Copy link
Copy Markdown

CLAs look good, thanks!

@gkalpak gkalpak force-pushed the angular.io-staging branch 6 times, most recently from 44eec69 to a9f21b5 Compare January 26, 2017 08:52
Comment thread .travis.yml Outdated

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This will cache the yarn-cache directory (according to this).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

great

@gkalpak

gkalpak commented Jan 26, 2017

Copy link
Copy Markdown
Member Author

I dealt with the comments. I also added a fixup commit that:

  1. Caches yarn-cache and angular.io/node_modules on Travis.
  2. Globally installs yarn and angular.io/ dependencies (for CI_MODE: angular_io).

One last thing that needs to be determined:

Currently, the deployment to angular.io-staging happens in the after_success script. This means that the exit code does not affect the exit code of the build. For example, if the build is successful and all tests pass, but the deployment fails (because for example the Firebase token is not set up correctly), the build will still be marked as successful.

Initially, it seemed like a good idea, so that master does not appear as broken because of some unrelated issue, but now deployment problems will go unnoticed. We either need to send a notification if the deployment fails or make the whole build fail as well (e.g. move the deployment logic from after_script to script).

WDYT?

@gkalpak gkalpak changed the title docs: deploy from CI to staging ci(aio): deploy from CI to staging Jan 26, 2017
@gkalpak

gkalpak commented Jan 26, 2017

Copy link
Copy Markdown
Member Author

It doesn't seem to be possible to send notifications from Travis based on custom condition (e.g. if the deployment succeeded or failed). Only based on the overall build status (success/failure) 😞

@gkalpak

gkalpak commented Jan 26, 2017

Copy link
Copy Markdown
Member Author

Another idea is to use something like slack-notify (or similar) to send a Slack notifications manually.

@IgorMinar IgorMinar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can you also rebase and resolve conflicts please?

Comment thread scripts/ci-lite/install.sh Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can you use "aio" instead of angular_io, let's use aio everywhere in commit messages and logs.

Comment thread scripts/ci-lite/install.sh Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

aio

Comment thread scripts/ci-lite/test.sh Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

aio

Comment thread .travis.yml Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

great

@gkalpak gkalpak force-pushed the angular.io-staging branch 3 times, most recently from 001dcfd to f4445ef Compare January 27, 2017 13:37
@gkalpak

gkalpak commented Jan 27, 2017

Copy link
Copy Markdown
Member Author

Rebased and taken care of the comments.

@gkalpak gkalpak force-pushed the angular.io-staging branch 3 times, most recently from 2490ef0 to c7e97a4 Compare January 27, 2017 21:08
@gkalpak gkalpak force-pushed the angular.io-staging branch 2 times, most recently from dc65507 to 7af12b9 Compare January 27, 2017 21:19
@gkalpak gkalpak force-pushed the angular.io-staging branch from 7af12b9 to 59bdb0f Compare January 27, 2017 21:36
@IgorMinar IgorMinar added action: merge The PR is ready for merge by the caretaker pr_state: LGTM labels Jan 27, 2017
@IgorMinar

Copy link
Copy Markdown
Contributor

ci error is an unrelated flake

@IgorMinar IgorMinar merged commit 8960d49 into angular:master Jan 27, 2017
@gkalpak gkalpak deleted the angular.io-staging branch January 28, 2017 20:35
@angular-automatic-lock-bot

Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Sep 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker cla: yes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants