SlideShare una empresa de Scribd logo
1 de 22
Descargar para leer sin conexión
Build & Deployment
Pascal Robert	

Druide informatique
Git
Git hooks
• Stored in .git/hooks	

• Hooks can be anything runnable	

• The useful ones: post-commit and post-receive	

• post-receive will receive branch reference
Git and remote
• Push changes to each deployment server	

• Have the post-receive script on each server	

• … or use branches and central Git repo
post-receive examples
#!/bin/bash	
!
while read oldrev newrev ref	
do	
if [[ $newrev == "0000000000000000000000000000000000000000" ]]; then	
exit 0	
fi	
!
branch=`echo $ref | cut -d/ -f3`	
umask 0022	
!
if [ ! -d /tmp/SimpleBlog ]; then	
git clone /Users/probert/SimpleBlog.git /tmp/SimpleBlog	
fi	
!
if [ $branch == "dev" ]; then	
ant -lib /opt/woproject.jar install	
fi	
fi
Submodules
• You could use Git submodules to build everything at the same
time
Puppet
Puppet ?
• Not about politicians, consumers or Metallica	

• Configuration management tool	

• Rapid deployment	

• Central point	

• Changes history	

• Standalone or client/server
Puppet
• Puppet uses recipes (modules)	

• Ruby-like declarative language	

• Works on UNIX/Linux, OS X and Windows	

• You can install packages, create user account, start services, etc.
Sample configuration
manifests/site.pp:	
!
node server.wocommunity.org {	
include wodeploy	
}	
!
modules/wodeploy/manifests/init.pp:	
!
package { ‘apache’:	
name => ‘httpd’,	
ensure => present	
}	
!
service { ‘httpd’:	
name => ‘httpd’,	
ensure => running,	
require => Package[‘apache’]	
}	
!
package { ‘wotaskd’:	
name => ‘wotaskd’,	
ensure => present	
}	
!
user { ‘appserver’:	
name => ‘appserver’	
ensure => present	
}
Puppet tips
• Use Git to store the configuration	

• Be modular	

• Use it!
Native Packages
Native packages
• Deploy with natives packages!	

• Can mix it with Puppet or Chef	

• Deploy from a central repository or manually
Ant RPM task
• Build a RPM package for RedHat-based Linux	

• Still need to write a SPEC file	

• Use it only if you really like Ant
fpm
• Ruby gem to create packages	

• .pkg/.deb/.rpm/Puppet!	

• Much more flexible than the Ant task
fpm in two steps
• gem install fpm	

• fpm --prefix /WOApps -a noarch —rpm-user _appserver --rpm-
os linux -t rpm -s dir -n SimpleBlog -v 1.0 SimpleBlog.woa
Activating the app
• Bundle a shell script inside the package	

• Use Puppet to install the package + restart the app
Puppet + RPM
package { ‘SimpleBlog’:	
source => ‘http://myserver/storage/SimpleBlog-1.0-1.rpm',	
name => ‘SimpleBlog’,	
ensure => ‘installed’	
}	
!
file { ‘wodeploy.py’: {	
source => ‘puppet:///modules/wotools/scripts/wodeploy.py',	
path => ‘/opt/bin/wodeploy.py’	
}	
!
exec { ‘run-wodeploy’	
command => ‘/opt/bin/wodeploy.py SimpleBlog’	
}
wodeploy.py
#!/usr/bin/python	
!
import json, urllib2, sys	
!
base_url = "http://mywotaskd:1085/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications"	
app_name = sys.argv[1]	
!
stop_instance = True	
response = json.load(urllib2.urlopen(base_url + ".json?type=app&name=" + app_name))	
if len(response) == 0:	
	 query = { 	
	 	 'id' : app_name,	
	 	 'type' : 'MApplication',	
	 	 'name' : app_name,	
	 	 'unixOutputPath' : '/opt/Local/Library/WebObjects/Logs',	
	 	 'unixPath' : '/opt/Local/Library/WebObjects/Applications/' + app_name + '.woa/' + app_name	
	 }	
	 	
	 query_as_json = json.dumps(query)	
	 request = urllib2.Request(base_url + ".json", query_as_json, {'Content-Type': 'application/json'})	
	 response = urllib2.urlopen(request)	
	 stop_instance = False	
	 	
if stop_instance:	
	 urllib2.urlopen(base_url + "/" + app_name + "/stop")	
!
urllib2.urlopen(base_url + "/" + app_name + "/start")
Large distribution
• Use a central repository	

• Use Puppet	

• … or both
Maven
Q&A

Más contenido relacionado

La actualidad más candente

From Test to Live with Rex
From Test to Live with RexFrom Test to Live with Rex
From Test to Live with Rex
Jan Gehring
 
Linuxday.at - Lightning Talk
Linuxday.at - Lightning TalkLinuxday.at - Lightning Talk
Linuxday.at - Lightning Talk
Jan Gehring
 
Oscar: Rapid Iteration with Vagrant and Puppet Enterprise - PuppetConf 2013
Oscar: Rapid Iteration with Vagrant and Puppet Enterprise - PuppetConf 2013Oscar: Rapid Iteration with Vagrant and Puppet Enterprise - PuppetConf 2013
Oscar: Rapid Iteration with Vagrant and Puppet Enterprise - PuppetConf 2013
Puppet
 

La actualidad más candente (20)

From Test to Live with Rex
From Test to Live with RexFrom Test to Live with Rex
From Test to Live with Rex
 
Introduction to ansible
Introduction to ansibleIntroduction to ansible
Introduction to ansible
 
uWSGI - Swiss army knife for your Python web apps
uWSGI - Swiss army knife for your Python web appsuWSGI - Swiss army knife for your Python web apps
uWSGI - Swiss army knife for your Python web apps
 
Linuxday.at - Lightning Talk
Linuxday.at - Lightning TalkLinuxday.at - Lightning Talk
Linuxday.at - Lightning Talk
 
It Works On My Machine: Vagrant for Software Development
It Works On My Machine: Vagrant for Software DevelopmentIt Works On My Machine: Vagrant for Software Development
It Works On My Machine: Vagrant for Software Development
 
Helpful pre commit hooks for Python and Django
Helpful pre commit hooks for Python and DjangoHelpful pre commit hooks for Python and Django
Helpful pre commit hooks for Python and Django
 
Vagrant to-aws-flow
Vagrant to-aws-flowVagrant to-aws-flow
Vagrant to-aws-flow
 
EuroPython 2014 - How we switched our 800+ projects from Apache to uWSGI
EuroPython 2014 - How we switched our 800+ projects from Apache to uWSGIEuroPython 2014 - How we switched our 800+ projects from Apache to uWSGI
EuroPython 2014 - How we switched our 800+ projects from Apache to uWSGI
 
Deploying PHP Applications with Ansible
Deploying PHP Applications with AnsibleDeploying PHP Applications with Ansible
Deploying PHP Applications with Ansible
 
systemd @ Facebook -- a year later
systemd @ Facebook -- a year latersystemd @ Facebook -- a year later
systemd @ Facebook -- a year later
 
Webinar - Auto-deploy Puppet Enterprise: Vagrant and Oscar
Webinar - Auto-deploy Puppet Enterprise: Vagrant and OscarWebinar - Auto-deploy Puppet Enterprise: Vagrant and Oscar
Webinar - Auto-deploy Puppet Enterprise: Vagrant and Oscar
 
Vagrant: The Oscar Plug-in
Vagrant: The Oscar Plug-inVagrant: The Oscar Plug-in
Vagrant: The Oscar Plug-in
 
Oscar: Rapid Iteration with Vagrant and Puppet Enterprise - PuppetConf 2013
Oscar: Rapid Iteration with Vagrant and Puppet Enterprise - PuppetConf 2013Oscar: Rapid Iteration with Vagrant and Puppet Enterprise - PuppetConf 2013
Oscar: Rapid Iteration with Vagrant and Puppet Enterprise - PuppetConf 2013
 
Deploying Foreman in Enterprise Environments
Deploying Foreman in Enterprise EnvironmentsDeploying Foreman in Enterprise Environments
Deploying Foreman in Enterprise Environments
 
Vagrant presentation
Vagrant presentationVagrant presentation
Vagrant presentation
 
Vagrant for Virtualized Development
Vagrant for Virtualized DevelopmentVagrant for Virtualized Development
Vagrant for Virtualized Development
 
Introduction to Ansible
Introduction to AnsibleIntroduction to Ansible
Introduction to Ansible
 
Ansible Oxford - Cows & Containers
Ansible Oxford - Cows & ContainersAnsible Oxford - Cows & Containers
Ansible Oxford - Cows & Containers
 
Develop QNAP NAS App by Docker
Develop QNAP NAS App by DockerDevelop QNAP NAS App by Docker
Develop QNAP NAS App by Docker
 
Vagrant-Overview
Vagrant-OverviewVagrant-Overview
Vagrant-Overview
 

Destacado (16)

Filtering data with D2W
Filtering data with D2W Filtering data with D2W
Filtering data with D2W
 
D2W Stateful Controllers
D2W Stateful ControllersD2W Stateful Controllers
D2W Stateful Controllers
 
iOS for ERREST - alternative version
iOS for ERREST - alternative versioniOS for ERREST - alternative version
iOS for ERREST - alternative version
 
Apache Cayenne for WO Devs
Apache Cayenne for WO DevsApache Cayenne for WO Devs
Apache Cayenne for WO Devs
 
WOver
WOverWOver
WOver
 
Reenabling SOAP using ERJaxWS
Reenabling SOAP using ERJaxWSReenabling SOAP using ERJaxWS
Reenabling SOAP using ERJaxWS
 
Life outside WO
Life outside WOLife outside WO
Life outside WO
 
Advanced Apache Cayenne
Advanced Apache CayenneAdvanced Apache Cayenne
Advanced Apache Cayenne
 
Unit Testing with WOUnit
Unit Testing with WOUnitUnit Testing with WOUnit
Unit Testing with WOUnit
 
Chaining the Beast - Testing Wonder Applications in the Real World
Chaining the Beast - Testing Wonder Applications in the Real WorldChaining the Beast - Testing Wonder Applications in the Real World
Chaining the Beast - Testing Wonder Applications in the Real World
 
Migrating existing Projects to Wonder
Migrating existing Projects to WonderMigrating existing Projects to Wonder
Migrating existing Projects to Wonder
 
iOS for ERREST
iOS for ERRESTiOS for ERREST
iOS for ERREST
 
High availability
High availabilityHigh availability
High availability
 
KAAccessControl
KAAccessControlKAAccessControl
KAAccessControl
 
"Framework Principal" pattern
"Framework Principal" pattern"Framework Principal" pattern
"Framework Principal" pattern
 
In memory OLAP engine
In memory OLAP engineIn memory OLAP engine
In memory OLAP engine
 

Similar a Build and deployment

Open Source Tools for Leveling Up Operations FOSSET 2014
Open Source Tools for Leveling Up Operations FOSSET 2014Open Source Tools for Leveling Up Operations FOSSET 2014
Open Source Tools for Leveling Up Operations FOSSET 2014
Mandi Walls
 
How to stay sane during your Vagrant journey
How to stay sane during your Vagrant journeyHow to stay sane during your Vagrant journey
How to stay sane during your Vagrant journey
Jakub Wadolowski
 

Similar a Build and deployment (20)

Package manages and Puppet - PuppetConf 2015
Package manages and Puppet - PuppetConf 2015Package manages and Puppet - PuppetConf 2015
Package manages and Puppet - PuppetConf 2015
 
Open Source Tools for Leveling Up Operations FOSSET 2014
Open Source Tools for Leveling Up Operations FOSSET 2014Open Source Tools for Leveling Up Operations FOSSET 2014
Open Source Tools for Leveling Up Operations FOSSET 2014
 
Puppet Camp LA 2015: Package Managers and Puppet (Beginner)
Puppet Camp LA 2015: Package Managers and Puppet (Beginner)Puppet Camp LA 2015: Package Managers and Puppet (Beginner)
Puppet Camp LA 2015: Package Managers and Puppet (Beginner)
 
Puppet Camp LA 2/19/2015
Puppet Camp LA 2/19/2015Puppet Camp LA 2/19/2015
Puppet Camp LA 2/19/2015
 
Running CentOS on the Facebook fleet
Running CentOS on the Facebook fleetRunning CentOS on the Facebook fleet
Running CentOS on the Facebook fleet
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014
 
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
 
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...
 
Puppet control-repo 
to the next level
Puppet control-repo 
to the next levelPuppet control-repo 
to the next level
Puppet control-repo 
to the next level
 
Beyond Puppet
Beyond PuppetBeyond Puppet
Beyond Puppet
 
CentOS at Facebook
CentOS at FacebookCentOS at Facebook
CentOS at Facebook
 
Django dev-env-my-way
Django dev-env-my-wayDjango dev-env-my-way
Django dev-env-my-way
 
Habitat Overview
Habitat OverviewHabitat Overview
Habitat Overview
 
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
 
Puppet Camp New York 2014: Streamlining Puppet Development Workflow
Puppet Camp New York 2014: Streamlining Puppet Development Workflow Puppet Camp New York 2014: Streamlining Puppet Development Workflow
Puppet Camp New York 2014: Streamlining Puppet Development Workflow
 
Steamlining your puppet development workflow
Steamlining your puppet development workflowSteamlining your puppet development workflow
Steamlining your puppet development workflow
 
Deploying to Ubuntu on Linode
Deploying to Ubuntu on LinodeDeploying to Ubuntu on Linode
Deploying to Ubuntu on Linode
 
How to stay sane during your Vagrant journey
How to stay sane during your Vagrant journeyHow to stay sane during your Vagrant journey
How to stay sane during your Vagrant journey
 
Automating Complex Setups with Puppet
Automating Complex Setups with PuppetAutomating Complex Setups with Puppet
Automating Complex Setups with Puppet
 
Jenkins and Docker for native Linux packages
Jenkins and Docker for native Linux packagesJenkins and Docker for native Linux packages
Jenkins and Docker for native Linux packages
 

Más de WO Community (12)

Localizing your apps for multibyte languages
Localizing your apps for multibyte languagesLocalizing your apps for multibyte languages
Localizing your apps for multibyte languages
 
WOdka
WOdkaWOdka
WOdka
 
ERGroupware
ERGroupwareERGroupware
ERGroupware
 
D2W Branding Using jQuery ThemeRoller
D2W Branding Using jQuery ThemeRollerD2W Branding Using jQuery ThemeRoller
D2W Branding Using jQuery ThemeRoller
 
CMS / BLOG and SnoWOman
CMS / BLOG and SnoWOmanCMS / BLOG and SnoWOman
CMS / BLOG and SnoWOman
 
Using GIT
Using GITUsing GIT
Using GIT
 
Persistent Session Storage
Persistent Session StoragePersistent Session Storage
Persistent Session Storage
 
Back2 future
Back2 futureBack2 future
Back2 future
 
WebObjects Optimization
WebObjects OptimizationWebObjects Optimization
WebObjects Optimization
 
Dynamic Elements
Dynamic ElementsDynamic Elements
Dynamic Elements
 
Practical ERSync
Practical ERSyncPractical ERSync
Practical ERSync
 
ERRest: the Basics
ERRest: the BasicsERRest: the Basics
ERRest: the Basics
 

Último

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
anilsa9823
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 

Último (20)

Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 

Build and deployment

  • 1. Build & Deployment Pascal Robert Druide informatique
  • 2. Git
  • 3. Git hooks • Stored in .git/hooks • Hooks can be anything runnable • The useful ones: post-commit and post-receive • post-receive will receive branch reference
  • 4. Git and remote • Push changes to each deployment server • Have the post-receive script on each server • … or use branches and central Git repo
  • 5. post-receive examples #!/bin/bash ! while read oldrev newrev ref do if [[ $newrev == "0000000000000000000000000000000000000000" ]]; then exit 0 fi ! branch=`echo $ref | cut -d/ -f3` umask 0022 ! if [ ! -d /tmp/SimpleBlog ]; then git clone /Users/probert/SimpleBlog.git /tmp/SimpleBlog fi ! if [ $branch == "dev" ]; then ant -lib /opt/woproject.jar install fi fi
  • 6. Submodules • You could use Git submodules to build everything at the same time
  • 8. Puppet ? • Not about politicians, consumers or Metallica • Configuration management tool • Rapid deployment • Central point • Changes history • Standalone or client/server
  • 9. Puppet • Puppet uses recipes (modules) • Ruby-like declarative language • Works on UNIX/Linux, OS X and Windows • You can install packages, create user account, start services, etc.
  • 10. Sample configuration manifests/site.pp: ! node server.wocommunity.org { include wodeploy } ! modules/wodeploy/manifests/init.pp: ! package { ‘apache’: name => ‘httpd’, ensure => present } ! service { ‘httpd’: name => ‘httpd’, ensure => running, require => Package[‘apache’] } ! package { ‘wotaskd’: name => ‘wotaskd’, ensure => present } ! user { ‘appserver’: name => ‘appserver’ ensure => present }
  • 11. Puppet tips • Use Git to store the configuration • Be modular • Use it!
  • 13. Native packages • Deploy with natives packages! • Can mix it with Puppet or Chef • Deploy from a central repository or manually
  • 14. Ant RPM task • Build a RPM package for RedHat-based Linux • Still need to write a SPEC file • Use it only if you really like Ant
  • 15. fpm • Ruby gem to create packages • .pkg/.deb/.rpm/Puppet! • Much more flexible than the Ant task
  • 16. fpm in two steps • gem install fpm • fpm --prefix /WOApps -a noarch —rpm-user _appserver --rpm- os linux -t rpm -s dir -n SimpleBlog -v 1.0 SimpleBlog.woa
  • 17. Activating the app • Bundle a shell script inside the package • Use Puppet to install the package + restart the app
  • 18. Puppet + RPM package { ‘SimpleBlog’: source => ‘http://myserver/storage/SimpleBlog-1.0-1.rpm', name => ‘SimpleBlog’, ensure => ‘installed’ } ! file { ‘wodeploy.py’: { source => ‘puppet:///modules/wotools/scripts/wodeploy.py', path => ‘/opt/bin/wodeploy.py’ } ! exec { ‘run-wodeploy’ command => ‘/opt/bin/wodeploy.py SimpleBlog’ }
  • 19. wodeploy.py #!/usr/bin/python ! import json, urllib2, sys ! base_url = "http://mywotaskd:1085/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications" app_name = sys.argv[1] ! stop_instance = True response = json.load(urllib2.urlopen(base_url + ".json?type=app&name=" + app_name)) if len(response) == 0: query = { 'id' : app_name, 'type' : 'MApplication', 'name' : app_name, 'unixOutputPath' : '/opt/Local/Library/WebObjects/Logs', 'unixPath' : '/opt/Local/Library/WebObjects/Applications/' + app_name + '.woa/' + app_name } query_as_json = json.dumps(query) request = urllib2.Request(base_url + ".json", query_as_json, {'Content-Type': 'application/json'}) response = urllib2.urlopen(request) stop_instance = False if stop_instance: urllib2.urlopen(base_url + "/" + app_name + "/stop") ! urllib2.urlopen(base_url + "/" + app_name + "/start")
  • 20. Large distribution • Use a central repository • Use Puppet • … or both
  • 21. Maven
  • 22. Q&A