Closed Bug 1157530 Opened 9 years ago Closed 9 years ago

[Build] Add a script to build and deploy apps to GitHub Pages

Categories

(Firefox OS Graveyard :: Gaia::Build, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: drs, Assigned: drs)

References

Details

(Whiteboard: [spark])

Attachments

(4 files, 4 obsolete files)

As a workaround until we support remotely hosted apps in the Gaia build, we have to pull in pre-built apps using the 'repo' tool. The pre-built versions will live on each app's gh-pages repo. Let's add some Git hooks to trigger builds on pre-commit and pushes to gh-pages on pre-push.
Attachment #8596284 - Flags: review?(kgrandon)
Kevin, could you also add me as an owner of the fxos-build npm package, and provide a quick runthrough of everything I have to do to update the package on npm? My username is "drs".
Hmm, I've recently done something similar in another pet project of mine, and wanted to avoid the churn of dist. To do that, I implemented a script like this: https://github.com/KevinGrandon/browser/blob/44afa4203112c4ae9c584fc392a87e725809d1c4/deploy.sh

To run it, I just run "./deploy.sh". What do you think of doing an approach like that Doug?
Flags: needinfo?(kgrandon) → needinfo?(drs)
(In reply to Doug Sherk (:drs) (use needinfo?) from comment #6)
> Kevin, could you also add me as an owner of the fxos-build npm package, and
> provide a quick runthrough of everything I have to do to update the package
> on npm? My username is "drs".

I've added you to the npm package.
(In reply to Kevin Grandon :kgrandon from comment #7)
> Hmm, I've recently done something similar in another pet project of mine,
> and wanted to avoid the churn of dist. To do that, I implemented a script
> like this:
> https://github.com/KevinGrandon/browser/blob/
> 44afa4203112c4ae9c584fc392a87e725809d1c4/deploy.sh
> 
> To run it, I just run "./deploy.sh". What do you think of doing an approach
> like that Doug?

This is pretty easy to forget, and I could see us running into many problems if we're not forcing people to rebuild when they commit. I don't think that we could easily turn this script into a commit hook, but maybe I'm wrong?

Also, each app has a slightly different build process, so we'd have to have a script for each app.
Flags: needinfo?(drs)
Hmm, I don't think running a deploy.sh script is too bad, same thing we need to do for npm packages or bower tags really.

I'll take a look at this soon, I'm concerned about workflow with branches and pull requests - but maybe you have that covered.
One problem I think we'll run into with this approach is the launch_path for the manifest. For github pages, we need something relative like './index.html' or '/appname/dist/app/index.html', but this makes the manifest invalid (see bug 1119050), or not debuggable using webIDE in the second case. We should probably push to have bug 1119050 here since it's obsolete anyway, which needs bug 1108570.

I don't like that we are removing the automatic lint checking by default and requiring each app to specify it's own pre-commit hook. Is that just because some apps need apm and others don't?

Also, what happens if the pre-commit hook modifies dist? It seems we don't ensure this will get staged/committed and ultimately pushed to gh-pages?
(In reply to Kevin Grandon :kgrandon from comment #10)
> Hmm, I don't think running a deploy.sh script is too bad, same thing we need
> to do for npm packages or bower tags really.
> 
> I'll take a look at this soon, I'm concerned about workflow with branches
> and pull requests - but maybe you have that covered.

Yeah, I agree, this doesn't handle those cases. I'll switch to using a deploy script.

(In reply to Michael Henretty [:mhenretty] from comment #11)
> One problem I think we'll run into with this approach is the launch_path for
> the manifest. For github pages, we need something relative like
> './index.html' or '/appname/dist/app/index.html', but this makes the
> manifest invalid (see bug 1119050), or not debuggable using webIDE in the
> second case. We should probably push to have bug 1119050 here since it's
> obsolete anyway, which needs bug 1108570.

We requested a fxosapps.org domain for doing app.fxosapps.org -> fxos.github.io/app redirects.

> I don't like that we are removing the automatic lint checking by default and
> requiring each app to specify it's own pre-commit hook. Is that just because
> some apps need apm and others don't?

Yes, and the Customizer's 'custombuild' script.
I wonder if we could have a 'npm run build' script as a convention that built each app? Individual apps could hook into it via package.json to do whatever additional steps they need to do? Thoughts?
Comment on attachment 8596284 [details] [review]
[Build] Include post-commit and pre-push hooks.

Seems like the approach is changing, so clearing flag for now. Re-flag me when ready, thanks.
Attachment #8596284 - Flags: review?(kgrandon)
Summary: [Build] Build apps when committing and push the built version of them to gh-pages → [Build] Add a script to build and deploy apps to GitHub Pages
Attachment #8596284 - Attachment is obsolete: true
Attachment #8596638 - Flags: review?(kgrandon)
Attachment #8596285 - Attachment is obsolete: true
Attachment #8596285 - Flags: review?(jdarcangelo)
Attachment #8596639 - Flags: review?(jdarcangelo)
Attachment #8596291 - Attachment is obsolete: true
Attachment #8596291 - Flags: review?(jdarcangelo)
Attachment #8596640 - Flags: review?(jdarcangelo)
Attachment #8596289 - Attachment is obsolete: true
Attachment #8596289 - Flags: review?(mhenretty)
Attachment #8596645 - Flags: review?(mhenretty)
Comment on attachment 8596639 [details] [review]
[Sharing] Add an |npm run build| command and update fxos-build dependency.

LGTM
Attachment #8596639 - Flags: review?(jdarcangelo) → review+
Comment on attachment 8596640 [details] [review]
[Customizer] Add an |npm run build| command and update fxos-build dependency.

LGTM
Attachment #8596640 - Flags: review?(jdarcangelo) → review+
Comment on attachment 8596638 [details] [review]
[Build] Add a script to build and deploy apps to GitHub pages.

Hot stuff. Thanks!
Attachment #8596638 - Flags: review?(kgrandon) → review+
Comment on attachment 8596645 [details] [review]
[Hackerplace] Add an |npm run build| command and update fxos-build dependency.

Like it.
Attachment #8596645 - Flags: review?(mhenretty) → review+
Comment on attachment 8596638 [details] [review]
[Build] Add a script to build and deploy apps to GitHub pages.

https://github.com/fxos/build/commit/8c434cd188ea575eb6eab97f70502489b280fb5f
Comment on attachment 8596645 [details] [review]
[Hackerplace] Add an |npm run build| command and update fxos-build dependency.

https://github.com/fxos/directory/commit/4223eec70f2ec128832343cb1d0e517575f624bd
Comment on attachment 8596639 [details] [review]
[Sharing] Add an |npm run build| command and update fxos-build dependency.

https://github.com/fxos/sharing/commit/ce4775760cd92715b1e825d1dd5ee2c830eb900a
Comment on attachment 8596640 [details] [review]
[Customizer] Add an |npm run build| command and update fxos-build dependency.

https://github.com/fxos/customizer/commit/369a08777cbfa6dbf922542b59d381d06576826d
Status: NEW → RESOLVED
Closed: 9 years ago
Component: Gaia → Gaia::Build
Resolution: --- → FIXED
Re-opening this since we need the same changes to the Achievements app. [1] Yura, could you take this?

[1] https://github.com/fxos/achievements
Status: RESOLVED → REOPENED
Flags: needinfo?(yzenevich)
Resolution: FIXED → ---
https://github.com/fxos/achievements/commit/3092738b4c8f6ec39ee3e6b32292469f6d6675fb
Status: REOPENED → RESOLVED
Closed: 9 years ago9 years ago
Flags: needinfo?(yzenevich)
Resolution: --- → FIXED
Whiteboard: [ignite] → [spark]
Blocks: spark-build
No longer blocks: spark
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: