Build

Updated on 28 Dec 2018

Introduction

For our build, we will invoke a series of shell scripts to copy files from the jenkins/workspace to our deployment space.

deploy/deploy.sh

#!/bin/sh 

echo 'WHOAMI '
whoami

# I need the local version of codecept installed in the workspace so that I can get the reports.
# either use --xml or --html
composer install
./vendor/bin/codecept run unit --xml

This shell script will install codeception in the jenkins workspace and then run the codeception unit tests with the output going to XML. These outputs go to /tests/_output directory.

The first run

The first build will take a while because composer needs to install codeception. Once it has been installed and run, things run a lot quicker.

Here we can see 2 successful runs of our build. The first run takes a while because it is installing codeception. The second run is a lot quicker because codeception is already installed.

Clicking on the 2nd row gives us our log file. We can see in our log file a connection to our git repo is being made, and codeception is running a series of tests.

In the next section, we’ll look at conditional builds and how we can continue with deployment if all our tests pass.