CI Build Docs Improvements#4014
Conversation
| desc "Builds the docs" | ||
| private_lane :generate_docs_shared do |
There was a problem hiding this comment.
nitpick: I'd call this one "build docs" and the other one "build_and_deploy" to reuse the language from other lanes
Also, having generate_docs be the one that both builds and deploys was not my brightest naming moment, feel free to rename
There was a problem hiding this comment.
Done! We now have the public lanes build_docs and build_and_publish_docs, and a private lane build_docs_shared.
| Dir.mktmpdir do |docs_repo_clone_dir| | ||
| Dir.chdir(docs_repo_clone_dir) do | ||
| sh("git", "clone", docs_repo_url) | ||
| Dir.chdir(docs_repo_name) do | ||
| # copy docs generated in the previous step into the docs folder | ||
| # and push the changes | ||
| docs_destination_folder = "docs/#{version_number}" | ||
| FileUtils.cp_r @docs_generation_folder + "/.", docs_destination_folder | ||
| docs_files.each do |file| |
There was a problem hiding this comment.
I'd forgotten about this particular rube goldberg machine
There was a problem hiding this comment.
This is definitely one where ChatGPT helped me understand it 100% times faster :D
joshdholtz
left a comment
There was a problem hiding this comment.
Looks good! Just some improvement on some Ruby return values
| hosting_base_path = File.join(docs_repo_name, version_number) | ||
|
|
||
| Dir.mktmpdir do |docs_generation_folder| | ||
| @docs_generation_folder = docs_generation_folder |
There was a problem hiding this comment.
I'd prefer not to use a local variable here if possible 😇 I'd just return this value out of all of these blocks
private_lane :build_docs_shared do
docs_path = Dir.mktmpdir do |docs_generation_folder|
# do the stuff
docs_generation_folder # returning path from block
end
docs_path # returning path from lane
end
lane :build_and_publish_docs do
docs_generation_folder = build_docs_shared
# do stuff
endThere was a problem hiding this comment.
Love this, done! :D
**This is an automatic release.** ### New Features * Paywalls with custom purchase and restore logic handlers (#3973) via James Borthwick (@jamesrb1) ### Bugfixes * Prevent paywall PurchaseHandler from being cleared on rerender (#4035) via Josh Holtz (@joshdholtz) * Update Purchase Tester for 5.0.0 (#4015) via Will Taylor (@fire-at-will) ### Dependency Updates * Bump fastlane from 2.221.0 to 2.221.1 (#3977) via dependabot[bot] (@dependabot[bot]) ### Other Changes * Bring official `xcodes` back to CI (#4029) via Cesar de la Vega (@vegaro) * Paywalls tester with sandbox purchases (#4024) via James Borthwick (@jamesrb1) * Update v5 migration guide to contain current latest version (#4019) via Toni Rico (@tonidero) * CI Build Docs Improvements (#4014) via Will Taylor (@fire-at-will) * Use available resource class for backend-integration-tests-offline-job (#4013) via Will Taylor (@fire-at-will) * Add `X-Preferred-Locales` header (#4008) via Cesar de la Vega (@vegaro) --------- Co-authored-by: Toni Rico <antonio.rico.diez@revenuecat.com> Co-authored-by: Josh Holtz <me@joshholtz.com>
**This is an automatic release.** ### New Features * Paywalls with custom purchase and restore logic handlers (#3973) via James Borthwick (@jamesrb1) ### Bugfixes * Prevent paywall PurchaseHandler from being cleared on rerender (#4035) via Josh Holtz (@joshdholtz) * Update Purchase Tester for 5.0.0 (#4015) via Will Taylor (@fire-at-will) ### Dependency Updates * Bump fastlane from 2.221.0 to 2.221.1 (#3977) via dependabot[bot] (@dependabot[bot]) ### Other Changes * Bring official `xcodes` back to CI (#4029) via Cesar de la Vega (@vegaro) * Paywalls tester with sandbox purchases (#4024) via James Borthwick (@jamesrb1) * Update v5 migration guide to contain current latest version (#4019) via Toni Rico (@tonidero) * CI Build Docs Improvements (#4014) via Will Taylor (@fire-at-will) * Use available resource class for backend-integration-tests-offline-job (#4013) via Will Taylor (@fire-at-will) * Add `X-Preferred-Locales` header (#4008) via Cesar de la Vega (@vegaro) --------- Co-authored-by: Toni Rico <antonio.rico.diez@revenuecat.com> Co-authored-by: Josh Holtz <me@joshholtz.com>
Motivation
The doc building process can be fragile at times, and since we only build the docs when we make a deployment, we can be unaware when changes in individual PRs can break our docs' build. This PR aims to make changes that break the docs building process visible earlier in the development cycle to help avoid tricky failures during deployments.
Description
This PR makes two main changes to how docs are built in the CI process:
5.0-devwas merged intomainrecently.docs-buildinto two separate jobs:docs-build: Only builds the docs, and is run on each build.docs-deploy: Builds and deploys the docs. Replaces the olddocs-buildjob and is only run in the deploy pipeline.generate_docslane into two separate lanes and one private lane:generate_docs: This now only builds the docs by running thegenerate_docs_sharedlanegenerate_and_publish_docs: Builds the docs by running thegenerate_docs_sharedlane and then publishing the docsTesting
I've been able to test the
docs-buildjob in this PR, but haven't been able to fully test thegenerate_and_publish_docsjob since we haven't executed another deployment since 5.0.0. If anyone has any ideas to testgenerate_and_publish_docs, let me know! 😄