SlideShare ist ein Scribd-Unternehmen logo
1 von 32
Continuous
Integration with
Node.js and Atlassian
Bamboo
Issac Goldstand
issac@itsgoodconsulting.com
ABOUT THE PRESENTOR

http://linkedin.com/in/margol
60 seconds before we get started…
60 seconds before we get started…
Part One – Introduction
The Basics…
 We

have a project, with tests (regression, unit, behavioral
– up to you)
 Written in Node.js, tested with Mocha
 We’d love to get Bamboo CI working
 Now

what?
Before we get ahead of ourselves...





Continuous Integration is a practice of
constantly merging source code, and
building and testing the result as often as
possible (and useful)
Originally part of XP (Extreme
Programming) principles
Lately has extended to Continuous
Deployment – the practice of constantly
deploying the latest builds to a customer
/ production environment

Atlassian Bamboo was originally designed for CI, and recently extended to include CD features
Powered By

Play @ Home
 Download

Git (http://git-scm.com/downloads)
 Download VirtualBox
(https://www.virtualbox.org/wiki/Downloads)
 Download Vagrant (http://downloads.vagrantup.com/)
 Install vagrant plugins



vagrant plugin install vagrant-berkshelf
vagrant plugin install vagrant-omnibus
Bring up the local environment
git clone --recursive https://github.com/issacg/mochademo.git
 EDIT mocha-demo/bamboo/attributes/oracle.rb (change
FALSE to TRUE to accept Oracle’s license)
 cd mocha-demo
 vagrant up (This will take a while)
 cd bamboo*
 vagrant up* (This will take a while)
How cool was that?   


*The final command will no longer be necessary in an upcoming release of vagrant-berkshelf
Node.js and Mocha Support for Bamboo
 The

Node.js plugin is included in the VirtualBox image
 Bamboo Node.js plugin via Atlassian Marketplace / UPM
 You’ll also need the Mocha reporter via npm package
mocha-bamboo-reporter
 Instructions at https://github.com/issacg/mochabamboo
Part Two – Continuous Integration
Testing from node
$ git checkout example3
$ npm test
> mocha-bamboo-demo@0.9.1 test /opt/demo/node
> node node_modules/mocha/bin/mocha
.
1 passing (97 ms)
Don’t forget to run it!
$ node index.js

http://localhost:8080/reverse/hello
elloh

It’s ALIVE!!!
The Test
describe('GET /reverse', function() {
it('should reverse the string', function(done) {
request(app). get('/reverse/hello').
expect('Content-Type', 'text/plain').
expect(200, 'olleh', done);
});
});
What if it fails?
$ cd /opt/demo/node
$ git checkout example2
$ npm test
> mocha-bamboo-demo@0.9.1 test /opt/demo/node
> node node_modules/mocha/bin/mocha
0 passing (28 ms)
1 failing
1) Reverser GET /reverse should reverse the string:
Uncaught TypeError: Object #<IncomingMessage> has no method 'get‘
…
npm ERR! weird error 1
npm ERR! not ok code 0
Bring up the local Bamboo server
 http://localhost:8085/
 Get

a free evaluation license (https://my.atlassian.com/license/evaluation)
 Use custom setup
 Use external (MySQL 5.x) database
 User bamboo, password bamboo
 Create a new bamboo home
 Set your initial user
Setting up Bamboo
 Create

a new Plan
 Source is Git (git@github.com:issacg/mocha-demo.git)
 Add tasks (all in “node” subdirectory)





Add NPM task “install”
Add NPM task “run-script bamboo”
Add Mocha tests collector task as Final Task
Testing From
Bamboo




Default (build from
“master”) should pass –
green
Run  Customized to
run specific revision





“example1” will have
no failed tests – syntax
error in logs
“example2” will have
one failed test
“example3” should
pass all tests
Continuous Integration
 Use

triggers in Bamboo to
automate build




Polling Git repository
Push to Bamboo via Webhook
Timed (Daily build)

 Use

(successful) builds (tests) to
trigger deployments…
Part Three – (Continuous) Deployment
Deployment
 Deployment

options added since Bamboo 5
 Intuitive and informative UI + JIRA integration
 Build results marked as a “release” and “release” marked as
deployed in one or more environments
 Also possible to mark a release (one mark) as Approved or
Rejected
 Integrated with permissions system – give your developers control
(or at least make them think they have it )
Deploying via SCC tags
 Extremely

popular deployment

pattern
 … but Bamboo can’t mark a
“tag” as release, only an
Artifact…
 … and your Git repository needs
to be firewall-accessible
Deploying via artifact
 Especially

useful in compiled languages, or including runtime prerequisites (like npm packages)






Artifact Push – Supported by Bamboo, including firewall
transversal, but requires the target machine to have a
Remote Agent license
Artifact Pull – Supported by popular deployment tools
(Chef, Puppet, Capistrano) but requires Firewall access and
file access (FTP, HTTP) to Bamboo’s artifact store
External artifact store – No native Bamboo support. Vote for
it at https://jira.atlassian.com/browse/BAM-11876
GIT

Bamboo / Slave
GIT

PULL

Source
Files

Bamboo / Slave
GIT

Source
Files

Artifact

Bamboo / Slave
GIT
External High-Availability Storage

Artifact

Bamboo / Slave
GIT
External High-Availability Storage

Artifact
Artifact

PULL

Bamboo / Slave
Production Cluster
(Chef/Puppet)
GIT
External High-Availability Storage

PULL

Artifact

Artifact

Bamboo / Slave
Production Cluster
(Chef/Puppet)

Artifact
In the meantime…
 Hack


around it 

I recommend either external artifact store by uploading
artifacts at the end of a build
 OR



Tagging SCC at the end of a build and using the tag in
deployment scripts
To Summarize


Part One





Part Two





We learned about Continuous Integration and Continuous
Deployment principles
We saw how to set up a local environment to try all the examples
here (and peek at the source code where applicable)
We were able to run the Mocha unit tests from the command line
We integrated Bamboo and a Git repository, and had Bamboo run
the unit tests and show us the results

Part Three


We touched on Deployment with Bamboo and saw how to do it
today, and how it will (hopefully) be streamlined in the future
Special Thanks…
That’s All, Folks!
Issac Goldstand
issac@itsgoodconsulting.com

Link To Slides

http://www.itsgoodconsulting.com/blog/issac-presenting-continuous-integration-with-node-js-and-atlassian-bamboo/

Weitere ähnliche Inhalte

Kürzlich hochgeladen

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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
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 DevelopmentsTrustArc
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
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 Nanonetsnaman860154
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
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
 
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 productivityPrincipled Technologies
 
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 2024The Digital Insurer
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
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 MenDelhi Call girls
 
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 2024Rafal Los
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
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
 
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...apidays
 
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
 

Kürzlich hochgeladen (20)

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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 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
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
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
 
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
 
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
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
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
 
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
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
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
 
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...
 
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
 

Empfohlen

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Empfohlen (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Continuous Integration With Node.js and Bamboo

  • 1. Continuous Integration with Node.js and Atlassian Bamboo Issac Goldstand issac@itsgoodconsulting.com ABOUT THE PRESENTOR http://linkedin.com/in/margol
  • 2. 60 seconds before we get started…
  • 3. 60 seconds before we get started…
  • 4. Part One – Introduction
  • 5. The Basics…  We have a project, with tests (regression, unit, behavioral – up to you)  Written in Node.js, tested with Mocha  We’d love to get Bamboo CI working  Now what?
  • 6. Before we get ahead of ourselves...    Continuous Integration is a practice of constantly merging source code, and building and testing the result as often as possible (and useful) Originally part of XP (Extreme Programming) principles Lately has extended to Continuous Deployment – the practice of constantly deploying the latest builds to a customer / production environment Atlassian Bamboo was originally designed for CI, and recently extended to include CD features
  • 7. Powered By Play @ Home  Download Git (http://git-scm.com/downloads)  Download VirtualBox (https://www.virtualbox.org/wiki/Downloads)  Download Vagrant (http://downloads.vagrantup.com/)  Install vagrant plugins   vagrant plugin install vagrant-berkshelf vagrant plugin install vagrant-omnibus
  • 8. Bring up the local environment git clone --recursive https://github.com/issacg/mochademo.git  EDIT mocha-demo/bamboo/attributes/oracle.rb (change FALSE to TRUE to accept Oracle’s license)  cd mocha-demo  vagrant up (This will take a while)  cd bamboo*  vagrant up* (This will take a while) How cool was that?     *The final command will no longer be necessary in an upcoming release of vagrant-berkshelf
  • 9. Node.js and Mocha Support for Bamboo  The Node.js plugin is included in the VirtualBox image  Bamboo Node.js plugin via Atlassian Marketplace / UPM  You’ll also need the Mocha reporter via npm package mocha-bamboo-reporter  Instructions at https://github.com/issacg/mochabamboo
  • 10. Part Two – Continuous Integration
  • 11. Testing from node $ git checkout example3 $ npm test > mocha-bamboo-demo@0.9.1 test /opt/demo/node > node node_modules/mocha/bin/mocha . 1 passing (97 ms)
  • 12. Don’t forget to run it! $ node index.js http://localhost:8080/reverse/hello elloh It’s ALIVE!!!
  • 13. The Test describe('GET /reverse', function() { it('should reverse the string', function(done) { request(app). get('/reverse/hello'). expect('Content-Type', 'text/plain'). expect(200, 'olleh', done); }); });
  • 14. What if it fails? $ cd /opt/demo/node $ git checkout example2 $ npm test > mocha-bamboo-demo@0.9.1 test /opt/demo/node > node node_modules/mocha/bin/mocha 0 passing (28 ms) 1 failing 1) Reverser GET /reverse should reverse the string: Uncaught TypeError: Object #<IncomingMessage> has no method 'get‘ … npm ERR! weird error 1 npm ERR! not ok code 0
  • 15. Bring up the local Bamboo server  http://localhost:8085/  Get a free evaluation license (https://my.atlassian.com/license/evaluation)  Use custom setup  Use external (MySQL 5.x) database  User bamboo, password bamboo  Create a new bamboo home  Set your initial user
  • 16. Setting up Bamboo  Create a new Plan  Source is Git (git@github.com:issacg/mocha-demo.git)  Add tasks (all in “node” subdirectory)    Add NPM task “install” Add NPM task “run-script bamboo” Add Mocha tests collector task as Final Task
  • 17. Testing From Bamboo   Default (build from “master”) should pass – green Run  Customized to run specific revision    “example1” will have no failed tests – syntax error in logs “example2” will have one failed test “example3” should pass all tests
  • 18. Continuous Integration  Use triggers in Bamboo to automate build    Polling Git repository Push to Bamboo via Webhook Timed (Daily build)  Use (successful) builds (tests) to trigger deployments…
  • 19. Part Three – (Continuous) Deployment
  • 20. Deployment  Deployment options added since Bamboo 5  Intuitive and informative UI + JIRA integration  Build results marked as a “release” and “release” marked as deployed in one or more environments  Also possible to mark a release (one mark) as Approved or Rejected  Integrated with permissions system – give your developers control (or at least make them think they have it )
  • 21. Deploying via SCC tags  Extremely popular deployment pattern  … but Bamboo can’t mark a “tag” as release, only an Artifact…  … and your Git repository needs to be firewall-accessible
  • 22. Deploying via artifact  Especially useful in compiled languages, or including runtime prerequisites (like npm packages)    Artifact Push – Supported by Bamboo, including firewall transversal, but requires the target machine to have a Remote Agent license Artifact Pull – Supported by popular deployment tools (Chef, Puppet, Capistrano) but requires Firewall access and file access (FTP, HTTP) to Bamboo’s artifact store External artifact store – No native Bamboo support. Vote for it at https://jira.atlassian.com/browse/BAM-11876
  • 28. GIT External High-Availability Storage PULL Artifact Artifact Bamboo / Slave Production Cluster (Chef/Puppet) Artifact
  • 29. In the meantime…  Hack  around it  I recommend either external artifact store by uploading artifacts at the end of a build  OR  Tagging SCC at the end of a build and using the tag in deployment scripts
  • 30. To Summarize  Part One    Part Two    We learned about Continuous Integration and Continuous Deployment principles We saw how to set up a local environment to try all the examples here (and peek at the source code where applicable) We were able to run the Mocha unit tests from the command line We integrated Bamboo and a Git repository, and had Bamboo run the unit tests and show us the results Part Three  We touched on Deployment with Bamboo and saw how to do it today, and how it will (hopefully) be streamlined in the future
  • 32. That’s All, Folks! Issac Goldstand issac@itsgoodconsulting.com Link To Slides http://www.itsgoodconsulting.com/blog/issac-presenting-continuous-integration-with-node-js-and-atlassian-bamboo/