Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Deploy To XXX button #1852

Open
Ghalleb opened this issue Aug 18, 2017 · 18 comments
Open

Deploy To XXX button #1852

Ghalleb opened this issue Aug 18, 2017 · 18 comments

Comments

@Ghalleb
Copy link
Contributor

Ghalleb commented Aug 18, 2017

Hi,

Are you planning to put back the "one click deployment" button like there was in 0.4.X version? It was for Bluemix and there was a tutorial for Pivotal Web Service (https://github.com/meanjs/mean/blob/0.4.x/manifest.yml).
I know it was because Cloud Foundry was evolving too fast. But some platform are now more stable.

It could be a "deploy to heroku" button (https://devcenter.heroku.com/articles/heroku-button) which is simple or perhaps we could use Google Cloud Launcher (https://cloud.google.com/launcher/docs/).

If you didn't plan it but still want it, I can manage to do it myself.

Have a good day.

@simison
Copy link
Member

simison commented Aug 18, 2017

I don't think nobody has anything against such buttons but it really boils down to maintaining them actively.

Bluemix got removed here; #1476

If nobody from the core team is using those services, it's hard to follow their changes and no deploy button is better than broken deploy button.

@Ghalleb I'd say go for it if you really can commit to long term support for such feature; follow their blogs/changelogs and update changes to here within reasonable timeframe.

@Ghalleb
Copy link
Contributor Author

Ghalleb commented Aug 18, 2017

@simison
I have no problem commiting on that as I'm plannig to use Mean.js for my future projects.
First let me decide between Heroku and GCP.
Heroku could have a "deploy to" button but GCP is a more packaged solution that need to be set on their page.
If you have a preference, feel free to share it...

@simison
Copy link
Member

simison commented Aug 18, 2017

@lirantal @mleanos thoughts?

@lirantal
Copy link
Member

Nothing against it if we can maintain it.

@Ghalleb
Copy link
Contributor Author

Ghalleb commented Aug 21, 2017

I did the deploy to Heroku button.

I had to trick a little bit the script because some dependencies needed to deploy in prod are in the devDependencies only when Heroku install only prod dependencies.
And I really wanted to deploy a production version of Mean.js.

I will take a look at the Google Cloud Platform soon.

Have a good day.

@simison
Copy link
Member

simison commented Aug 21, 2017

I had to trick a little bit the script because some dependencies needed to deploy in prod are in the devDependencies

@lirantal @mleanos any reason to keep those dependencies at devDependencies if they're needed to prod-build?

@Ghalleb
Copy link
Contributor Author

Ghalleb commented Aug 21, 2017

I added a config var: "NPM_CONFIG_PRODUCTION": "false" so the npm install will install all dependencies instead of production ones....

@simison
Copy link
Member

simison commented Aug 21, 2017

@Ghalleb I think it's better to move those dependencies to right place. Wanna PR since you're at it? :-)

@Ghalleb
Copy link
Contributor Author

Ghalleb commented Aug 21, 2017

I think it's really not that simple. It was my first idea in fact. So I started to move
"gulp": "~3.9.1",
"gulp-load-plugins": "~1.5.0",
"gulp-protractor": "^4.0.0",
"del": "^3.0.0",
"run-sequence": "~2.1.0",
"karma": "~1.7.0",
...
And then I stopped because those have nothing to do with a Production environment.
I think that the Gulp script for Production are launching unit tests and Lint before deploying.
Perhaps another good solution would be to hook "npm prune --production" on Heroku "postdeploy" event.

@simison
Copy link
Member

simison commented Aug 21, 2017

"gulp": "~3.9.1",
"gulp-load-plugins": "~1.5.0",
"del": "^3.0.0",
"run-sequence": "~2.1.0",

These should be required by prod (prod can be run via gulp task). Karma etc surely shouldn't be there but I don't see how Gulpfile would required it for prod task? Are you sure prod build failed on missing Karma?

@Ghalleb
Copy link
Contributor Author

Ghalleb commented Aug 21, 2017

Easy to test:
NPM_CONFIG_PRODUCTION=true npm install
NPM_CONFIG_PRODUCTION=true npm run start:prod

@Ghalleb
Copy link
Contributor Author

Ghalleb commented Aug 21, 2017

> gulp prod

module.js:472
    throw err;
    ^

Error: Cannot find module 'imagemin-pngquant'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/ghalleb/WebstormProjects/mean/gulpfile.js:20:14)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)

npm ERR! Linux 4.10.0-30-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "start:prod"
npm ERR! node v7.10.1
npm ERR! npm  v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! meanjs@0.5.0 start:prod: `gulp prod`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the meanjs@0.5.0 start:prod script 'gulp prod'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the meanjs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     gulp prod
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs meanjs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls meanjs
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:

Then
Error: Cannot find module 'gulp-protractor'
Error: Cannot find module 'karma'
Error: Cannot find module 'gulp-angular-templatecache'

@simison
Copy link
Member

simison commented Aug 21, 2017

Gotcha. I think I got this fixed locally, I'll PR.

@simison
Copy link
Member

simison commented Aug 21, 2017

@Ghalleb feel free to test with changes from #1855

@Ghalleb
Copy link
Contributor Author

Ghalleb commented Aug 21, 2017

I will...

@Ghalleb
Copy link
Contributor Author

Ghalleb commented Aug 21, 2017

I tested, it seems ok.
I updated my PR

@Ghalleb
Copy link
Contributor Author

Ghalleb commented Aug 26, 2017

I just discovered that you can't write file to heroku...
Each time you restart the dyno, file are erased as a new virtual machine is created. So the profile picture disappear.
I will try to add an S3 upload soon in a PR.

@Ghalleb
Copy link
Contributor Author

Ghalleb commented Aug 27, 2017

Done in #1857
We can now save pictures to S3

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants