简体   繁体   中英

How to get started in automated deployment

I have an app (built with laravel) which i deployed it and working very well, but i have a question, when i deploy it the server i made these process :

1- minify css and js files and comine them in a single file

2- changing some configuration (database,hostname,mail sever ,etc ...)

3- Finally i upload my files to the server.

how can i return back to my local config and unminify my js and css files without doing it manually ?

is there a better way to make it automated ? i know that the first step can be done by gulp or any javascript task runner by a single command and the second one is not a big deal ,but i just want to know if there an automated way?

Why don't you just have a .env config file out of you version control and compress your CSS/JS using Laravel Mix as a part of your deploy process?

To make it clear:

  1. Keep your .env file in .gitignore . Thus you have to setup your environment settings only once (database, hostname, etc).

  2. Use npm run prod to minify your CSS/JS: https://laravel.com/docs/5.4/mix

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