SlideShare uma empresa Scribd logo
1 de 12
Baixar para ler offline
Deploy easily!
with
Igor Santos
Web developer
● From Rio de Janeiro, Brazil
● PHP Developer for ~6 years
● Ruby and JS Developer for fun
● Playing around with git for ~2 years
slideshare.net/igorsantos07
0. Introduction
● Knows what Git is?
● Have ever used Git in the command line?
● Have ever deployed code?
○ How? SCP? WGet?
● Anyone developing in the production server?
1. Git Basics
● Commit: Saves changes with a description
● Pull: Get commits from a server
● Push: Send commits to a server
● Remotes
○ A remote machine that has a copy of the repository
and accepts your commits
○ In a common centralized organization you usually
have one, but it's possible to have many
○ Example: main repo is BitBucket or Google Code,
mirrored to GitHub
2. Configure your server
igor@local$ ssh santos@bluenose.cs.dal.ca
password: **********
santos@bluenose$ mkdir repos
santos@bluenose$ cd repos
santos@bluenose$ pwd
/users/cs/santos/repos
santos@bluenose$ git clone «repo» myRep --bare
This creates a clone of that repository that works just as
another repository: with all administrative data, but not
useable for development, as the code is not really checked
in - just the Git meta-data.
Take note
igor@local$ cd dev/myCode
igor@local$ git remote add prod
ssh://santos@bluenose.cs.dal.ca:/users/cs/santos/repos/myRep
igor@local$ "Hi there!" > README.mkd
igor@local$ git commit "+ Adding readme"
igor@local$ git push prod
2. Configure your server
Name given to the remote server
Complete repository URL
No line break!
igor@local$ git commit "+ Adding readme"
igor@local$ git push prod
Q: OK, so... where's my README file?
A: In the repository!
Q: I can't see it. «not really a question»
2. Configure your server
3. Git Hooks
● 2 types: client and server hooks
● Client:
○ pre/post-commit
○ [prepare-]commit-msg
○ post-checkout, post-merge
● Server:
○ pre/post-receive Once per push
○ update Once per pushed branch
http://git-scm.com/book/en/Customizing-Git-Git-Hooks
3. Git Hooks
Simple copy
$ cat hooks/post-receive
#!/bin/sh
GIT_WORK_TREE=/var/www/mysite git checkout -f
Opposite of git clone --bare: copies the entire repository
code, without git data. By default does that with the master
branch, but you can use other options here as well.
GIT_WORK_TREE tells git where it would copy stuff.
3. Git Hooks
Complete deployment script
https://bitbucket.org/igorsantos07/calen-do/src/3fea92ee46c1/git-hooks/update
4. Advanced ideas
GitHub and other Git online repositories
have options to do HTTP requests with code
information after pushes, similar to post-
receive hooks. This data can be used to
trigger a deployment script in the server.
There's also an online service called
DeployHQ, where you can configure any
repository (SVN/Git/Hg) and many deploy
methods (FTP/SFTP/S3/Rackspace).
It deploys new code using the chosen method.
4. Adv.
ideas
deployhq.com

Mais conteúdo relacionado

Mais procurados

A successful Git branching model
A successful Git branching model A successful Git branching model
A successful Git branching model abodeltae
 
FOSDEM 2017: GitLab CI
FOSDEM 2017:  GitLab CIFOSDEM 2017:  GitLab CI
FOSDEM 2017: GitLab CIOlinData
 
Git extension-training
Git extension-trainingGit extension-training
Git extension-trainingEric Guo
 
Using GitLab CI
Using GitLab CIUsing GitLab CI
Using GitLab CIColCh
 
GitFlow, SourceTree and GitLab
GitFlow, SourceTree and GitLabGitFlow, SourceTree and GitLab
GitFlow, SourceTree and GitLabShinu Suresh
 
Docker introduction in Hardware Company
Docker introduction in Hardware CompanyDocker introduction in Hardware Company
Docker introduction in Hardware CompanyEvan Lin
 
Write microservice in golang
Write microservice in golangWrite microservice in golang
Write microservice in golangBo-Yi Wu
 
Breaking Bad Habits with GitLab CI
Breaking Bad Habits with GitLab CIBreaking Bad Habits with GitLab CI
Breaking Bad Habits with GitLab CIIvan Nemytchenko
 
A painless self-hosted Git service: Gitea
A painless self-hosted Git service: GiteaA painless self-hosted Git service: Gitea
A painless self-hosted Git service: GiteaBo-Yi Wu
 
Jenkins to Gitlab - Intelligent Build-Pipelines
Jenkins to Gitlab - Intelligent Build-PipelinesJenkins to Gitlab - Intelligent Build-Pipelines
Jenkins to Gitlab - Intelligent Build-PipelinesChristian Münch
 
Git introduction for Beginners
Git introduction for BeginnersGit introduction for Beginners
Git introduction for BeginnersMortezaTaghaddomi
 

Mais procurados (20)

A successful Git branching model
A successful Git branching model A successful Git branching model
A successful Git branching model
 
Git and git flow
Git and git flowGit and git flow
Git and git flow
 
Subversion to Git Migration
Subversion to Git MigrationSubversion to Git Migration
Subversion to Git Migration
 
FOSDEM 2017: GitLab CI
FOSDEM 2017:  GitLab CIFOSDEM 2017:  GitLab CI
FOSDEM 2017: GitLab CI
 
Juc boston2014.pptx
Juc boston2014.pptxJuc boston2014.pptx
Juc boston2014.pptx
 
Git flow
Git flowGit flow
Git flow
 
Git best practices workshop
Git best practices workshopGit best practices workshop
Git best practices workshop
 
Git extension-training
Git extension-trainingGit extension-training
Git extension-training
 
Git best practices 2016
Git best practices 2016Git best practices 2016
Git best practices 2016
 
Git
GitGit
Git
 
Using GitLab CI
Using GitLab CIUsing GitLab CI
Using GitLab CI
 
Git workflows
Git workflowsGit workflows
Git workflows
 
GitFlow, SourceTree and GitLab
GitFlow, SourceTree and GitLabGitFlow, SourceTree and GitLab
GitFlow, SourceTree and GitLab
 
Git
GitGit
Git
 
Docker introduction in Hardware Company
Docker introduction in Hardware CompanyDocker introduction in Hardware Company
Docker introduction in Hardware Company
 
Write microservice in golang
Write microservice in golangWrite microservice in golang
Write microservice in golang
 
Breaking Bad Habits with GitLab CI
Breaking Bad Habits with GitLab CIBreaking Bad Habits with GitLab CI
Breaking Bad Habits with GitLab CI
 
A painless self-hosted Git service: Gitea
A painless self-hosted Git service: GiteaA painless self-hosted Git service: Gitea
A painless self-hosted Git service: Gitea
 
Jenkins to Gitlab - Intelligent Build-Pipelines
Jenkins to Gitlab - Intelligent Build-PipelinesJenkins to Gitlab - Intelligent Build-Pipelines
Jenkins to Gitlab - Intelligent Build-Pipelines
 
Git introduction for Beginners
Git introduction for BeginnersGit introduction for Beginners
Git introduction for Beginners
 

Destaque

Introduction to Kaizen by Toby Hunt
Introduction to Kaizen by Toby HuntIntroduction to Kaizen by Toby Hunt
Introduction to Kaizen by Toby Huntpebble {code}
 
Accomplishments-Certifications
Accomplishments-CertificationsAccomplishments-Certifications
Accomplishments-CertificationsMelissa Schaefer
 
Potocnik et al - Efekti i optimizacija rada višefunkcionalne mašine u slučaju...
Potocnik et al - Efekti i optimizacija rada višefunkcionalne mašine u slučaju...Potocnik et al - Efekti i optimizacija rada višefunkcionalne mašine u slučaju...
Potocnik et al - Efekti i optimizacija rada višefunkcionalne mašine u slučaju...Dusan Stojnic
 
More Leadership Lessons Workshop Global
More Leadership Lessons Workshop GlobalMore Leadership Lessons Workshop Global
More Leadership Lessons Workshop GlobalJohn Fall
 
Ch 1- Water and Soil, Stone and Metal
Ch 1- Water and Soil, Stone and MetalCh 1- Water and Soil, Stone and Metal
Ch 1- Water and Soil, Stone and MetalCraig Campbell
 
Landskapsreformen i Österbotten - Maakuntauudistus Pohjanmaalla
Landskapsreformen i Österbotten - Maakuntauudistus PohjanmaallaLandskapsreformen i Österbotten - Maakuntauudistus Pohjanmaalla
Landskapsreformen i Österbotten - Maakuntauudistus PohjanmaallaMikaela Jussila
 
Choose Coach Hire Adelaide or Adelaide Coach Hire Services
Choose Coach Hire Adelaide or Adelaide Coach Hire ServicesChoose Coach Hire Adelaide or Adelaide Coach Hire Services
Choose Coach Hire Adelaide or Adelaide Coach Hire ServicesCorstton Coaches
 
PivotReseller_Sales_Profit_by_Country_and_Occupation
PivotReseller_Sales_Profit_by_Country_and_OccupationPivotReseller_Sales_Profit_by_Country_and_Occupation
PivotReseller_Sales_Profit_by_Country_and_OccupationMike Santeramo
 
Huuhedin suvilahgui 1
Huuhedin suvilahgui 1Huuhedin suvilahgui 1
Huuhedin suvilahgui 1oyunubuns
 
Safety Leadership Event 2016 - Leader del miglioramento virale
Safety Leadership Event 2016 - Leader del miglioramento viraleSafety Leadership Event 2016 - Leader del miglioramento virale
Safety Leadership Event 2016 - Leader del miglioramento viraleSebastiano Trapani
 
Comparatividad Entre Piscis Y Acuarius
Comparatividad Entre  Piscis Y  AcuariusComparatividad Entre  Piscis Y  Acuarius
Comparatividad Entre Piscis Y Acuariusguest6942b5
 
Rezultate Eco-Scoala
Rezultate Eco-ScoalaRezultate Eco-Scoala
Rezultate Eco-ScoalaProfesorgeo
 

Destaque (17)

Introduction to Kaizen by Toby Hunt
Introduction to Kaizen by Toby HuntIntroduction to Kaizen by Toby Hunt
Introduction to Kaizen by Toby Hunt
 
Accomplishments-Certifications
Accomplishments-CertificationsAccomplishments-Certifications
Accomplishments-Certifications
 
Boquita deluna
Boquita delunaBoquita deluna
Boquita deluna
 
Potocnik et al - Efekti i optimizacija rada višefunkcionalne mašine u slučaju...
Potocnik et al - Efekti i optimizacija rada višefunkcionalne mašine u slučaju...Potocnik et al - Efekti i optimizacija rada višefunkcionalne mašine u slučaju...
Potocnik et al - Efekti i optimizacija rada višefunkcionalne mašine u slučaju...
 
The euro
The euroThe euro
The euro
 
More Leadership Lessons Workshop Global
More Leadership Lessons Workshop GlobalMore Leadership Lessons Workshop Global
More Leadership Lessons Workshop Global
 
HEAT TRANSFER
HEAT TRANSFERHEAT TRANSFER
HEAT TRANSFER
 
Ch 1- Water and Soil, Stone and Metal
Ch 1- Water and Soil, Stone and MetalCh 1- Water and Soil, Stone and Metal
Ch 1- Water and Soil, Stone and Metal
 
Landskapsreformen i Österbotten - Maakuntauudistus Pohjanmaalla
Landskapsreformen i Österbotten - Maakuntauudistus PohjanmaallaLandskapsreformen i Österbotten - Maakuntauudistus Pohjanmaalla
Landskapsreformen i Österbotten - Maakuntauudistus Pohjanmaalla
 
Choose Coach Hire Adelaide or Adelaide Coach Hire Services
Choose Coach Hire Adelaide or Adelaide Coach Hire ServicesChoose Coach Hire Adelaide or Adelaide Coach Hire Services
Choose Coach Hire Adelaide or Adelaide Coach Hire Services
 
Patientencommunicatie
PatientencommunicatiePatientencommunicatie
Patientencommunicatie
 
PivotReseller_Sales_Profit_by_Country_and_Occupation
PivotReseller_Sales_Profit_by_Country_and_OccupationPivotReseller_Sales_Profit_by_Country_and_Occupation
PivotReseller_Sales_Profit_by_Country_and_Occupation
 
Huuhedin suvilahgui 1
Huuhedin suvilahgui 1Huuhedin suvilahgui 1
Huuhedin suvilahgui 1
 
Unit 2
Unit 2Unit 2
Unit 2
 
Safety Leadership Event 2016 - Leader del miglioramento virale
Safety Leadership Event 2016 - Leader del miglioramento viraleSafety Leadership Event 2016 - Leader del miglioramento virale
Safety Leadership Event 2016 - Leader del miglioramento virale
 
Comparatividad Entre Piscis Y Acuarius
Comparatividad Entre  Piscis Y  AcuariusComparatividad Entre  Piscis Y  Acuarius
Comparatividad Entre Piscis Y Acuarius
 
Rezultate Eco-Scoala
Rezultate Eco-ScoalaRezultate Eco-Scoala
Rezultate Eco-Scoala
 

Semelhante a Deploy code easily with Git hooks

Getting started with git
Getting started with gitGetting started with git
Getting started with gitPawan Kumar.v
 
How To Install GitLab As Your Private GitHub Clone
How To Install GitLab As Your Private GitHub CloneHow To Install GitLab As Your Private GitHub Clone
How To Install GitLab As Your Private GitHub CloneVEXXHOST Private Cloud
 
Git: Why And How to
Git: Why And How toGit: Why And How to
Git: Why And How tolanhuonga3
 
Introduction to git and Github
Introduction to git and GithubIntroduction to git and Github
Introduction to git and GithubWycliff1
 
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git TutorialSage Sharp
 
.Git for WordPress Developers
.Git for WordPress Developers.Git for WordPress Developers
.Git for WordPress Developersmpvanwinkle
 
GIT workshop at Selenium Conference 2018
GIT workshop at Selenium Conference 2018GIT workshop at Selenium Conference 2018
GIT workshop at Selenium Conference 2018Pooja Shah
 
GIT_GITHUB_2016_06_17
GIT_GITHUB_2016_06_17GIT_GITHUB_2016_06_17
GIT_GITHUB_2016_06_17siva ram
 
Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configurationKishor Kumar
 
Github - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsGithub - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsLee Hanxue
 
You're doing it wrong! Git it right!
You're doing it wrong! Git it right!You're doing it wrong! Git it right!
You're doing it wrong! Git it right!Cory Webb
 

Semelhante a Deploy code easily with Git hooks (20)

Getting started with git
Getting started with gitGetting started with git
Getting started with git
 
Github basics
Github basicsGithub basics
Github basics
 
3 Git
3 Git3 Git
3 Git
 
How To Install GitLab As Your Private GitHub Clone
How To Install GitLab As Your Private GitHub CloneHow To Install GitLab As Your Private GitHub Clone
How To Install GitLab As Your Private GitHub Clone
 
Git: Why And How to
Git: Why And How toGit: Why And How to
Git: Why And How to
 
Introduction to git and Github
Introduction to git and GithubIntroduction to git and Github
Introduction to git and Github
 
Git & github
Git & githubGit & github
Git & github
 
Git Basics
Git BasicsGit Basics
Git Basics
 
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git Tutorial
 
.Git for WordPress Developers
.Git for WordPress Developers.Git for WordPress Developers
.Git for WordPress Developers
 
GIT workshop at Selenium Conference 2018
GIT workshop at Selenium Conference 2018GIT workshop at Selenium Conference 2018
GIT workshop at Selenium Conference 2018
 
Git 1
Git 1Git 1
Git 1
 
GIT_GITHUB_2016_06_17
GIT_GITHUB_2016_06_17GIT_GITHUB_2016_06_17
GIT_GITHUB_2016_06_17
 
Git basics
Git basicsGit basics
Git basics
 
Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configuration
 
Wokshop de Git
Wokshop de Git Wokshop de Git
Wokshop de Git
 
Github - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsGithub - Git Training Slides: Foundations
Github - Git Training Slides: Foundations
 
Git basics
Git basicsGit basics
Git basics
 
GitHub Event.pptx
GitHub Event.pptxGitHub Event.pptx
GitHub Event.pptx
 
You're doing it wrong! Git it right!
You're doing it wrong! Git it right!You're doing it wrong! Git it right!
You're doing it wrong! Git it right!
 

Último

Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 

Último (20)

Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 

Deploy code easily with Git hooks

  • 2. Igor Santos Web developer ● From Rio de Janeiro, Brazil ● PHP Developer for ~6 years ● Ruby and JS Developer for fun ● Playing around with git for ~2 years slideshare.net/igorsantos07
  • 3. 0. Introduction ● Knows what Git is? ● Have ever used Git in the command line? ● Have ever deployed code? ○ How? SCP? WGet? ● Anyone developing in the production server?
  • 4. 1. Git Basics ● Commit: Saves changes with a description ● Pull: Get commits from a server ● Push: Send commits to a server ● Remotes ○ A remote machine that has a copy of the repository and accepts your commits ○ In a common centralized organization you usually have one, but it's possible to have many ○ Example: main repo is BitBucket or Google Code, mirrored to GitHub
  • 5. 2. Configure your server igor@local$ ssh santos@bluenose.cs.dal.ca password: ********** santos@bluenose$ mkdir repos santos@bluenose$ cd repos santos@bluenose$ pwd /users/cs/santos/repos santos@bluenose$ git clone «repo» myRep --bare This creates a clone of that repository that works just as another repository: with all administrative data, but not useable for development, as the code is not really checked in - just the Git meta-data. Take note
  • 6. igor@local$ cd dev/myCode igor@local$ git remote add prod ssh://santos@bluenose.cs.dal.ca:/users/cs/santos/repos/myRep igor@local$ "Hi there!" > README.mkd igor@local$ git commit "+ Adding readme" igor@local$ git push prod 2. Configure your server Name given to the remote server Complete repository URL No line break!
  • 7. igor@local$ git commit "+ Adding readme" igor@local$ git push prod Q: OK, so... where's my README file? A: In the repository! Q: I can't see it. «not really a question» 2. Configure your server
  • 8. 3. Git Hooks ● 2 types: client and server hooks ● Client: ○ pre/post-commit ○ [prepare-]commit-msg ○ post-checkout, post-merge ● Server: ○ pre/post-receive Once per push ○ update Once per pushed branch http://git-scm.com/book/en/Customizing-Git-Git-Hooks
  • 9. 3. Git Hooks Simple copy $ cat hooks/post-receive #!/bin/sh GIT_WORK_TREE=/var/www/mysite git checkout -f Opposite of git clone --bare: copies the entire repository code, without git data. By default does that with the master branch, but you can use other options here as well. GIT_WORK_TREE tells git where it would copy stuff.
  • 10. 3. Git Hooks Complete deployment script https://bitbucket.org/igorsantos07/calen-do/src/3fea92ee46c1/git-hooks/update
  • 11. 4. Advanced ideas GitHub and other Git online repositories have options to do HTTP requests with code information after pushes, similar to post- receive hooks. This data can be used to trigger a deployment script in the server. There's also an online service called DeployHQ, where you can configure any repository (SVN/Git/Hg) and many deploy methods (FTP/SFTP/S3/Rackspace). It deploys new code using the chosen method.