Slide 1

Slide 1 text

Build Promotion with Jenkins Friday, January 16, 15

Slide 2

Slide 2 text

Thanks To... Dan Holmes Vijay Joseph Mark Short Kohsuke Kawaguchi Friday, January 16, 15

Slide 3

Slide 3 text

Kevin O’Brien O’Brien Consulting, Inc. Human Factors Engineering obrien-consulting.com [email protected] Friday, January 16, 15

Slide 4

Slide 4 text

Why do all that work? What can Jenkins do? What does it look like? Friday, January 16, 15

Slide 5

Slide 5 text

Why? “who broke the build” Friday, January 16, 15

Slide 6

Slide 6 text

Why? Friday, January 16, 15

Slide 7

Slide 7 text

Why? Friday, January 16, 15

Slide 8

Slide 8 text

Why? Friday, January 16, 15

Slide 9

Slide 9 text

Why? Friday, January 16, 15 With Jenkins, you know when things happen

Slide 10

Slide 10 text

Why? Friday, January 16, 15 With Jenkins, an umpire looks at every unit test and line of developer-written code that comes into the GIT master branch

Slide 11

Slide 11 text

Why? Friday, January 16, 15 With Jenkins, confidence that the code is right goes up

Slide 12

Slide 12 text

What? Orchestrating Continuous Integration Friday, January 16, 15

Slide 13

Slide 13 text

What? Commit: unit & quality tests Same artifacts throughout the build Version Control Source code Env. & Config Artifact Repository Acceptance: functional tests User Testing Capacity Testing Production Friday, January 16, 15 Code & Configuration come from Version control, Artifact Repository delivers the same code and configuration throughout the build.

Slide 14

Slide 14 text

What? Jenkins Jobs Friday, January 16, 15 Projects (labeled here as Job01… through Job08… to list them in order of execution) instruct Jenkins to perform work on the application code.

Slide 15

Slide 15 text

What? Jenkins Build Promotion Friday, January 16, 15 Promotions group Projects into a sequence of work to be done. This promotion starts by building the code artifacts and ends with deploying the artifacts to production

Slide 16

Slide 16 text

What? PHP Code Quality Friday, January 16, 15 PHP code quality tools can be executed in a project

Slide 17

Slide 17 text

What? PHP Unit Tests Friday, January 16, 15 PHP code unit test tools can be executed in a project

Slide 18

Slide 18 text

What? Transfer Archive and Run Deploy Friday, January 16, 15 Jenkins can send artifacts and execute shell scripts over SSH to deploy code to web & application servers

Slide 19

Slide 19 text

What? See Promotion Progress Friday, January 16, 15 The Build History shows the work done for each of the builds (each time Jenkins pulled code from GIT). Each star represents one step in the build promotion process.

Slide 20

Slide 20 text

What Else? PHP QA Tools - Lint smartyLint PHPLOC PHP_Depend PHP Mess Detector PHP_CodeSniffer PHP Copy/Paste Detector PHPUnit phpDox Friday, January 16, 15 http://jenkins-php.org http://phpqatools.org

Slide 21

Slide 21 text

What Else? Jenkins Plugins - promoted-builds git copy artifact execute shell record fingerprints publish over ssh thinbackup workspace cleanup disk-usage Friday, January 16, 15

Slide 22

Slide 22 text

What Else? Shell Scripts - Test: deployCode dropDb deployDb seedDataTables Production: updateDb deployCode Friday, January 16, 15

Slide 23

Slide 23 text

What Else? Java (Oracle V Open) Composer build.xml Vagrant/VirtualBox/puphpet SSH authentication Environment Database Migration (phinx.org) Database Seeding (custom) File & Directory Permissions Users, Groups, Sudoers Friday, January 16, 15

Slide 24

Slide 24 text

Looks Like... Orchestrating Continuous Integration Friday, January 16, 15

Slide 25

Slide 25 text

Looks Like... Build Trigger Developer WorkStation Remote GIT Repo Jenkins Push/Pull “Master” GIT hook Post- Receive on “Master” Friday, January 16, 15 Developer pushes code changes to the master branch in the remote GIT repository. A “hook” in the application’s repository tells Jenkins that the master branch has changed. Jenkins pulls the code, builds a repository and runs code quality jobs.

Slide 26

Slide 26 text

Looks Like... Deploy Application Jenkins Test Server Production Server SSH move archive run deploy.sh Production Db Test Db Friday, January 16, 15 On direct, user input, Jenkins copies code to the Test or Production server, deploys code and runs database operations by running shell scripts on the servers.

Slide 27

Slide 27 text

References: Sources PHP • https:/ /puphpet.com • https:/ /www.vagrantup.com • https:/ /getcomposer.org • http:/ /phpqatools.org Jenkins • http:/ /jenkins-ci.org • https:/ /wiki.jenkins-ci.org/display/JENKINS/ Friday, January 16, 15

Slide 28

Slide 28 text

References: How Tos PHP quality testing in Jenkins • http:/ /jenkins-php.org • http:/ /erichogue.ca/2011/05/php/continuous- integration-in-php/ Deploy with Promotions in Jenkins • https:/ /www.youtube.com/watch? v=aAE1UqWJB2U Friday, January 16, 15