SlideShare a Scribd company logo
1 of 31
Download to read offline
CI and CD
Nette Camp 27.8.2016
Key concepts
4 Continuous Delivery (CD)
4 Continuous Integration (CI)
4 Continuous Deployment
Continuous Integration
Continuous Integration (CI)
4 is a development practice that requires developers
to integrate code into a shared repository several
times a day. Each check-in is then verified by an
automated build, allowing teams to detect problems
early.
Continuous Delivery
Continuous Delivery
4 is a software development discipline where you build
software in such a way that the software can be
released to production at any time.
Continuous Deployment
Continuous Deployment
4 means that every change goes through the pipeline
and automatically gets put into production,
resulting in many production deployments every day.
How we do Continuous
Delivery in Apiary
Continuous Integration
Engines
Key features from CIE
4 job definitions in repository
4 autoscaling on traffic with lowest possible price
4 pipelines
4 caching for installations (apt, npm, gem, composer,
docker)
4 docker support (registry, caching layers)
4 matrix builds (OSS)
Job definitions in
repository
sudo: "required"
dist: "trusty"
language: "node_js"
node_js:
- "0.10"
- "0.12"
- "4"
- "6"
env:
global:
# GH_TOKEN and NPM_TOKEN encrypted by 'travis encrypt' utility
- secure: "<<<TOKEN>>>"
cache:
directories:
- "node_modules"
before_install:
- "npm -g install npm@latest"
- "gem install travis"
- "curl -Lo travis_after_all.py https://raw.githubusercontent.com/dmakhno/travis_after_all/master/travis_after_all.py"
before_script:
- "npm run lint"
script:
- "npm test"
- "npm run test:hooks-handlers"
after_success: # travis_after_all.py is needed due to travis-ci/travis-ci#1548 & travis-ci/travis-ci#929
- "npm run coveralls"
- "python travis_after_all.py"
- "export $(cat .to_export_back)"
- "npm run semantic-release || true"
node('node') {
currentBuild.result = "SUCCESS"
try {
stage 'Checkout'
checkout scm
stage 'Test'
env.NODE_ENV = "test"
print "Environment will be : ${env.NODE_ENV}"
sh 'node -v'
sh 'npm prune'
sh 'npm install'
sh 'npm test'
stage 'Build Docker'
sh './dockerBuild.sh'
stage 'Deploy'
echo 'Push to Repo'
sh './dockerPushToRepo.sh'
echo 'ssh to web server and tell it to pull new image'
sh 'ssh deploy@xxxxx.xxxxx.com running/xxxxxxx/dockerRun.sh'
stage 'Cleanup'
echo 'prune and cleanup'
sh 'npm prune'
sh 'rm node_modules -rf'
mail body: 'project build successful',
from: 'xxxx@yyyyy.com',
replyTo: 'xxxx@yyyy.com',
subject: 'project build successful',
to: 'yyyyy@yyyy.com'
}
catch (err) {
currentBuild.result = "FAILURE"
mail body: "project build error: ${err}" ,
from: 'xxxx@yyyy.com',
replyTo: 'yyyy@yyyy.com',
subject: 'project build failed',
to: 'zzzz@yyyyy.com'
throw err
}
}
Autoscaling
Pipelines
Caching
Docker support
machine:
services:
- docker
dependencies:
override:
- docker info
- docker build -t circleci/elasticsearch .
test:
override:
- docker run -d -p 9200:9200 circleci/elasticsearch; sleep 10
- curl --retry 10 --retry-delay 5 -v http://localhost:9200
deployment:
hub:
branch: master
commands:
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
- docker push circleci/elasticsearch
Matrix builds
matrix:
GO_VERSION:
- 1.4
- 1.3
REDIS_VERSION:
- 2.6
- 2.8
- 3.0
Distributed job across
multiple nodes
Q & A
Ladislav Prskavec
ladislav@prskavec.net
@abtris

More Related Content

What's hot

Docker session I: Continuous integration, delivery and deployment
Docker session I: Continuous integration, delivery and deploymentDocker session I: Continuous integration, delivery and deployment
Docker session I: Continuous integration, delivery and deployment
Degendra Sivakoti
 
Avoiding surprises with Chef and Vagrant
Avoiding surprises with Chef and VagrantAvoiding surprises with Chef and Vagrant
Avoiding surprises with Chef and Vagrant
andygale
 

What's hot (20)

CI/CD Using Ansible and Jenkins for Infrastructure
CI/CD Using Ansible and Jenkins for InfrastructureCI/CD Using Ansible and Jenkins for Infrastructure
CI/CD Using Ansible and Jenkins for Infrastructure
 
Docker - modern platform for developement and operations
Docker - modern platform for developement and operationsDocker - modern platform for developement and operations
Docker - modern platform for developement and operations
 
Paris Container Day 2016 : Cloud de conteneurs, conteneurs dans le cloud, str...
Paris Container Day 2016 : Cloud de conteneurs, conteneurs dans le cloud, str...Paris Container Day 2016 : Cloud de conteneurs, conteneurs dans le cloud, str...
Paris Container Day 2016 : Cloud de conteneurs, conteneurs dans le cloud, str...
 
Puppet Camp Sydney 2015: Puppet and AWS is easy right.....?
Puppet Camp Sydney 2015: Puppet and AWS is easy right.....? Puppet Camp Sydney 2015: Puppet and AWS is easy right.....?
Puppet Camp Sydney 2015: Puppet and AWS is easy right.....?
 
Getting up and running with Docker
Getting up and running with DockerGetting up and running with Docker
Getting up and running with Docker
 
Simplestack
SimplestackSimplestack
Simplestack
 
Docker & GitLab
Docker & GitLabDocker & GitLab
Docker & GitLab
 
Docker e git lab
Docker e git labDocker e git lab
Docker e git lab
 
what is docker
what is dockerwhat is docker
what is docker
 
Workshop - Golang language
Workshop - Golang languageWorkshop - Golang language
Workshop - Golang language
 
Introduction to ansible
Introduction to ansibleIntroduction to ansible
Introduction to ansible
 
Docker session I: Continuous integration, delivery and deployment
Docker session I: Continuous integration, delivery and deploymentDocker session I: Continuous integration, delivery and deployment
Docker session I: Continuous integration, delivery and deployment
 
Ferrara Linux Day 2011
Ferrara Linux Day 2011Ferrara Linux Day 2011
Ferrara Linux Day 2011
 
Ondřej Procházka - Deployment podle Devel.cz
Ondřej Procházka - Deployment podle Devel.czOndřej Procházka - Deployment podle Devel.cz
Ondřej Procházka - Deployment podle Devel.cz
 
NDC Oslo - The Hybrid Docker Swarm
NDC Oslo - The Hybrid Docker SwarmNDC Oslo - The Hybrid Docker Swarm
NDC Oslo - The Hybrid Docker Swarm
 
Test Kitchen and Infrastructure as Code
Test Kitchen and Infrastructure as CodeTest Kitchen and Infrastructure as Code
Test Kitchen and Infrastructure as Code
 
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
 
Avoiding surprises with Chef and Vagrant
Avoiding surprises with Chef and VagrantAvoiding surprises with Chef and Vagrant
Avoiding surprises with Chef and Vagrant
 
Node.js Internals and V8 / Operating System Interaction
Node.js Internals and V8 / Operating System InteractionNode.js Internals and V8 / Operating System Interaction
Node.js Internals and V8 / Operating System Interaction
 
Kubernetes x PaaS – コンテナアプリケーションのNoOpsへの挑戦
Kubernetes x PaaS – コンテナアプリケーションのNoOpsへの挑戦Kubernetes x PaaS – コンテナアプリケーションのNoOpsへの挑戦
Kubernetes x PaaS – コンテナアプリケーションのNoOpsへの挑戦
 

Viewers also liked

Pædagogikumsudtalelse
PædagogikumsudtalelsePædagogikumsudtalelse
Pædagogikumsudtalelse
Njal Laursen W
 
Letter from KK Nielsen
Letter from KK NielsenLetter from KK Nielsen
Letter from KK Nielsen
Daniel Pacurar
 

Viewers also liked (12)

Pædagogikumsudtalelse
PædagogikumsudtalelsePædagogikumsudtalelse
Pædagogikumsudtalelse
 
Match nsw waratahs vs highlanders direct streaming
Match nsw waratahs vs highlanders direct streamingMatch nsw waratahs vs highlanders direct streaming
Match nsw waratahs vs highlanders direct streaming
 
Letter from KK Nielsen
Letter from KK NielsenLetter from KK Nielsen
Letter from KK Nielsen
 
Reduce Risk with Digital Preparedness
Reduce Risk with Digital Preparedness  Reduce Risk with Digital Preparedness
Reduce Risk with Digital Preparedness
 
Nmus bio sf_june_8_2016_final
Nmus bio sf_june_8_2016_finalNmus bio sf_june_8_2016_final
Nmus bio sf_june_8_2016_final
 
ICT Applied to Crisis Management and Seismic Risk Assessment for Post Event M...
ICT Applied to Crisis Management and Seismic Risk Assessment for Post Event M...ICT Applied to Crisis Management and Seismic Risk Assessment for Post Event M...
ICT Applied to Crisis Management and Seismic Risk Assessment for Post Event M...
 
Lekts 6
Lekts 6Lekts 6
Lekts 6
 
32754131 recent-trends-in-automobile-seminar
32754131 recent-trends-in-automobile-seminar32754131 recent-trends-in-automobile-seminar
32754131 recent-trends-in-automobile-seminar
 
Automobile safety
Automobile safetyAutomobile safety
Automobile safety
 
Medicinal chemistry (drug metabolism & concept of prodrug) corrected
Medicinal chemistry (drug metabolism & concept of prodrug) correctedMedicinal chemistry (drug metabolism & concept of prodrug) corrected
Medicinal chemistry (drug metabolism & concept of prodrug) corrected
 
Prodrugs
ProdrugsProdrugs
Prodrugs
 
Export products
Export productsExport products
Export products
 

Similar to CI and CD

Similar to CI and CD (20)

Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?
 
DevOps Workflow: A Tutorial on Linux Containers
DevOps Workflow: A Tutorial on Linux ContainersDevOps Workflow: A Tutorial on Linux Containers
DevOps Workflow: A Tutorial on Linux Containers
 
Service Delivery Assembly Line with Vagrant, Packer, and Ansible
Service Delivery Assembly Line with Vagrant, Packer, and AnsibleService Delivery Assembly Line with Vagrant, Packer, and Ansible
Service Delivery Assembly Line with Vagrant, Packer, and Ansible
 
Jenkins Days - Workshop - Let's Build a Pipeline - Los Angeles
Jenkins Days - Workshop - Let's Build a Pipeline - Los AngelesJenkins Days - Workshop - Let's Build a Pipeline - Los Angeles
Jenkins Days - Workshop - Let's Build a Pipeline - Los Angeles
 
ASP.NET 5 auf Raspberry PI & docker
ASP.NET 5 auf Raspberry PI & dockerASP.NET 5 auf Raspberry PI & docker
ASP.NET 5 auf Raspberry PI & docker
 
(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines
 
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
 
Ansible is the simplest way to automate. SymfonyCafe, 2015
Ansible is the simplest way to automate. SymfonyCafe, 2015Ansible is the simplest way to automate. SymfonyCafe, 2015
Ansible is the simplest way to automate. SymfonyCafe, 2015
 
Pynvme introduction
Pynvme introductionPynvme introduction
Pynvme introduction
 
Antons Kranga Building Agile Infrastructures
Antons Kranga   Building Agile InfrastructuresAntons Kranga   Building Agile Infrastructures
Antons Kranga Building Agile Infrastructures
 
PhoneGap Day 2016 EU: Creating the Ideal Cordova Dev Environment
PhoneGap Day 2016 EU: Creating the Ideal Cordova Dev EnvironmentPhoneGap Day 2016 EU: Creating the Ideal Cordova Dev Environment
PhoneGap Day 2016 EU: Creating the Ideal Cordova Dev Environment
 
CI
CICI
CI
 
Automate Your Automation | DrupalCon Vienna
Automate Your Automation | DrupalCon ViennaAutomate Your Automation | DrupalCon Vienna
Automate Your Automation | DrupalCon Vienna
 
Spinnaker Summit 2018: CI/CD Patterns for Kubernetes with Spinnaker
Spinnaker Summit 2018: CI/CD Patterns for Kubernetes with SpinnakerSpinnaker Summit 2018: CI/CD Patterns for Kubernetes with Spinnaker
Spinnaker Summit 2018: CI/CD Patterns for Kubernetes with Spinnaker
 
Embacing service-level-objectives of your microservices in your Cl/CD
Embacing service-level-objectives of your microservices in your Cl/CDEmbacing service-level-objectives of your microservices in your Cl/CD
Embacing service-level-objectives of your microservices in your Cl/CD
 
Integrating Infrastructure as Code into a Continuous Delivery Pipeline | AWS ...
Integrating Infrastructure as Code into a Continuous Delivery Pipeline | AWS ...Integrating Infrastructure as Code into a Continuous Delivery Pipeline | AWS ...
Integrating Infrastructure as Code into a Continuous Delivery Pipeline | AWS ...
 
Continuous Integration & Development with Gitlab
Continuous Integration & Development with GitlabContinuous Integration & Development with Gitlab
Continuous Integration & Development with Gitlab
 
Drupaljam 2017 - Deploying Drupal 8 onto Hosted Kubernetes in Google Cloud
Drupaljam 2017 - Deploying Drupal 8 onto Hosted Kubernetes in Google CloudDrupaljam 2017 - Deploying Drupal 8 onto Hosted Kubernetes in Google Cloud
Drupaljam 2017 - Deploying Drupal 8 onto Hosted Kubernetes in Google Cloud
 
Small Python Tools for Software Release Engineering
Small Python Tools for Software Release EngineeringSmall Python Tools for Software Release Engineering
Small Python Tools for Software Release Engineering
 
One commit, one release. Continuously delivering a Symfony project.
One commit, one release. Continuously delivering a Symfony project.One commit, one release. Continuously delivering a Symfony project.
One commit, one release. Continuously delivering a Symfony project.
 

More from Ladislav Prskavec

More from Ladislav Prskavec (20)

SRE in Apiary
SRE in ApiarySRE in Apiary
SRE in Apiary
 
Modern Web Architecture<br>based on JS, API and Markup
Modern Web Architecture<br>based on JS, API and MarkupModern Web Architecture<br>based on JS, API and Markup
Modern Web Architecture<br>based on JS, API and Markup
 
How you can kill Wordpress!
How you can kill Wordpress!How you can kill Wordpress!
How you can kill Wordpress!
 
SRE in Startup
SRE in StartupSRE in Startup
SRE in Startup
 
Datascript: Serverless Architetecture
Datascript: Serverless ArchitetectureDatascript: Serverless Architetecture
Datascript: Serverless Architetecture
 
Serverless Architecture
Serverless ArchitectureServerless Architecture
Serverless Architecture
 
PragueJS meetups 30th anniversary
PragueJS meetups 30th anniversaryPragueJS meetups 30th anniversary
PragueJS meetups 30th anniversary
 
How to easy deploy app into any cloud
How to easy deploy app into any cloudHow to easy deploy app into any cloud
How to easy deploy app into any cloud
 
GDGSCL - Docker a jeho provoz v Heroku a AWS
GDGSCL - Docker a jeho provoz v Heroku a AWSGDGSCL - Docker a jeho provoz v Heroku a AWS
GDGSCL - Docker a jeho provoz v Heroku a AWS
 
AWS Elastic Container Service
AWS Elastic Container ServiceAWS Elastic Container Service
AWS Elastic Container Service
 
Comparison nodejs frameworks using Polls API
Comparison nodejs frameworks using Polls APIComparison nodejs frameworks using Polls API
Comparison nodejs frameworks using Polls API
 
Docker Elastic Beanstalk
Docker Elastic BeanstalkDocker Elastic Beanstalk
Docker Elastic Beanstalk
 
Docker včera, dnes a zítra
Docker včera, dnes a zítraDocker včera, dnes a zítra
Docker včera, dnes a zítra
 
Tessel is a microcontroller that runs JavaScript.
Tessel is a microcontroller that runs JavaScript.Tessel is a microcontroller that runs JavaScript.
Tessel is a microcontroller that runs JavaScript.
 
Docker.io
Docker.ioDocker.io
Docker.io
 
Docker.io
Docker.ioDocker.io
Docker.io
 
AngularJS
AngularJSAngularJS
AngularJS
 
Firebase and AngularJS
Firebase and AngularJSFirebase and AngularJS
Firebase and AngularJS
 
AngularJS at PyVo
AngularJS at PyVoAngularJS at PyVo
AngularJS at PyVo
 
Tvorba javascriptové aplikace v AngularJS pomocí Apiary.io
Tvorba javascriptové aplikace v AngularJS pomocí Apiary.ioTvorba javascriptové aplikace v AngularJS pomocí Apiary.io
Tvorba javascriptové aplikace v AngularJS pomocí Apiary.io
 

Recently uploaded

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
giselly40
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

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
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
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
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
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
 
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
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 

CI and CD

  • 1. CI and CD Nette Camp 27.8.2016
  • 2. Key concepts 4 Continuous Delivery (CD) 4 Continuous Integration (CI) 4 Continuous Deployment
  • 4. Continuous Integration (CI) 4 is a development practice that requires developers to integrate code into a shared repository several times a day. Each check-in is then verified by an automated build, allowing teams to detect problems early.
  • 6. Continuous Delivery 4 is a software development discipline where you build software in such a way that the software can be released to production at any time.
  • 8. Continuous Deployment 4 means that every change goes through the pipeline and automatically gets put into production, resulting in many production deployments every day.
  • 9. How we do Continuous Delivery in Apiary
  • 10.
  • 11.
  • 12.
  • 14.
  • 15. Key features from CIE 4 job definitions in repository 4 autoscaling on traffic with lowest possible price 4 pipelines 4 caching for installations (apt, npm, gem, composer, docker) 4 docker support (registry, caching layers) 4 matrix builds (OSS)
  • 17. sudo: "required" dist: "trusty" language: "node_js" node_js: - "0.10" - "0.12" - "4" - "6" env: global: # GH_TOKEN and NPM_TOKEN encrypted by 'travis encrypt' utility - secure: "<<<TOKEN>>>" cache: directories: - "node_modules" before_install: - "npm -g install npm@latest" - "gem install travis" - "curl -Lo travis_after_all.py https://raw.githubusercontent.com/dmakhno/travis_after_all/master/travis_after_all.py" before_script: - "npm run lint" script: - "npm test" - "npm run test:hooks-handlers" after_success: # travis_after_all.py is needed due to travis-ci/travis-ci#1548 & travis-ci/travis-ci#929 - "npm run coveralls" - "python travis_after_all.py" - "export $(cat .to_export_back)" - "npm run semantic-release || true"
  • 18. node('node') { currentBuild.result = "SUCCESS" try { stage 'Checkout' checkout scm stage 'Test' env.NODE_ENV = "test" print "Environment will be : ${env.NODE_ENV}" sh 'node -v' sh 'npm prune' sh 'npm install' sh 'npm test' stage 'Build Docker' sh './dockerBuild.sh' stage 'Deploy' echo 'Push to Repo' sh './dockerPushToRepo.sh' echo 'ssh to web server and tell it to pull new image' sh 'ssh deploy@xxxxx.xxxxx.com running/xxxxxxx/dockerRun.sh' stage 'Cleanup' echo 'prune and cleanup' sh 'npm prune' sh 'rm node_modules -rf' mail body: 'project build successful', from: 'xxxx@yyyyy.com', replyTo: 'xxxx@yyyy.com', subject: 'project build successful', to: 'yyyyy@yyyy.com' } catch (err) { currentBuild.result = "FAILURE" mail body: "project build error: ${err}" , from: 'xxxx@yyyy.com', replyTo: 'yyyy@yyyy.com', subject: 'project build failed', to: 'zzzz@yyyyy.com' throw err } }
  • 20.
  • 22.
  • 24.
  • 26. machine: services: - docker dependencies: override: - docker info - docker build -t circleci/elasticsearch . test: override: - docker run -d -p 9200:9200 circleci/elasticsearch; sleep 10 - curl --retry 10 --retry-delay 5 -v http://localhost:9200 deployment: hub: branch: master commands: - docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS - docker push circleci/elasticsearch
  • 30.
  • 31. Q & A Ladislav Prskavec ladislav@prskavec.net @abtris