Deployment Tutorial?

I am looking for a good deployment tutorial for my slim apps. I am using slim 4 and now every time i want to move to server, I zip the files on my own after running the ‘composer install --no-dev --optimize-autoloader’.

Is there any good tutorial on how to automate this process with intellij or similar?

As a rule, CI/CD services are used for application deployment purposes.

Apache Ant is a free and excellent tool to automate your software build processes.

So you just need to install Ant and a project specific “build.xml” file with all the tasks to build an artifact (ZIP) file.

This Slim 4 skeleton contains such an example file. See here: build.xml

To build an artifact just run: ant build

1 Like

You can also look at deployer, which will automate the actions you doing manually now.

There’s always the option of using a deployment service such as deployhq.com it can pull from your repository and save to server

Thank you all for your replies. I went with the ant build for this app, but I am definitely checking the other methods too.

In my list it is to check how CI/CD works using github pipelines, but I just don’t trust my tests enough to setup an automated process right now :sweat_smile:

One more to look at is Phing which is much like ant but built for PHP dev environments.

if you arent looking to run a CD thing for it then you could do something like push to git (version control like github / bitbucket) - since you know :stuck_out_tongue: … no need to bring a tank when a fly swat will do right… php isnt a “built” language. so its pretty much just pull the latest files, execute composer install, run the migrations. done.

then have say a route to update your app that simply does something like: (obviously add some level of security to it…)

passthru("git pull origin master");
passthru("composer install --no-dev --optimize-autoloader");

etc

using a proper CI/CD is obviously preferred but meh… if you still using zip and stuff then ouch

you mention move servers but that only happens a very few times. updates happen WAY more often. so for moving servers it would be something like ssh to server (or open cmd) git init, git remote add origin blah, php update.php

if you use the webhooks way then its as simple as in intellij just pushing to master branch or main or whatever branch you set up the hook on and your “production” version is updated.

for me updating is: pull files, composer install (since the composer lock file is included in the repo), run through migrations. done