SlideShare a Scribd company logo
Integrate Gitolite with Mantis
                   Jiahe Jou, 2012/08/31
Revisions
  DATE        Author              DESCRIPTION

2012/08/31   Jiahe Jou   Draft.
Outlines
● Main Idea of Synchronizing to Mantis

● Git Hooks Procedure

● Gitolite Common Hooks

● Intermediate Programs

● Send SMTP Mail
Main Idea of Synchronizing to Mantis


   User Git Push
                      Gitolite




                                     Post Hooks




                                 Intermediate Programs
      Mantis
Git Hooks Procedure
● The hooks procedure after git push:
    Receive Objects
                                             Post-commit Hook


                         Post-receive Hook
    Pre-receive Hook




                          Post-update Hook
       Update
      Repository
Gitolite Common Hooks
● /usr/share/gitolite/hooks/common/*
● post-receive:
   ...
   # read input objects
   while read oldrev newrev ref
   do
        # get the commit information
        subj=`git show -s --format="%s" $newrev`
        diff=`git show $newrev...$oldrev`
        msgs="$subj

   $diff"
         # excute pre-write perl script to sync mantis
         /home/gitolite/git2mantis.pl "$msgs"
         ...
   done
Gitolite Common Hooks
● Execute "gl-setup" to push common hooks to
  each repository
● Check whether hook scripts are pushed to
  each repositories
● Location: ~/repositories/*/hooks/*
Intermediate Programs
● /home/gitolite/git2mantis.pl
   #!/usr/bin/perl
   #
   # admin's ssh key must setup in 192.168.0.1
   # to log-in automatically.
   $host = "admin@192.168.0.1";

   $sshcmd = "/usr/bin/ssh ";
   $phpcmd = "/usr/bin/php";
   $checkincmd = "/var/www/mantis/scripts/git-checkin.php";

   $msg = $ARGV[0];

   # excute remote programs through ssh
   `$sshcmd $host $phpcmd $checkincmd <<< "$msg"`;
Intermediate Programs
● Mantis Server: 192.168.0.1:
  /var/www/mantis/scripts/git-checkin.php
   ...
   # Parsing the input to get issue number
   $t_commit_regexp = "/issueD*(d*)/";
   $t_line = readline("");
   iif (preg_match( $t_commit_regexp, $t_line, $t_matches ) == 0) {
          echo "Comment does not reference any issues.n";
          exit( 0 );
    }
   $t_issues[0] = $t_matches[1];
   ...
   # Call mantis helper function to insert issue note
   $t_issue_id = $t_issues[0];
   helper_call_custom_function( 'checkin', array( $t_issue_id, $t_comment,
   $t_history_old_value, $t_history_new_value, false );
Send SMTP Mail
● Modify ~/.gitolite/conf/gitolite.conf to add
  mailing list with "hooks.mailinglist"
   ...
   repo    testing
        config hooks.mailinglist = "alex.lin@innocomm.com, cc.
   chen@innocomm.com, cookie.liu@innocomm.com,
   ...
   jiahe.jou@innocomm.com, weili.luo@innocomm.com"
        RW+ = @all
        R         = daemon
        R         = gitweb
   ...
Send SMTP Mail
● Add the following to post-receive
   ...
   # get mailing list by git config
   recipients=`git config hooks.mailinglist`

   # execute pre-write script to send mail
   /home/gitolite/git2mail.py "$subj" "$diff" "$recipients"
   ...
Send SMTP Mail
● Send mail through SMTP with gmail
  #!/usr/bin/python
  import sys
  import smtplib

  subject = sys.argv[1]
  body = sys.argv[2]
  recipients = sys.argv[3]
  gmail_user = 'admin@gmail.com'
  gmail_pwd = 'password'

  smtpserver = smtplib.SMTP("smtp.gmail.com",587)
  smtpserver.ehlo()
  smtpserver.starttls()
  smtpserver.ehlo()
  smtpserver.login(gmail_user, gmail_pwd)

  header = 'To:' + recipients + 'n' + 'From: ' + gmail_user + 'n' + 'Subject:
  [Gitolite] ' + subject + ' n'
  msg = header + 'n' + body + 'nn'

  smtpserver.sendmail(gmail_user, recipients.split(', '), msg)
  smtpserver.close()
The End

More Related Content

What's hot

Steam Learn: Composer
Steam Learn: ComposerSteam Learn: Composer
Steam Learn: Composer
inovia
 
Central Iowa Linux Users Group June 2020 Meeting Apache Guacamole
Central Iowa Linux Users Group June 2020 Meeting  Apache GuacamoleCentral Iowa Linux Users Group June 2020 Meeting  Apache Guacamole
Central Iowa Linux Users Group June 2020 Meeting Apache Guacamole
Andrew Denner
 
gunicorn introduction
gunicorn introductiongunicorn introduction
gunicorn introduction
Adam Lowry
 
Building serverless application on the Apache Openwhisk platform
Building serverless application on the Apache Openwhisk platformBuilding serverless application on the Apache Openwhisk platform
Building serverless application on the Apache Openwhisk platform
Lucio Grenzi
 
Git beyond basics
Git   beyond basicsGit   beyond basics
Git beyond basics
Kalpa Pathum Welivitigoda
 
Analysing Github events with Neo4j
Analysing Github events with Neo4jAnalysing Github events with Neo4j
Analysing Github events with Neo4j
Christophe Willemsen
 
Searched gems which supports only ruby 2.6
Searched gems which supports only ruby 2.6Searched gems which supports only ruby 2.6
Searched gems which supports only ruby 2.6
Maki Toshio
 
Tupperware
TupperwareTupperware
Tupperware
Hiromu Shioya
 
Tomáš Čorej - OpenSSH
Tomáš Čorej - OpenSSHTomáš Čorej - OpenSSH
Tomáš Čorej - OpenSSHwebelement
 
Puppet and Openshift
Puppet and OpenshiftPuppet and Openshift
Puppet and Openshift
Gareth Rushgrove
 
Git setuplinux
Git setuplinuxGit setuplinux
Git setuplinux
Shubham Verma
 
Understanding about git
Understanding about gitUnderstanding about git
Understanding about git
Sothearin Ren
 
Rust vs. Go: qual è il linguaggio più adatto al tuo progetto?
Rust vs. Go: qual è il linguaggio più adatto al tuo progetto?Rust vs. Go: qual è il linguaggio più adatto al tuo progetto?
Rust vs. Go: qual è il linguaggio più adatto al tuo progetto?
Claudio Capobianco
 
Open Social Data (Jaca), Alejandro Rivero
Open Social Data (Jaca), Alejandro RiveroOpen Social Data (Jaca), Alejandro Rivero
Open Social Data (Jaca), Alejandro Rivero
Aragón Open Data
 
Introduction to GIT
Introduction to GITIntroduction to GIT
Introduction to GIT
Arpit Mohan
 
Socket.IO
Socket.IOSocket.IO
Socket.IO
Arnout Kazemier
 
Nginx-lua
Nginx-luaNginx-lua
Spark Day 2017- Spark 의 과거, 현재, 미래
Spark Day 2017- Spark 의 과거, 현재, 미래Spark Day 2017- Spark 의 과거, 현재, 미래
Spark Day 2017- Spark 의 과거, 현재, 미래
Moon Soo Lee
 

What's hot (20)

Steam Learn: Composer
Steam Learn: ComposerSteam Learn: Composer
Steam Learn: Composer
 
Chef
ChefChef
Chef
 
Central Iowa Linux Users Group June 2020 Meeting Apache Guacamole
Central Iowa Linux Users Group June 2020 Meeting  Apache GuacamoleCentral Iowa Linux Users Group June 2020 Meeting  Apache Guacamole
Central Iowa Linux Users Group June 2020 Meeting Apache Guacamole
 
gunicorn introduction
gunicorn introductiongunicorn introduction
gunicorn introduction
 
Building serverless application on the Apache Openwhisk platform
Building serverless application on the Apache Openwhisk platformBuilding serverless application on the Apache Openwhisk platform
Building serverless application on the Apache Openwhisk platform
 
Git beyond basics
Git   beyond basicsGit   beyond basics
Git beyond basics
 
Analysing Github events with Neo4j
Analysing Github events with Neo4jAnalysing Github events with Neo4j
Analysing Github events with Neo4j
 
Searched gems which supports only ruby 2.6
Searched gems which supports only ruby 2.6Searched gems which supports only ruby 2.6
Searched gems which supports only ruby 2.6
 
Tupperware
TupperwareTupperware
Tupperware
 
Tomáš Čorej - OpenSSH
Tomáš Čorej - OpenSSHTomáš Čorej - OpenSSH
Tomáš Čorej - OpenSSH
 
Puppet and Openshift
Puppet and OpenshiftPuppet and Openshift
Puppet and Openshift
 
Git setuplinux
Git setuplinuxGit setuplinux
Git setuplinux
 
Bash Scripting Workshop
Bash Scripting WorkshopBash Scripting Workshop
Bash Scripting Workshop
 
Understanding about git
Understanding about gitUnderstanding about git
Understanding about git
 
Rust vs. Go: qual è il linguaggio più adatto al tuo progetto?
Rust vs. Go: qual è il linguaggio più adatto al tuo progetto?Rust vs. Go: qual è il linguaggio più adatto al tuo progetto?
Rust vs. Go: qual è il linguaggio più adatto al tuo progetto?
 
Open Social Data (Jaca), Alejandro Rivero
Open Social Data (Jaca), Alejandro RiveroOpen Social Data (Jaca), Alejandro Rivero
Open Social Data (Jaca), Alejandro Rivero
 
Introduction to GIT
Introduction to GITIntroduction to GIT
Introduction to GIT
 
Socket.IO
Socket.IOSocket.IO
Socket.IO
 
Nginx-lua
Nginx-luaNginx-lua
Nginx-lua
 
Spark Day 2017- Spark 의 과거, 현재, 미래
Spark Day 2017- Spark 의 과거, 현재, 미래Spark Day 2017- Spark 의 과거, 현재, 미래
Spark Day 2017- Spark 의 과거, 현재, 미래
 

Viewers also liked

Camping og facebook_til_download
Camping og facebook_til_downloadCamping og facebook_til_download
Camping og facebook_til_downloadRasmus Hamann
 
The perng mha ngan box
The perng mha ngan boxThe perng mha ngan box
The perng mha ngan box
weerachai99
 
General Catalog GFS Indonesia
General Catalog GFS IndonesiaGeneral Catalog GFS Indonesia
General Catalog GFS Indonesia
GFS Indonesia
 
The perng mha ngan box
The perng mha ngan boxThe perng mha ngan box
The perng mha ngan boxweerachai99
 
Nicholas John Spykman
Nicholas John SpykmanNicholas John Spykman
Nicholas John Spykman
ezdets
 
Membangun Nasionalisme melalui Upacara Bendera - Universitas Katolik Parahyan...
Membangun Nasionalisme melalui Upacara Bendera - Universitas Katolik Parahyan...Membangun Nasionalisme melalui Upacara Bendera - Universitas Katolik Parahyan...
Membangun Nasionalisme melalui Upacara Bendera - Universitas Katolik Parahyan...
SMA Negeri 1 Pemalang
 
FA Catalog
FA CatalogFA Catalog
FA Catalog
GFS Indonesia
 
Arro capabilities lean revised 2010
Arro capabilities   lean revised 2010Arro capabilities   lean revised 2010
Arro capabilities lean revised 2010fileserve
 
Apu presentation
Apu presentationApu presentation
Apu presentationclhatfield
 
Algorithm Final Presentation
Algorithm Final PresentationAlgorithm Final Presentation
Algorithm Final PresentationJohnson Chou
 
Luat thue thu nhap ca nhan 2007
Luat thue thu nhap ca nhan 2007Luat thue thu nhap ca nhan 2007
Luat thue thu nhap ca nhan 2007Tiggy Ng
 
Internet Week Yahoo! Academy: How Direct Can You Be?
Internet Week Yahoo! Academy: How Direct Can You Be?Internet Week Yahoo! Academy: How Direct Can You Be?
Internet Week Yahoo! Academy: How Direct Can You Be?YahooUK
 

Viewers also liked (20)

Camping og facebook_til_download
Camping og facebook_til_downloadCamping og facebook_til_download
Camping og facebook_til_download
 
The perng mha ngan box
The perng mha ngan boxThe perng mha ngan box
The perng mha ngan box
 
General Catalog GFS Indonesia
General Catalog GFS IndonesiaGeneral Catalog GFS Indonesia
General Catalog GFS Indonesia
 
The perng mha ngan box
The perng mha ngan boxThe perng mha ngan box
The perng mha ngan box
 
видеокамера сони
видеокамера сонивидеокамера сони
видеокамера сони
 
Nicholas John Spykman
Nicholas John SpykmanNicholas John Spykman
Nicholas John Spykman
 
Membangun Nasionalisme melalui Upacara Bendera - Universitas Katolik Parahyan...
Membangun Nasionalisme melalui Upacara Bendera - Universitas Katolik Parahyan...Membangun Nasionalisme melalui Upacara Bendera - Universitas Katolik Parahyan...
Membangun Nasionalisme melalui Upacara Bendera - Universitas Katolik Parahyan...
 
Quotationsanddialogue 2014
Quotationsanddialogue 2014Quotationsanddialogue 2014
Quotationsanddialogue 2014
 
FA Catalog
FA CatalogFA Catalog
FA Catalog
 
Arro capabilities lean revised 2010
Arro capabilities   lean revised 2010Arro capabilities   lean revised 2010
Arro capabilities lean revised 2010
 
Apu presentation
Apu presentationApu presentation
Apu presentation
 
Showdonttell
ShowdonttellShowdonttell
Showdonttell
 
Algorithm Final Presentation
Algorithm Final PresentationAlgorithm Final Presentation
Algorithm Final Presentation
 
Reading
ReadingReading
Reading
 
Luat thue thu nhap ca nhan 2007
Luat thue thu nhap ca nhan 2007Luat thue thu nhap ca nhan 2007
Luat thue thu nhap ca nhan 2007
 
пдд азербайджана
пдд азербайджанапдд азербайджана
пдд азербайджана
 
Gallus2002 usermanual
Gallus2002 usermanualGallus2002 usermanual
Gallus2002 usermanual
 
Nokia n9 ug_ru
Nokia n9 ug_ruNokia n9 ug_ru
Nokia n9 ug_ru
 
Internet Week Yahoo! Academy: How Direct Can You Be?
Internet Week Yahoo! Academy: How Direct Can You Be?Internet Week Yahoo! Academy: How Direct Can You Be?
Internet Week Yahoo! Academy: How Direct Can You Be?
 
Wallander - Becka
Wallander - BeckaWallander - Becka
Wallander - Becka
 

Similar to Integrate gitolite with mantis

Advanted git
Advanted git Advanted git
Advanted git
Sahil Gupta
 
Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control SystemVictor Wong
 
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git Tutorial
Sage Sharp
 
Git the Wnderfull tool
Git the Wnderfull toolGit the Wnderfull tool
Git the Wnderfull toolAmitoj Singh
 
Github By Nyros Developer
Github By Nyros DeveloperGithub By Nyros Developer
Github By Nyros Developer
Nyros Technologies
 
Git Workshop : Git On The Server
Git Workshop : Git On The ServerGit Workshop : Git On The Server
Git Workshop : Git On The ServerWildan Maulana
 
Wokshop de Git
Wokshop de Git Wokshop de Git
Wokshop de Git
Alberto Leal
 
Github basics
Github basicsGithub basics
Github basics
Radoslav Georgiev
 
Getting started with git
Getting started with gitGetting started with git
Getting started with git
Pawan Kumar.v
 
Git Primer
Git PrimerGit Primer
Git Primer
Michael Pearce
 
Git: Why And How to
Git: Why And How toGit: Why And How to
Git: Why And How to
lanhuonga3
 
Git basics
Git basicsGit basics
Git basics
Amit Sawhney
 
Lagos GitHub Meetup - What is Git?
Lagos GitHub Meetup - What is Git?Lagos GitHub Meetup - What is Git?
Lagos GitHub Meetup - What is Git?
Celestine Omin
 
簡單介紹git
簡單介紹git簡單介紹git
簡單介紹git
Grace Chien
 
The everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitThe everyday developer's guide to version control with Git
The everyday developer's guide to version control with Git
E Carter
 
Getting some Git
Getting some GitGetting some Git
Getting some Git
BADR
 
Git github
Git githubGit github
Git github
Anurag Deb
 
Matt Gauger - Git & Github web414 December 2010
Matt Gauger - Git & Github web414 December 2010Matt Gauger - Git & Github web414 December 2010
Matt Gauger - Git & Github web414 December 2010
Matt Gauger
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
John Ombagi
 

Similar to Integrate gitolite with mantis (20)

Advanted git
Advanted git Advanted git
Advanted git
 
Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control System
 
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git Tutorial
 
Git the Wnderfull tool
Git the Wnderfull toolGit the Wnderfull tool
Git the Wnderfull tool
 
Github By Nyros Developer
Github By Nyros DeveloperGithub By Nyros Developer
Github By Nyros Developer
 
Git Workshop : Git On The Server
Git Workshop : Git On The ServerGit Workshop : Git On The Server
Git Workshop : Git On The Server
 
Wokshop de Git
Wokshop de Git Wokshop de Git
Wokshop de Git
 
Github basics
Github basicsGithub basics
Github basics
 
Getting started with git
Getting started with gitGetting started with git
Getting started with git
 
Git Primer
Git PrimerGit Primer
Git Primer
 
Git: Why And How to
Git: Why And How toGit: Why And How to
Git: Why And How to
 
Git basics
Git basicsGit basics
Git basics
 
Lagos GitHub Meetup - What is Git?
Lagos GitHub Meetup - What is Git?Lagos GitHub Meetup - What is Git?
Lagos GitHub Meetup - What is Git?
 
簡單介紹git
簡單介紹git簡單介紹git
簡單介紹git
 
The everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitThe everyday developer's guide to version control with Git
The everyday developer's guide to version control with Git
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
Getting some Git
Getting some GitGetting some Git
Getting some Git
 
Git github
Git githubGit github
Git github
 
Matt Gauger - Git & Github web414 December 2010
Matt Gauger - Git & Github web414 December 2010Matt Gauger - Git & Github web414 December 2010
Matt Gauger - Git & Github web414 December 2010
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 

Recently uploaded

Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 

Recently uploaded (20)

Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 

Integrate gitolite with mantis

  • 1. Integrate Gitolite with Mantis Jiahe Jou, 2012/08/31
  • 2. Revisions DATE Author DESCRIPTION 2012/08/31 Jiahe Jou Draft.
  • 3. Outlines ● Main Idea of Synchronizing to Mantis ● Git Hooks Procedure ● Gitolite Common Hooks ● Intermediate Programs ● Send SMTP Mail
  • 4. Main Idea of Synchronizing to Mantis User Git Push Gitolite Post Hooks Intermediate Programs Mantis
  • 5. Git Hooks Procedure ● The hooks procedure after git push: Receive Objects Post-commit Hook Post-receive Hook Pre-receive Hook Post-update Hook Update Repository
  • 6. Gitolite Common Hooks ● /usr/share/gitolite/hooks/common/* ● post-receive: ... # read input objects while read oldrev newrev ref do # get the commit information subj=`git show -s --format="%s" $newrev` diff=`git show $newrev...$oldrev` msgs="$subj $diff" # excute pre-write perl script to sync mantis /home/gitolite/git2mantis.pl "$msgs" ... done
  • 7. Gitolite Common Hooks ● Execute "gl-setup" to push common hooks to each repository ● Check whether hook scripts are pushed to each repositories ● Location: ~/repositories/*/hooks/*
  • 8. Intermediate Programs ● /home/gitolite/git2mantis.pl #!/usr/bin/perl # # admin's ssh key must setup in 192.168.0.1 # to log-in automatically. $host = "admin@192.168.0.1"; $sshcmd = "/usr/bin/ssh "; $phpcmd = "/usr/bin/php"; $checkincmd = "/var/www/mantis/scripts/git-checkin.php"; $msg = $ARGV[0]; # excute remote programs through ssh `$sshcmd $host $phpcmd $checkincmd <<< "$msg"`;
  • 9. Intermediate Programs ● Mantis Server: 192.168.0.1: /var/www/mantis/scripts/git-checkin.php ... # Parsing the input to get issue number $t_commit_regexp = "/issueD*(d*)/"; $t_line = readline(""); iif (preg_match( $t_commit_regexp, $t_line, $t_matches ) == 0) { echo "Comment does not reference any issues.n"; exit( 0 ); } $t_issues[0] = $t_matches[1]; ... # Call mantis helper function to insert issue note $t_issue_id = $t_issues[0]; helper_call_custom_function( 'checkin', array( $t_issue_id, $t_comment, $t_history_old_value, $t_history_new_value, false );
  • 10. Send SMTP Mail ● Modify ~/.gitolite/conf/gitolite.conf to add mailing list with "hooks.mailinglist" ... repo testing config hooks.mailinglist = "alex.lin@innocomm.com, cc. chen@innocomm.com, cookie.liu@innocomm.com, ... jiahe.jou@innocomm.com, weili.luo@innocomm.com" RW+ = @all R = daemon R = gitweb ...
  • 11. Send SMTP Mail ● Add the following to post-receive ... # get mailing list by git config recipients=`git config hooks.mailinglist` # execute pre-write script to send mail /home/gitolite/git2mail.py "$subj" "$diff" "$recipients" ...
  • 12. Send SMTP Mail ● Send mail through SMTP with gmail #!/usr/bin/python import sys import smtplib subject = sys.argv[1] body = sys.argv[2] recipients = sys.argv[3] gmail_user = 'admin@gmail.com' gmail_pwd = 'password' smtpserver = smtplib.SMTP("smtp.gmail.com",587) smtpserver.ehlo() smtpserver.starttls() smtpserver.ehlo() smtpserver.login(gmail_user, gmail_pwd) header = 'To:' + recipients + 'n' + 'From: ' + gmail_user + 'n' + 'Subject: [Gitolite] ' + subject + ' n' msg = header + 'n' + body + 'nn' smtpserver.sendmail(gmail_user, recipients.split(', '), msg) smtpserver.close()