Using a Jenkinsfile to configure the Jenkins build job for source code is great. Jenkins has a very nice Docker Pipeline plugin that makes it possible to execute docker commands nicely during the build.
However, a lot of the examples at https://jenkins.io/doc/book/pipeline/docker/ keep it very simple. They start and stop in one pipeline stage, with methods like docker.inside or docker.withRun. For example, building a container, running it, executing commands in it and destroy it, all within one stage. For several use cases this is fine, but for building an application Docker container, it is much nicer More >
Minikube is great for having a Kubernetes cluster as local Docker development environment. In a development workflow you probably have source code on your host machine and it would be great if the Docker containers in the Kubernetes cluster could mount this. So changes made to the code can be tested and are visible quickly. The steps on this blog post are tested with Minikube version v0.28.0.
Mounting is possible for example with:
And by using hostPath in the volume.
For a client I automated the patching process of Linux operating systems and middleware. I create a python action for that in StackStorm. The script retrieved all servers from the CMDB and patched per data center.
Non cluster hosts parallel
All non cluster hosts where patched in parallel with the Python ParallelSSHClient.
Cluster hosts rolling upgrade
For hosts in a cluster it’s a bit harder. The minimum amount of nodes in a cluster is most of the time 3 and only one node can be down without downtime of the cluster. So a rolling upgrade is More >
Two years ago I wrote a tutorial to install a complete Postfix mail server with Dovecot, SpamAssassin and ViMbAdmin. At the moment I am automating this tutorial for CentOS 7 with Chef. For ViMbAdmin I created a recipe that clones the ViMbAdmin repository from Github, puts the configuration files from templates, creates the database, tables and inserts an admin user into the database. I thought it would be nice to share my vimbadmin recipe:
If you do a lot of Chef development, you are creating cookbooks with recipes. But also converging, testing and destroying virtual machines with Test Kitchen that uses Vagrant. In this process, virtual machines are often destroyed and build from the ground up. For every new build, all of the yum or debian packages must be downloaded and installed again. If your internet connection is not blazing fast, this will certainly slow down your work tempo a lot.
Install and configure Squid
Capistrano is great for deploying web applications. But the “current” symlink construction causes issues with PHP-FPM and OPcache enabled. PHP-FPM will display old pages after deployment or PHP-FPM just hangs. The hanging / freeze will result in your browser loading for minutes but you will just see a white screen.
To fix this, use $realpath_root instead of $document_root and set the SCRIPT_FILENAME in Nginx to pass to PHP-FPM.
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; fastcgi_param DOCUMENT_ROOT $realpath_root;
This will pass the actual path “releases/20150208145800″ to PHP-FPM instead of “current” that is switched to the new release directory. OPcache can’t detect More >
When you write unit tests with PHPUnit there is a big chance that you have to mock several objects. If you want to write a unit test for your controller action and you use Doctrine ORM in your project, you will have to mock the Doctrine EntityManager, specific repositories and specify return values of the repository method calls. In the example below a repository method calls are “getCustomers” and “getNewHouse”.
The use of $this->at() (not possible)
Mocking multiple calls to the same method can be a bit difficult with PHPUnit. Because if you have More >