SlideShare ist ein Scribd-Unternehmen logo
1 von 44
Downloaden Sie, um offline zu lesen
images/logo
Developing, maintaining, and sharing software tools for research
Continuous integration
Danilo Pianini
danilo.pianini@unibo.it
Alma Mater Studiorum—Universit`a di Bologna
Ph.D. course in Data Science and Computation
June 7, 2018 - Bologna (Italy)
D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 1 / 40
images/logo
Outline
1 Introduction
2 Travis CI
3 Configuration
Basics
Security
Deployment
Complete builds
D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 2 / 40
images/logo
Introduction
Why continuous? I
Avoid the integration hell
Work in parallel
Don’t waste developers’ time with repetitive tasks
Don’t break stuff
Time is money
Software development used to take several months for “integrating” a
couple of years of development [Fow]
Historically introduced by the extreme programming (XP) community
Today used by companies that do not adopt XP
IMVU [teab] delivers its software up to 50 times per day
Google and Mozilla release at least once a day
D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 3 / 40
images/logo
Introduction
Why continuous? II
Higher frequency, lower risk [Fab]
D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 4 / 40
images/logo
Introduction
Improve over classic development I
Protoduction [teaa]
When prototype code ends up in production
Classically used with a negative meaning
It’s time to rehabilitate it
Make it easy to access and use the latest prototype
D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 5 / 40
images/logo
Introduction
Improve over classic development II
It’s compiling [Mun]
Make the building process fast!
D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 6 / 40
images/logo
Introduction
Continuous Integration software
Software that promotes the practice of continuous integration
Runs a build for every change in the project
Prepares fresh environments where the builds are hosted
Notifies the results, e.g. if a failure occurs
Provides tools for deploying the produced artifacts
Hosted CI with free plans for open source projects are blossoming:
Circle CI
Codefresh
Codeship
drone.io
Pipelines
Travis CI
Wercker
...
D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 7 / 40
images/logo
Travis CI
Travis CI
Web based
Well integrated with GitHub
Build results are displayed in the repo without intervention
Automatic build of any pull request
Free for open source projects
Cronjobs
Build instances based on Docker
Project-local configuration via YAML (in the .travis.yml file)
Out of the box support for Gradle
Dozens of deployment targets
D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 8 / 40
images/logo
Travis CI
How it works
A web-hook can be registered to your GitHub repository that triggers
Travis CI at each new commit
Travis CI starts a pristine appropriate environment
Can be a container or a full virtual machine, depending on whether
sudo is required [CI]
The project gets cloned
The configured commands are executed
The configured deployments are performed
If necessary, project managers are informed of the build status
D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 9 / 40
images/logo
Configuration Basics
Outline
1 Introduction
2 Travis CI
3 Configuration
Basics
Security
Deployment
Complete builds
D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 10 / 40
images/logo
Configuration Basics
.travis.yml
Travis uses a project-local configuration
A .travis.yml file must be in your repository root
of course, it must be tracked in git
It is a YAML file, very human-readable and easy to learn 1
Also it is a superset of JSON, so any valid JSON is a valid YAML
Supports basically any language that can get built on Linux or
MacOS
No support for Windows builds
Support for build matrix
When your project can get built using different versions of different
tools, you may want to test all of them
It’s a cartesian product of configurations
Commit once, build on every supported environment
1
https://learnxinyminutes.com/docs/yaml/
D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 10 / 40
images/logo
Configuration Basics
.travis.yml: the language section
Travis provides a number of default environments for the most
common languages
They differ by software installed by default
e.g. the C# compiler is not included if you run a Python build)
They behave differently
e.g. if Java is specified as language, the system automatically searches
for a build.gradle, a pom.xml (Maven), or an Ant build script
The first configuration required is a specification on which
environment to work in
Defaults to Ruby
For very simple projects, this might be enough of configuration
Example
language: python
D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 11 / 40
images/logo
Configuration Basics
.travis.yml: custom behavior using the script section
The default configuration may be not suitable for you
Either because you want to customize it
Or because you are using something that is not in the spectrum of
supported features
Bash commands can be configured to be executed in place of the
default behavior
Example
language: java
script:
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then bash build.sh; fi'
- 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then bash build_pull_req.sh; fi'
D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 12 / 40
images/logo
Configuration Basics
.travis.yml: distribution selection in the dist section
By default, Travis CI builds in a Ubuntu Linux environment
Ubuntu LTS is generally used
The version of Ubuntu can be selected in a dist section
At the time of writing, trusty and precise are available
Mac OS X can be used by specifying os: osx in place of dist
Example
language: python
dist: trusty
script:
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then bash build.sh; fi'
- 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then bash build_pull_req.sh; fi'
D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 13 / 40
images/logo
Configuration Basics
.travis.yml: enabling super user access
By default, Travis CI builds in a docker container
It’s way faster than a VM, especially in terms of start up time
Docker does not allow for super-user access though
Sometimes it is required
e.g. for customizing the OS by installing packages
In such case, sudo: required switches the build to a full fledged
VM with super user access
Example
language: python
dist: trusty
sudo: required
script:
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then bash build.sh; fi'
- 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then bash build_pull_req.sh; fi'
D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 14 / 40
images/logo
Configuration Basics
The build lifecycle in Travis
1 Install — Install any dependency required
1 apt addons — Optional
2 cache components — Optional
3 before install — Install additional dependencies in form of Ubuntu
packages using apt
4 install
2 Script — Run the build script
1 before script — Preparation for the build
2 script — Actual build
3 before cache — Optional
4 after success or after failure — Execute additional scripts
depending on the outcome of the build
5 before deploy — Optional, used to prepare resources to be uploaded
6 deploy — Optional, used to actually deploy the produced artifacts
7 after deploy — Optional, additional operations to be executed after
deployment
8 after script
D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 15 / 40
images/logo
Configuration Basics
.travis.yml: Example with several phases
Example
language: java
dist: trusty
sudo: required
before_install:
- sudo apt-get -qq update
- sudo apt-get install -y graphviz
before_install: echo Begin actual build
script:
- ./gradlew clean build
- ./gradlew buildDashboard
after_success: echo Build successful
after failure: sudo mail -s "Build failure" admin@company.org < /dev/null
before_deploy: echo Preparing for deploy
after_deploy: echo Deployment phase concluded.
D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 16 / 40
images/logo
Configuration Basics
Build variables I
Travis offers a number of environment variables that allow for fine tuning
the build process.
CI, TRAVIS, CONTINUOUS INTEGRATION, and
HAS JOSH K SEAL OF APPROVALa
a
Josh K. is a co-founder of Travis CI: https://twitter.com/j2h
Always set to true. Used for detecting if the build is running on the
Continuous integration environment
DEBIAN FRONTEND
Always set to noninteractive. Some scripts use it to determine whether
or not ask for user input.
D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 17 / 40
images/logo
Configuration Basics
Build variables II
USER
Always set to travis. Do not depend on this value; do not override this
value.
HOME
Always set to /home/travis. Do not depend on this value; do not
override this value.
LANG and LC ALL
Always set to en US.UTF-8.
RAILS ENV, RACK ENV, MERB ENV
Always set to test
D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 18 / 40
images/logo
Configuration Basics
Build variables III
JRUBY OPTS
Always set to "--server -Dcext.enabled=false
-Xcompile.invokedynamic=false"
JAVA HOME
Set to the appropriate value, depends on the selected JDK
TRAVIS ALLOW FAILURE
Set to true if the job is allowed to fail. Set to false if the job is not
allowed to fail.
D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 19 / 40
images/logo
Configuration Basics
Build variables IV
TRAVIS BRANCH
For push builds, or builds not triggered by a pull request, this is the name
of the branch. For builds triggered by a pull request this is the name of the
branch targeted by the pull request. For builds triggered by a tag, this is
the same as the name of the tag (TRAVIS TAG). Note that for tags, git
does not store the branch from which a commit was tagged.
TRAVIS BUILD DIR
The absolute path to the directory where the repository being built has
been copied on the worker.
TRAVIS BUILD ID
The id of the current build that Travis CI uses internally.
D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 20 / 40
images/logo
Configuration Basics
Build variables V
TRAVIS BUILD NUMBER
The number of the current build (for example, 4).
TRAVIS COMMIT
The commit that the current build is testing.
TRAVIS COMMIT MESSAGE
The commit subject and body, unwrapped.
TRAVIS COMMIT RANGE
The range of commits that were included in the push or pull request. Note
that this is empty for builds triggered by the initial commit of a new
branch.
D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 21 / 40
images/logo
Configuration Basics
Build variables VI
TRAVIS EVENT TYPE
Indicates how the build was triggered. One of push, pull request, api,
cron.
TRAVIS JOB ID
The id of the current job that Travis CI uses internally.
TRAVIS JOB NUMBER
The number of the current job (for example, 4.1).
TRAVIS OS NAME
On multi-OS builds, this value indicates the platform the job is running
on. Values are linux and osx currently, to be extended in the future.
D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 22 / 40
images/logo
Configuration Basics
Build variables VII
TRAVIS OSX IMAGE
The osx image value configured in .travis.yml. If this is not set in
.travis.yml, it is empty.
TRAVIS PULL REQUEST
The pull request number if the current job is a pull request, false if it’s
not a pull request.
TRAVIS PULL REQUEST BRANCH
If the current job is a pull request, the name of the branch from which the
PR originated. If the current job is a push build, this variable is empty.
D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 23 / 40
images/logo
Configuration Basics
Build variables VIII
TRAVIS PULL REQUEST SHA
If the current job is a pull request, the commit SHA of the HEAD commit
of the PR. If the current job is a push build, this variable is empty.
TRAVIS PULL REQUEST SLUG
If the current job is a pull request, the slug (in the form
owner name/repo name) of the repository from which the PR originated.
If the current job is a push build, this variable is empty.
TRAVIS REPO SLUG
The slug (in form: owner name/repo name) of the repository currently
being built.
D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 24 / 40
images/logo
Configuration Basics
Build variables IX
TRAVIS SECURE ENV VARS
Set to true if there are any encrypted environment variables. Set to
false if no encrypted environment variables are available.
TRAVIS SUDO
true or false based on whether sudo is enabled.
TRAVIS TEST RESULT
0 if all commands in the script section (up to the point this environment
variable is referenced) have exited with zero; 1 otherwise.
TRAVIS TAG
If the current build is for a git tag, this variable is set to the tag’s name.
D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 25 / 40
images/logo
Configuration Basics
Build variables X
TRAVIS BUILD STAGE NAME
The build stage in capitalzed form, e.g. Test or Deploy. If a build does
not use build stages, this variable is empty.
D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 26 / 40
images/logo
Configuration Security
Outline
1 Introduction
2 Travis CI
3 Configuration
Basics
Security
Deployment
Complete builds
D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 27 / 40
images/logo
Configuration Security
Sensible data in builds
It could be useful to access private data from within a build
Downloading a password-protected file
Decrypt a password-encrypted file
Open a keystore for signing a file
Store an API key for a service used e.g. for testing
Store a OAuth token for accessing a remote service
These data cannot be tracked on the repository (with the exception of
encrypted files, but the problem is simply moved to passing the decrypt
password to the build system).
These data must be provided in form of enviroment variables
Travis allows for inserting secure variables in the web interface
D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 27 / 40
images/logo
Configuration Security
Pull request attack
Usually, you want the integrator to build pull requests
You want to test the integration before committing it
What if the pull request changes the .travis.yml, printing all the
environment variables?
The developer of an open source project is defenseless
Travis CI does not allow access to secure variables when a pull request is
executed
As such, typically, the Travis build must be configured to detect
whether a pull request is being bult, and in case don’t perform tasks
that depend on secure variables
D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 28 / 40
images/logo
Configuration Security
Local Travis installation
Travis CI provides an installable module to help with several tasks
otherwise tedious:
Secure encryption of files
You may need your private key for automatic signing, but you want it
to be secret and only readable by builds you create
Secure encryption of global variables
You may need your password or username or other sensible data to
complete the deployment process, but you want it encrypted
In case of OAuth tokens, you also don’t want to waste time dealing
with it manually.
Install Travis CI locally:
1 Install RubyGems
On Arch Linux: pacman -Syu rubygems ruby-rdoc
2 Issue: gem install travis
3 Make sure your PATH includes the path where gems are installed
D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 29 / 40
images/logo
Configuration Security
Creating a secure variable
From the web interface:
Go to the settings page
Insert name and value
Select if it should be displayed on the build
Disable if the variable is meant to be secure
Use the environment variable in your build
From the local Travis CI application:
travis encrypt MY SECRET ENV=super secret
The secured variable will be printed on terminal
copy the secure="..." inside your .travis.yml
D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 30 / 40
images/logo
Configuration Security
Ecrypting a file
From the local Travis CI application:
travis encrypt-file my-super-secret-file
A new my-super-secret-file.enc file will be created
It must be added to track
The originating file must not be in track, and must never have been
(or it could be recovered): delete it immediately
copy the secure="..." inside your .travis.yml
Add the generated openssl command that appears on the terminal
to the correct phase of your build
D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 31 / 40
images/logo
Configuration Security
Don’t screw up: non-exhaustive list of advices
DO generate passwords, never use words related to the repository or
project name
DON’T use settings which duplicate commands to standard output,
such as set -x or set -v in your bash scripts
DON’T run env or printenv
DON’T echo "$SECRET_KEY"
DON’T use tools that print secrets on error output, such as php -i
DOUBLE CHECK before using git fetch or git push, as they might
expose tokens or other secure variables
DUOBLE CHECK for mistakes in string escaping
DUOBLE CHECK before using settings that increase verbosity
PREFER redirecting output to /dev/null when possible
e.g. git push url-with-secret >/dev/null 2>&1
D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 32 / 40
images/logo
Configuration Deployment
Outline
1 Introduction
2 Travis CI
3 Configuration
Basics
Security
Deployment
Complete builds
D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 33 / 40
images/logo
Configuration Deployment
GitHub Releases
Travis CI can automate deployment of artifacts on GitHub releases
Example .travis.yml configuration
deploy:
provider: releases
api_key:
secure: YOUR_API_KEY_ENCRYPTED
file: "FILE TO UPLOAD"
skip_cleanup: true
on:
tags: true
The authentication token for GitHub can be generated locally with:
travis setup releases
Remember to backup your travis file before running the command
D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 33 / 40
images/logo
Configuration Deployment
surge.sh
A free host for static websites (HTML + Javascript)
Install surge locally
Create an account (with email and password)
Create a new secret variable SURGE LOGIN
Create a new secret variable SURGE TOKEN
Obtain the value by using surge token
Example .travis.yml configuration
deploy:
provider: surge
project: ./build/docs/javadoc/
domain: myjavadoc.surge.sh
skip_cleanup: true
on:
all_branches: true
D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 34 / 40
images/logo
Configuration Deployment
Deploy to PyPI
The best place where to put your Python software modules!
Sign up to PyPI
Example .travis.yml configuration
deploy:
provider: pypi
user: "Your (possibly encrypted) username"
password:
secure: "Your encrypted password"
D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 35 / 40
images/logo
Configuration Deployment
Other targets
anynines – Appfog – Atlas – AWS CodeDeploy – AWS Elastic Beanstalk –
AWS Lambda – AWS OpsWorks – AWS S3 – Azure Web Apps – bintray –
BitBalloon – Bluemix CloudFoundry – Boxfuse – Catalyze – Chef
Supermarket – Cloud 66 – CloudFoundry – Deis – Engine Yard – GitHub
Pages – Google App Engine – Google Cloud Storage – Google Firebase –
Hackage – Heroku – Launchpad – Modulus – npm – OpenShift –
packagecloud.io – Puppet – Forge – PyPI – Rackspace Cloud Files –
RubyGems – Scalingo – Script – TestFairy – Ubuntu Snap Store –
Uploading Build Artifacts
Plus any target your build system can directly deal with (e.g. Maven
Central)
D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 36 / 40
images/logo
Configuration Complete builds
Outline
1 Introduction
2 Travis CI
3 Configuration
Basics
Security
Deployment
Complete builds
D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 37 / 40
images/logo
Configuration Complete builds
Example with Python
The default Python environment uses isolated virtualenvs
PyPy is supported out of the box
The script entry is mandatory
dependencies can be listed in a requirements.txt file
Travis automatically runs
pip install -r requirements.txt
during the install phase of the build
D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 37 / 40
images/logo
Configuration Complete builds
Java examples
Examples of rich, multi-project, multi-language, multi-target deployments
are available at:
https://github.com/AlchemistSimulator/Alchemist
https://github.com/Protelis/Protelis
D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 38 / 40
images/logo
References
References I
Travis CI.
The build environment.
https://docs.travis-ci.com/user/ci-environment/.
Accessed: 2017-05-08.
Darko Fabijan.
Why we need continuous integration.
https://semaphoreci.com/community/tutorials/continuous-integration.
Accessed: 2017-05-03.
Martin Fowler.
Continuous integration.
https://www.martinfowler.com/articles/continuousIntegration.html.
Accessed: 2017-05-02.
Randall Munroe.
xkcd: Compiling.
https://xkcd.com/303/.
Accessed: 2017-05-03.
D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 39 / 40
images/logo
References
References II
The CodingHorror team.
New programming jargon.
https://blog.codinghorror.com/new-programming-jargon/.
Accessed: 2017-05-02.
The IMVU team.
Imvu: 3d avatar free chat, make new friends, dress up, shop.
https://www.imvu.com/.
Accessed: 2017-05-02.
D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 40 / 40

Weitere ähnliche Inhalte

Ähnlich wie Continuous Integration

Enforce reproducibility: dependency management and build automation
Enforce reproducibility: dependency management and build automationEnforce reproducibility: dependency management and build automation
Enforce reproducibility: dependency management and build automationDanilo Pianini
 
Continuous integration - CI
Continuous integration - CIContinuous integration - CI
Continuous integration - CINhan Nguyen
 
Apigee deploy grunt plugin.1.0
Apigee deploy grunt plugin.1.0Apigee deploy grunt plugin.1.0
Apigee deploy grunt plugin.1.0Diego Zuluaga
 
Custom Buildpacks and Data Services
Custom Buildpacks and Data ServicesCustom Buildpacks and Data Services
Custom Buildpacks and Data ServicesTom Kranz
 
Run your Java apps on Cloud Foundry
Run your Java apps on Cloud FoundryRun your Java apps on Cloud Foundry
Run your Java apps on Cloud FoundryAndy Piper
 
Run Your Java Code on Cloud Foundry - Andy Piper (Pivotal)
Run Your Java Code on Cloud Foundry - Andy Piper (Pivotal)Run Your Java Code on Cloud Foundry - Andy Piper (Pivotal)
Run Your Java Code on Cloud Foundry - Andy Piper (Pivotal)jaxLondonConference
 
Hudson@java one2010
Hudson@java one2010Hudson@java one2010
Hudson@java one2010InfraDNA
 
8 Principles for Enabling Build/Measure/Learn: Lean Engineering in Action
8 Principles for Enabling Build/Measure/Learn: Lean Engineering in Action8 Principles for Enabling Build/Measure/Learn: Lean Engineering in Action
8 Principles for Enabling Build/Measure/Learn: Lean Engineering in ActionBill Scott
 
Flash Camp Chennai - Build automation of Flex and AIR applications
Flash Camp Chennai - Build automation of Flex and AIR applicationsFlash Camp Chennai - Build automation of Flex and AIR applications
Flash Camp Chennai - Build automation of Flex and AIR applicationsRIA RUI Society
 
FISL 2010: CruiseControl: the open source that changed the way we develop sof...
FISL 2010: CruiseControl: the open source that changed the way we develop sof...FISL 2010: CruiseControl: the open source that changed the way we develop sof...
FISL 2010: CruiseControl: the open source that changed the way we develop sof...Paulo Caroli
 
2017 03 25 Microsoft Hacks, How to code efficiently
2017 03 25 Microsoft Hacks, How to code efficiently2017 03 25 Microsoft Hacks, How to code efficiently
2017 03 25 Microsoft Hacks, How to code efficientlyBruno Capuano
 
Flutter vs Java Graphical User Interface Frameworks - text
Flutter vs Java Graphical User Interface Frameworks - textFlutter vs Java Graphical User Interface Frameworks - text
Flutter vs Java Graphical User Interface Frameworks - textToma Velev
 
Continuous Delivery for Python Developers – PyCon Otto
Continuous Delivery for Python Developers – PyCon OttoContinuous Delivery for Python Developers – PyCon Otto
Continuous Delivery for Python Developers – PyCon OttoPeter Bittner
 
Agile Network India | Continuous Integration & Continuous Deployment & Automa...
Agile Network India | Continuous Integration & Continuous Deployment & Automa...Agile Network India | Continuous Integration & Continuous Deployment & Automa...
Agile Network India | Continuous Integration & Continuous Deployment & Automa...AgileNetwork
 
Jbossworld Presentation
Jbossworld PresentationJbossworld Presentation
Jbossworld PresentationDan Hinojosa
 
Industrialization of Android Development (Concept)
Industrialization of Android Development (Concept)Industrialization of Android Development (Concept)
Industrialization of Android Development (Concept)Mohamed TAIEB
 
Comparative Development Methodologies
Comparative Development MethodologiesComparative Development Methodologies
Comparative Development Methodologieselliando dias
 

Ähnlich wie Continuous Integration (20)

Enforce reproducibility: dependency management and build automation
Enforce reproducibility: dependency management and build automationEnforce reproducibility: dependency management and build automation
Enforce reproducibility: dependency management and build automation
 
Continuous integration - CI
Continuous integration - CIContinuous integration - CI
Continuous integration - CI
 
Apigee deploy grunt plugin.1.0
Apigee deploy grunt plugin.1.0Apigee deploy grunt plugin.1.0
Apigee deploy grunt plugin.1.0
 
Custom Buildpacks and Data Services
Custom Buildpacks and Data ServicesCustom Buildpacks and Data Services
Custom Buildpacks and Data Services
 
Run your Java apps on Cloud Foundry
Run your Java apps on Cloud FoundryRun your Java apps on Cloud Foundry
Run your Java apps on Cloud Foundry
 
Run Your Java Code on Cloud Foundry - Andy Piper (Pivotal)
Run Your Java Code on Cloud Foundry - Andy Piper (Pivotal)Run Your Java Code on Cloud Foundry - Andy Piper (Pivotal)
Run Your Java Code on Cloud Foundry - Andy Piper (Pivotal)
 
Hudson@java one2010
Hudson@java one2010Hudson@java one2010
Hudson@java one2010
 
8 Principles for Enabling Build/Measure/Learn: Lean Engineering in Action
8 Principles for Enabling Build/Measure/Learn: Lean Engineering in Action8 Principles for Enabling Build/Measure/Learn: Lean Engineering in Action
8 Principles for Enabling Build/Measure/Learn: Lean Engineering in Action
 
Flash Camp Chennai - Build automation of Flex and AIR applications
Flash Camp Chennai - Build automation of Flex and AIR applicationsFlash Camp Chennai - Build automation of Flex and AIR applications
Flash Camp Chennai - Build automation of Flex and AIR applications
 
FISL 2010: CruiseControl: the open source that changed the way we develop sof...
FISL 2010: CruiseControl: the open source that changed the way we develop sof...FISL 2010: CruiseControl: the open source that changed the way we develop sof...
FISL 2010: CruiseControl: the open source that changed the way we develop sof...
 
What's new in p2 (2009)?
What's new in p2 (2009)?What's new in p2 (2009)?
What's new in p2 (2009)?
 
2017 03 25 Microsoft Hacks, How to code efficiently
2017 03 25 Microsoft Hacks, How to code efficiently2017 03 25 Microsoft Hacks, How to code efficiently
2017 03 25 Microsoft Hacks, How to code efficiently
 
Flutter vs Java Graphical User Interface Frameworks - text
Flutter vs Java Graphical User Interface Frameworks - textFlutter vs Java Graphical User Interface Frameworks - text
Flutter vs Java Graphical User Interface Frameworks - text
 
Continuous Delivery for Python Developers – PyCon Otto
Continuous Delivery for Python Developers – PyCon OttoContinuous Delivery for Python Developers – PyCon Otto
Continuous Delivery for Python Developers – PyCon Otto
 
Agile Network India | Continuous Integration & Continuous Deployment & Automa...
Agile Network India | Continuous Integration & Continuous Deployment & Automa...Agile Network India | Continuous Integration & Continuous Deployment & Automa...
Agile Network India | Continuous Integration & Continuous Deployment & Automa...
 
Jbossworld Presentation
Jbossworld PresentationJbossworld Presentation
Jbossworld Presentation
 
Industrialization of Android Development (Concept)
Industrialization of Android Development (Concept)Industrialization of Android Development (Concept)
Industrialization of Android Development (Concept)
 
Container Security Scanning by Timo Pagel
Container Security Scanning by Timo PagelContainer Security Scanning by Timo Pagel
Container Security Scanning by Timo Pagel
 
Container Security Scanning by Timo Pagel
Container Security Scanning by Timo PagelContainer Security Scanning by Timo Pagel
Container Security Scanning by Timo Pagel
 
Comparative Development Methodologies
Comparative Development MethodologiesComparative Development Methodologies
Comparative Development Methodologies
 

Mehr von Danilo Pianini

Time fluid field-based Coordination
Time fluid field-based CoordinationTime fluid field-based Coordination
Time fluid field-based CoordinationDanilo Pianini
 
Engineering the Aggregate - Talk at Software Engineering for Intelligent and ...
Engineering the Aggregate - Talk at Software Engineering for Intelligent and ...Engineering the Aggregate - Talk at Software Engineering for Intelligent and ...
Engineering the Aggregate - Talk at Software Engineering for Intelligent and ...Danilo Pianini
 
Versioning and License selection
Versioning and License selectionVersioning and License selection
Versioning and License selectionDanilo Pianini
 
Productive parallel teamwork: Decentralized Version Control Systems
Productive parallel teamwork: Decentralized Version Control SystemsProductive parallel teamwork: Decentralized Version Control Systems
Productive parallel teamwork: Decentralized Version Control SystemsDanilo Pianini
 
Computational Fields meet Augmented Reality: Perspectives and Challenges
Computational Fields meet Augmented Reality: Perspectives and ChallengesComputational Fields meet Augmented Reality: Perspectives and Challenges
Computational Fields meet Augmented Reality: Perspectives and ChallengesDanilo Pianini
 
Practical Aggregate Programming with Protelis @ SASO2017
Practical Aggregate Programming with Protelis @ SASO2017Practical Aggregate Programming with Protelis @ SASO2017
Practical Aggregate Programming with Protelis @ SASO2017Danilo Pianini
 
Towards a Foundational API for Resilient Distributed Systems Design
Towards a Foundational API for Resilient Distributed Systems DesignTowards a Foundational API for Resilient Distributed Systems Design
Towards a Foundational API for Resilient Distributed Systems DesignDanilo Pianini
 
Continuous integration and delivery
Continuous integration and deliveryContinuous integration and delivery
Continuous integration and deliveryDanilo Pianini
 
Democratic process and electronic platforms: concerns of an engineer
Democratic process and electronic platforms: concerns of an engineerDemocratic process and electronic platforms: concerns of an engineer
Democratic process and electronic platforms: concerns of an engineerDanilo Pianini
 
Simulating Large-scale Aggregate MASs with Alchemist and Scala
Simulating Large-scale Aggregate MASs with Alchemist and ScalaSimulating Large-scale Aggregate MASs with Alchemist and Scala
Simulating Large-scale Aggregate MASs with Alchemist and ScalaDanilo Pianini
 
Extending the Gillespie's Stochastic Simulation Algorithm for Integrating Dis...
Extending the Gillespie's Stochastic Simulation Algorithm for Integrating Dis...Extending the Gillespie's Stochastic Simulation Algorithm for Integrating Dis...
Extending the Gillespie's Stochastic Simulation Algorithm for Integrating Dis...Danilo Pianini
 
Protelis: Practical Aggregate Programming - Symposium on Applied Computing (S...
Protelis: Practical Aggregate Programming - Symposium on Applied Computing (S...Protelis: Practical Aggregate Programming - Symposium on Applied Computing (S...
Protelis: Practical Aggregate Programming - Symposium on Applied Computing (S...Danilo Pianini
 
Engineering Complex Computational Ecosystems (PhD defense)
Engineering Complex Computational Ecosystems (PhD defense)Engineering Complex Computational Ecosystems (PhD defense)
Engineering Complex Computational Ecosystems (PhD defense)Danilo Pianini
 
Engineering computational ecosystems (2nd year PhD seminar)
Engineering computational ecosystems (2nd year PhD seminar)Engineering computational ecosystems (2nd year PhD seminar)
Engineering computational ecosystems (2nd year PhD seminar)Danilo Pianini
 
From Engineer to Alchemist, There and Back Again: An Alchemist Tale
From Engineer to Alchemist, There and Back Again: An Alchemist TaleFrom Engineer to Alchemist, There and Back Again: An Alchemist Tale
From Engineer to Alchemist, There and Back Again: An Alchemist TaleDanilo Pianini
 
SAPERE WP1 Alchemist status at 02/2013
SAPERE WP1 Alchemist status at 02/2013SAPERE WP1 Alchemist status at 02/2013
SAPERE WP1 Alchemist status at 02/2013Danilo Pianini
 
Engineering Computational Ecosystems
Engineering Computational EcosystemsEngineering Computational Ecosystems
Engineering Computational EcosystemsDanilo Pianini
 
Recipes for Sabayon: cook your own Linux distro within two hours
Recipes for Sabayon: cook your own Linux distro within two hoursRecipes for Sabayon: cook your own Linux distro within two hours
Recipes for Sabayon: cook your own Linux distro within two hoursDanilo Pianini
 
A Framework to Specify and Verify Computational Fields for Pervasive Computin...
A Framework to Specify and Verify Computational Fields for Pervasive Computin...A Framework to Specify and Verify Computational Fields for Pervasive Computin...
A Framework to Specify and Verify Computational Fields for Pervasive Computin...Danilo Pianini
 

Mehr von Danilo Pianini (20)

Time fluid field-based Coordination
Time fluid field-based CoordinationTime fluid field-based Coordination
Time fluid field-based Coordination
 
Engineering the Aggregate - Talk at Software Engineering for Intelligent and ...
Engineering the Aggregate - Talk at Software Engineering for Intelligent and ...Engineering the Aggregate - Talk at Software Engineering for Intelligent and ...
Engineering the Aggregate - Talk at Software Engineering for Intelligent and ...
 
Versioning and License selection
Versioning and License selectionVersioning and License selection
Versioning and License selection
 
Productive parallel teamwork: Decentralized Version Control Systems
Productive parallel teamwork: Decentralized Version Control SystemsProductive parallel teamwork: Decentralized Version Control Systems
Productive parallel teamwork: Decentralized Version Control Systems
 
Computational Fields meet Augmented Reality: Perspectives and Challenges
Computational Fields meet Augmented Reality: Perspectives and ChallengesComputational Fields meet Augmented Reality: Perspectives and Challenges
Computational Fields meet Augmented Reality: Perspectives and Challenges
 
Practical Aggregate Programming with Protelis @ SASO2017
Practical Aggregate Programming with Protelis @ SASO2017Practical Aggregate Programming with Protelis @ SASO2017
Practical Aggregate Programming with Protelis @ SASO2017
 
Towards a Foundational API for Resilient Distributed Systems Design
Towards a Foundational API for Resilient Distributed Systems DesignTowards a Foundational API for Resilient Distributed Systems Design
Towards a Foundational API for Resilient Distributed Systems Design
 
Continuous integration and delivery
Continuous integration and deliveryContinuous integration and delivery
Continuous integration and delivery
 
Democratic process and electronic platforms: concerns of an engineer
Democratic process and electronic platforms: concerns of an engineerDemocratic process and electronic platforms: concerns of an engineer
Democratic process and electronic platforms: concerns of an engineer
 
Simulating Large-scale Aggregate MASs with Alchemist and Scala
Simulating Large-scale Aggregate MASs with Alchemist and ScalaSimulating Large-scale Aggregate MASs with Alchemist and Scala
Simulating Large-scale Aggregate MASs with Alchemist and Scala
 
Extending the Gillespie's Stochastic Simulation Algorithm for Integrating Dis...
Extending the Gillespie's Stochastic Simulation Algorithm for Integrating Dis...Extending the Gillespie's Stochastic Simulation Algorithm for Integrating Dis...
Extending the Gillespie's Stochastic Simulation Algorithm for Integrating Dis...
 
Protelis: Practical Aggregate Programming - Symposium on Applied Computing (S...
Protelis: Practical Aggregate Programming - Symposium on Applied Computing (S...Protelis: Practical Aggregate Programming - Symposium on Applied Computing (S...
Protelis: Practical Aggregate Programming - Symposium on Applied Computing (S...
 
Engineering Complex Computational Ecosystems (PhD defense)
Engineering Complex Computational Ecosystems (PhD defense)Engineering Complex Computational Ecosystems (PhD defense)
Engineering Complex Computational Ecosystems (PhD defense)
 
SAPERE Analysis tools
SAPERE Analysis toolsSAPERE Analysis tools
SAPERE Analysis tools
 
Engineering computational ecosystems (2nd year PhD seminar)
Engineering computational ecosystems (2nd year PhD seminar)Engineering computational ecosystems (2nd year PhD seminar)
Engineering computational ecosystems (2nd year PhD seminar)
 
From Engineer to Alchemist, There and Back Again: An Alchemist Tale
From Engineer to Alchemist, There and Back Again: An Alchemist TaleFrom Engineer to Alchemist, There and Back Again: An Alchemist Tale
From Engineer to Alchemist, There and Back Again: An Alchemist Tale
 
SAPERE WP1 Alchemist status at 02/2013
SAPERE WP1 Alchemist status at 02/2013SAPERE WP1 Alchemist status at 02/2013
SAPERE WP1 Alchemist status at 02/2013
 
Engineering Computational Ecosystems
Engineering Computational EcosystemsEngineering Computational Ecosystems
Engineering Computational Ecosystems
 
Recipes for Sabayon: cook your own Linux distro within two hours
Recipes for Sabayon: cook your own Linux distro within two hoursRecipes for Sabayon: cook your own Linux distro within two hours
Recipes for Sabayon: cook your own Linux distro within two hours
 
A Framework to Specify and Verify Computational Fields for Pervasive Computin...
A Framework to Specify and Verify Computational Fields for Pervasive Computin...A Framework to Specify and Verify Computational Fields for Pervasive Computin...
A Framework to Specify and Verify Computational Fields for Pervasive Computin...
 

Kürzlich hochgeladen

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 

Kürzlich hochgeladen (20)

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 

Continuous Integration

  • 1. images/logo Developing, maintaining, and sharing software tools for research Continuous integration Danilo Pianini danilo.pianini@unibo.it Alma Mater Studiorum—Universit`a di Bologna Ph.D. course in Data Science and Computation June 7, 2018 - Bologna (Italy) D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 1 / 40
  • 2. images/logo Outline 1 Introduction 2 Travis CI 3 Configuration Basics Security Deployment Complete builds D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 2 / 40
  • 3. images/logo Introduction Why continuous? I Avoid the integration hell Work in parallel Don’t waste developers’ time with repetitive tasks Don’t break stuff Time is money Software development used to take several months for “integrating” a couple of years of development [Fow] Historically introduced by the extreme programming (XP) community Today used by companies that do not adopt XP IMVU [teab] delivers its software up to 50 times per day Google and Mozilla release at least once a day D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 3 / 40
  • 4. images/logo Introduction Why continuous? II Higher frequency, lower risk [Fab] D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 4 / 40
  • 5. images/logo Introduction Improve over classic development I Protoduction [teaa] When prototype code ends up in production Classically used with a negative meaning It’s time to rehabilitate it Make it easy to access and use the latest prototype D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 5 / 40
  • 6. images/logo Introduction Improve over classic development II It’s compiling [Mun] Make the building process fast! D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 6 / 40
  • 7. images/logo Introduction Continuous Integration software Software that promotes the practice of continuous integration Runs a build for every change in the project Prepares fresh environments where the builds are hosted Notifies the results, e.g. if a failure occurs Provides tools for deploying the produced artifacts Hosted CI with free plans for open source projects are blossoming: Circle CI Codefresh Codeship drone.io Pipelines Travis CI Wercker ... D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 7 / 40
  • 8. images/logo Travis CI Travis CI Web based Well integrated with GitHub Build results are displayed in the repo without intervention Automatic build of any pull request Free for open source projects Cronjobs Build instances based on Docker Project-local configuration via YAML (in the .travis.yml file) Out of the box support for Gradle Dozens of deployment targets D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 8 / 40
  • 9. images/logo Travis CI How it works A web-hook can be registered to your GitHub repository that triggers Travis CI at each new commit Travis CI starts a pristine appropriate environment Can be a container or a full virtual machine, depending on whether sudo is required [CI] The project gets cloned The configured commands are executed The configured deployments are performed If necessary, project managers are informed of the build status D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 9 / 40
  • 10. images/logo Configuration Basics Outline 1 Introduction 2 Travis CI 3 Configuration Basics Security Deployment Complete builds D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 10 / 40
  • 11. images/logo Configuration Basics .travis.yml Travis uses a project-local configuration A .travis.yml file must be in your repository root of course, it must be tracked in git It is a YAML file, very human-readable and easy to learn 1 Also it is a superset of JSON, so any valid JSON is a valid YAML Supports basically any language that can get built on Linux or MacOS No support for Windows builds Support for build matrix When your project can get built using different versions of different tools, you may want to test all of them It’s a cartesian product of configurations Commit once, build on every supported environment 1 https://learnxinyminutes.com/docs/yaml/ D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 10 / 40
  • 12. images/logo Configuration Basics .travis.yml: the language section Travis provides a number of default environments for the most common languages They differ by software installed by default e.g. the C# compiler is not included if you run a Python build) They behave differently e.g. if Java is specified as language, the system automatically searches for a build.gradle, a pom.xml (Maven), or an Ant build script The first configuration required is a specification on which environment to work in Defaults to Ruby For very simple projects, this might be enough of configuration Example language: python D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 11 / 40
  • 13. images/logo Configuration Basics .travis.yml: custom behavior using the script section The default configuration may be not suitable for you Either because you want to customize it Or because you are using something that is not in the spectrum of supported features Bash commands can be configured to be executed in place of the default behavior Example language: java script: - 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then bash build.sh; fi' - 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then bash build_pull_req.sh; fi' D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 12 / 40
  • 14. images/logo Configuration Basics .travis.yml: distribution selection in the dist section By default, Travis CI builds in a Ubuntu Linux environment Ubuntu LTS is generally used The version of Ubuntu can be selected in a dist section At the time of writing, trusty and precise are available Mac OS X can be used by specifying os: osx in place of dist Example language: python dist: trusty script: - 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then bash build.sh; fi' - 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then bash build_pull_req.sh; fi' D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 13 / 40
  • 15. images/logo Configuration Basics .travis.yml: enabling super user access By default, Travis CI builds in a docker container It’s way faster than a VM, especially in terms of start up time Docker does not allow for super-user access though Sometimes it is required e.g. for customizing the OS by installing packages In such case, sudo: required switches the build to a full fledged VM with super user access Example language: python dist: trusty sudo: required script: - 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then bash build.sh; fi' - 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then bash build_pull_req.sh; fi' D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 14 / 40
  • 16. images/logo Configuration Basics The build lifecycle in Travis 1 Install — Install any dependency required 1 apt addons — Optional 2 cache components — Optional 3 before install — Install additional dependencies in form of Ubuntu packages using apt 4 install 2 Script — Run the build script 1 before script — Preparation for the build 2 script — Actual build 3 before cache — Optional 4 after success or after failure — Execute additional scripts depending on the outcome of the build 5 before deploy — Optional, used to prepare resources to be uploaded 6 deploy — Optional, used to actually deploy the produced artifacts 7 after deploy — Optional, additional operations to be executed after deployment 8 after script D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 15 / 40
  • 17. images/logo Configuration Basics .travis.yml: Example with several phases Example language: java dist: trusty sudo: required before_install: - sudo apt-get -qq update - sudo apt-get install -y graphviz before_install: echo Begin actual build script: - ./gradlew clean build - ./gradlew buildDashboard after_success: echo Build successful after failure: sudo mail -s "Build failure" admin@company.org < /dev/null before_deploy: echo Preparing for deploy after_deploy: echo Deployment phase concluded. D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 16 / 40
  • 18. images/logo Configuration Basics Build variables I Travis offers a number of environment variables that allow for fine tuning the build process. CI, TRAVIS, CONTINUOUS INTEGRATION, and HAS JOSH K SEAL OF APPROVALa a Josh K. is a co-founder of Travis CI: https://twitter.com/j2h Always set to true. Used for detecting if the build is running on the Continuous integration environment DEBIAN FRONTEND Always set to noninteractive. Some scripts use it to determine whether or not ask for user input. D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 17 / 40
  • 19. images/logo Configuration Basics Build variables II USER Always set to travis. Do not depend on this value; do not override this value. HOME Always set to /home/travis. Do not depend on this value; do not override this value. LANG and LC ALL Always set to en US.UTF-8. RAILS ENV, RACK ENV, MERB ENV Always set to test D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 18 / 40
  • 20. images/logo Configuration Basics Build variables III JRUBY OPTS Always set to "--server -Dcext.enabled=false -Xcompile.invokedynamic=false" JAVA HOME Set to the appropriate value, depends on the selected JDK TRAVIS ALLOW FAILURE Set to true if the job is allowed to fail. Set to false if the job is not allowed to fail. D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 19 / 40
  • 21. images/logo Configuration Basics Build variables IV TRAVIS BRANCH For push builds, or builds not triggered by a pull request, this is the name of the branch. For builds triggered by a pull request this is the name of the branch targeted by the pull request. For builds triggered by a tag, this is the same as the name of the tag (TRAVIS TAG). Note that for tags, git does not store the branch from which a commit was tagged. TRAVIS BUILD DIR The absolute path to the directory where the repository being built has been copied on the worker. TRAVIS BUILD ID The id of the current build that Travis CI uses internally. D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 20 / 40
  • 22. images/logo Configuration Basics Build variables V TRAVIS BUILD NUMBER The number of the current build (for example, 4). TRAVIS COMMIT The commit that the current build is testing. TRAVIS COMMIT MESSAGE The commit subject and body, unwrapped. TRAVIS COMMIT RANGE The range of commits that were included in the push or pull request. Note that this is empty for builds triggered by the initial commit of a new branch. D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 21 / 40
  • 23. images/logo Configuration Basics Build variables VI TRAVIS EVENT TYPE Indicates how the build was triggered. One of push, pull request, api, cron. TRAVIS JOB ID The id of the current job that Travis CI uses internally. TRAVIS JOB NUMBER The number of the current job (for example, 4.1). TRAVIS OS NAME On multi-OS builds, this value indicates the platform the job is running on. Values are linux and osx currently, to be extended in the future. D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 22 / 40
  • 24. images/logo Configuration Basics Build variables VII TRAVIS OSX IMAGE The osx image value configured in .travis.yml. If this is not set in .travis.yml, it is empty. TRAVIS PULL REQUEST The pull request number if the current job is a pull request, false if it’s not a pull request. TRAVIS PULL REQUEST BRANCH If the current job is a pull request, the name of the branch from which the PR originated. If the current job is a push build, this variable is empty. D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 23 / 40
  • 25. images/logo Configuration Basics Build variables VIII TRAVIS PULL REQUEST SHA If the current job is a pull request, the commit SHA of the HEAD commit of the PR. If the current job is a push build, this variable is empty. TRAVIS PULL REQUEST SLUG If the current job is a pull request, the slug (in the form owner name/repo name) of the repository from which the PR originated. If the current job is a push build, this variable is empty. TRAVIS REPO SLUG The slug (in form: owner name/repo name) of the repository currently being built. D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 24 / 40
  • 26. images/logo Configuration Basics Build variables IX TRAVIS SECURE ENV VARS Set to true if there are any encrypted environment variables. Set to false if no encrypted environment variables are available. TRAVIS SUDO true or false based on whether sudo is enabled. TRAVIS TEST RESULT 0 if all commands in the script section (up to the point this environment variable is referenced) have exited with zero; 1 otherwise. TRAVIS TAG If the current build is for a git tag, this variable is set to the tag’s name. D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 25 / 40
  • 27. images/logo Configuration Basics Build variables X TRAVIS BUILD STAGE NAME The build stage in capitalzed form, e.g. Test or Deploy. If a build does not use build stages, this variable is empty. D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 26 / 40
  • 28. images/logo Configuration Security Outline 1 Introduction 2 Travis CI 3 Configuration Basics Security Deployment Complete builds D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 27 / 40
  • 29. images/logo Configuration Security Sensible data in builds It could be useful to access private data from within a build Downloading a password-protected file Decrypt a password-encrypted file Open a keystore for signing a file Store an API key for a service used e.g. for testing Store a OAuth token for accessing a remote service These data cannot be tracked on the repository (with the exception of encrypted files, but the problem is simply moved to passing the decrypt password to the build system). These data must be provided in form of enviroment variables Travis allows for inserting secure variables in the web interface D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 27 / 40
  • 30. images/logo Configuration Security Pull request attack Usually, you want the integrator to build pull requests You want to test the integration before committing it What if the pull request changes the .travis.yml, printing all the environment variables? The developer of an open source project is defenseless Travis CI does not allow access to secure variables when a pull request is executed As such, typically, the Travis build must be configured to detect whether a pull request is being bult, and in case don’t perform tasks that depend on secure variables D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 28 / 40
  • 31. images/logo Configuration Security Local Travis installation Travis CI provides an installable module to help with several tasks otherwise tedious: Secure encryption of files You may need your private key for automatic signing, but you want it to be secret and only readable by builds you create Secure encryption of global variables You may need your password or username or other sensible data to complete the deployment process, but you want it encrypted In case of OAuth tokens, you also don’t want to waste time dealing with it manually. Install Travis CI locally: 1 Install RubyGems On Arch Linux: pacman -Syu rubygems ruby-rdoc 2 Issue: gem install travis 3 Make sure your PATH includes the path where gems are installed D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 29 / 40
  • 32. images/logo Configuration Security Creating a secure variable From the web interface: Go to the settings page Insert name and value Select if it should be displayed on the build Disable if the variable is meant to be secure Use the environment variable in your build From the local Travis CI application: travis encrypt MY SECRET ENV=super secret The secured variable will be printed on terminal copy the secure="..." inside your .travis.yml D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 30 / 40
  • 33. images/logo Configuration Security Ecrypting a file From the local Travis CI application: travis encrypt-file my-super-secret-file A new my-super-secret-file.enc file will be created It must be added to track The originating file must not be in track, and must never have been (or it could be recovered): delete it immediately copy the secure="..." inside your .travis.yml Add the generated openssl command that appears on the terminal to the correct phase of your build D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 31 / 40
  • 34. images/logo Configuration Security Don’t screw up: non-exhaustive list of advices DO generate passwords, never use words related to the repository or project name DON’T use settings which duplicate commands to standard output, such as set -x or set -v in your bash scripts DON’T run env or printenv DON’T echo "$SECRET_KEY" DON’T use tools that print secrets on error output, such as php -i DOUBLE CHECK before using git fetch or git push, as they might expose tokens or other secure variables DUOBLE CHECK for mistakes in string escaping DUOBLE CHECK before using settings that increase verbosity PREFER redirecting output to /dev/null when possible e.g. git push url-with-secret >/dev/null 2>&1 D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 32 / 40
  • 35. images/logo Configuration Deployment Outline 1 Introduction 2 Travis CI 3 Configuration Basics Security Deployment Complete builds D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 33 / 40
  • 36. images/logo Configuration Deployment GitHub Releases Travis CI can automate deployment of artifacts on GitHub releases Example .travis.yml configuration deploy: provider: releases api_key: secure: YOUR_API_KEY_ENCRYPTED file: "FILE TO UPLOAD" skip_cleanup: true on: tags: true The authentication token for GitHub can be generated locally with: travis setup releases Remember to backup your travis file before running the command D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 33 / 40
  • 37. images/logo Configuration Deployment surge.sh A free host for static websites (HTML + Javascript) Install surge locally Create an account (with email and password) Create a new secret variable SURGE LOGIN Create a new secret variable SURGE TOKEN Obtain the value by using surge token Example .travis.yml configuration deploy: provider: surge project: ./build/docs/javadoc/ domain: myjavadoc.surge.sh skip_cleanup: true on: all_branches: true D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 34 / 40
  • 38. images/logo Configuration Deployment Deploy to PyPI The best place where to put your Python software modules! Sign up to PyPI Example .travis.yml configuration deploy: provider: pypi user: "Your (possibly encrypted) username" password: secure: "Your encrypted password" D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 35 / 40
  • 39. images/logo Configuration Deployment Other targets anynines – Appfog – Atlas – AWS CodeDeploy – AWS Elastic Beanstalk – AWS Lambda – AWS OpsWorks – AWS S3 – Azure Web Apps – bintray – BitBalloon – Bluemix CloudFoundry – Boxfuse – Catalyze – Chef Supermarket – Cloud 66 – CloudFoundry – Deis – Engine Yard – GitHub Pages – Google App Engine – Google Cloud Storage – Google Firebase – Hackage – Heroku – Launchpad – Modulus – npm – OpenShift – packagecloud.io – Puppet – Forge – PyPI – Rackspace Cloud Files – RubyGems – Scalingo – Script – TestFairy – Ubuntu Snap Store – Uploading Build Artifacts Plus any target your build system can directly deal with (e.g. Maven Central) D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 36 / 40
  • 40. images/logo Configuration Complete builds Outline 1 Introduction 2 Travis CI 3 Configuration Basics Security Deployment Complete builds D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 37 / 40
  • 41. images/logo Configuration Complete builds Example with Python The default Python environment uses isolated virtualenvs PyPy is supported out of the box The script entry is mandatory dependencies can be listed in a requirements.txt file Travis automatically runs pip install -r requirements.txt during the install phase of the build D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 37 / 40
  • 42. images/logo Configuration Complete builds Java examples Examples of rich, multi-project, multi-language, multi-target deployments are available at: https://github.com/AlchemistSimulator/Alchemist https://github.com/Protelis/Protelis D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 38 / 40
  • 43. images/logo References References I Travis CI. The build environment. https://docs.travis-ci.com/user/ci-environment/. Accessed: 2017-05-08. Darko Fabijan. Why we need continuous integration. https://semaphoreci.com/community/tutorials/continuous-integration. Accessed: 2017-05-03. Martin Fowler. Continuous integration. https://www.martinfowler.com/articles/continuousIntegration.html. Accessed: 2017-05-02. Randall Munroe. xkcd: Compiling. https://xkcd.com/303/. Accessed: 2017-05-03. D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 39 / 40
  • 44. images/logo References References II The CodingHorror team. New programming jargon. https://blog.codinghorror.com/new-programming-jargon/. Accessed: 2017-05-02. The IMVU team. Imvu: 3d avatar free chat, make new friends, dress up, shop. https://www.imvu.com/. Accessed: 2017-05-02. D. Pianini (UniBo) 04 - Continuous Integration June 7, 2018 40 / 40