Dropcat - the Jenkins build
Time to part three of the Dropcat blog-series. Now it is time to get less abstract, and show what is done. In Wunderkraut Sweden we are normally using Jenkins to do deploys, but you could do it also in a script from you local machine.
Jenkins setup We are using jenkins to clone the project, and the only task we do after that is executing a shell, like this:
In the end of this series I am doing a post about our composer workflow, so I will not go into that now. First we export some variables, to use with dropcat later. PATHLocal path to composer DROPCAT_ENVWhich environment we are going to deploy, in this case stage, so dropcat will use the dropcat.stage.yml file for settings. ENVThis is a variable we are using for composer. BUILD_DATEUsed to name our deployed folder. And then the dropcat tasks dropcat prepareThis command checks if the db used for the site exists, if it does not, it tries to create it. It also creates the drush-alias used for the site etc. dropcat backupThis backups the db, if you want to backup the whole web folder, add the option -- backup_site dropcat tarPacks the site in a tar-file. The options here could be set in dropcat.stage.yml, but I think it is more useful to use Jenkins variables here. dropcat uploadUploads the tar to the remote server, and removes it from the local server. dropcat moveThis unpacks the tar file and moves it in place. And creates a symlink to the deployed folder, like mysite_latest_stage. It also deletes the uploaded tar-file. dropcat symlinkThis we are using to create the files folder, which in our setup is outside the web folder. dropcat config-importImports the configuration. dropcat reset-loginGets us a login-link to the site so we could check our deploy. In next blogpost we are starting to look into in detail what happens in each step.