-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Update data automatically and enable staging deployment #488
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced May 2, 2020
phalt
approved these changes
May 10, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PRs are ready, I would start by reading this one and then moving to PokeAPI/deploy#10
This PR will be used to describe major changes in the way we update our application pokeapi.co seen as a whole (API+frontpage+docs).
Right now to deploy the API we need to run a script on our PCs and then merge a PR. The script requires docker, takes a long time and when it's done will open a PR towards PokeAPI/api-data with the new data. The new data there is actually impossible to visualize since thousands of files were probably updated. So this PR proposes two solutions to our two problems:
masterbranchHow?
Part of this PR adds a way to update productive data effortlessly. It uses the old
updater botand runs it in CircleCI, then pushes the new data to aPokeAPI/api-databranch (calledstaging) and opens a Pull Request in theapi-datarepository, asking to mergestagingintomaster.The workflow is:
PokeAPI/pokeapiis merged in themasterbranch, thus themasteris pushed/committedResources/scripts/updater.shBasically the two scripts generate new data using the updated
masterbranch ofPokeAPI/pokeapiand push it toPokeAPI/api-data'sstagingbranch, the push is done by the new pokeapi-machine-user. A cool thing is that the new machine user will keep us updated about how things are going inside CircleCI. It is programmed to send some messages to the recently merged PR.PokeAPI/api-datafrom thestagingbranch into themasterone. This is cool because thestagingbranch will be deployed in a new Firebase staging environment thanks to the other PRs linked down below. So we will be able to check how our updated application as a whole (API+frontpage+docs) will look like.stagingintomasterlooks like you have it here: API data update fromPokeAPI/pokeapi#488api-data#41, over there I forced astagingdeployment ofPokeAPI/pokeapi'scircleci-hookbranch even though it should have run only on themasterbranch, but it was only for testing. Normally the deployment will be done only if themastergets pushed.I think this workflow works well because it takes completely away the hassle of generating the data manually and the risk of deploying broken stuff.
An additional workflow allows us to deploy in the staging environment the content of a PR that hasn't been merged yet. In fact whenever
PokeAPI/pokeapiorPokeAPI/pokeapi.co'sstagingbranches get pushed a new staging deployment will be triggered. So suppose an external user sends us a PR, we will just need to push it to thestagingbranch and in 45 minutes we will have the staging environment reflecting the new changes that PR brings in.This PR is linked to the following PRs:
When PokeAPI/deploy#10 will be merged we need to change
Resources/scripts/updater.sh#90and.circleci/config.yml#43This PR should be merged after PokeAPI/deploy#10 and PokeAPI/api-data#42