简体   繁体   中英

Webpack - Deploying the application to different environments

I am approaching a point where I need to have ability to deploy application to different environments (QA, Staging and Production).

Before I did it this way: - I have three servers (QA, Staging and Production). - I remote to the server - On that instance gitbash is installed and pointed to appropriate GIT branch - I simply pull the code - Run the application That worked great for Backbone and Sails project I have done.

Now in this project, I am using React and Hapi, in essence same logic. What gets me thinking is the webpack. I ended up using webpack, and it seems very powerfull. I would like to use the Webpack for this task.

I have checked online resources and documentation, but I did not find the answer that I understand.

Is it possible to make webpack automatically upload and deploy the code to environments of my choosing?

Shall I continue to use my old way, which is: - Connect to server - Pull the code - Run 'npm run webpack' on the server

Or there is more modern way of doing these things?

The most convenient way to do smth. - is always a single command line on your machine. There are a lot of tools for variety OS. May be somebody make here a list of all possibilities. But I don't think webpack is among them - webpack is just a module builder. Personally, I like git-deployments and webhooks . It works like this:

We push commits to a branch, eg release , then github-bitbucket-gitlab notifies our IIS or Azure backend(s) with Kudu installation, about the changes. And the tool automatically pulls the new commits and runs the deployment scripts. And in deployment scripts you would have your npm run webpack . That's all.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM