SlideShare a Scribd company logo
1 of 31
Workflow Nel
Cartões são cadastrados no trello
Criamos uma issue no github
Incluimos no comentário do commit, o #código da issue
hack && ship
(Hashrocket)
http://reinh.com/blog/2008/08/27/hack-and-and-ship.htmlFonte:
t1k
t1k:hack
rake t1k:hack[E7lUvZ6Y]
~/W/w/matanza2_test git:master ❯❯❯ rake t1k:hack[E7lUvZ6Y]
Catching card
Creating issue
Updating card
Card #17 created and tracked
Already on 'master'
Your branch is up-to-date with 'origin/master'.
From github.com:rodrigomaia/matanza2_test
* branch master -> FETCH_HEAD
Current branch master is up to date.
Switched to a new branch '17'
~/W/w/matanza2_test git:17 ❯❯❯
t1k:commit
rake t1k:commit['criando método de teste',close]
~/W/w/matanza2_test git:17 ❯❯❯ rake t1k:commit['criando método de teste',
[17 c2de9eb] [close #17] criando método de teste
1 file changed, 3 insertions(+)
t1k:sink
rake t1k:sink
~/W/w/matanza2_test git:17 ❯❯❯ rake t1k:sink
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.
From github.com:rodrigomaia/matanza2_test
* branch master -> FETCH_HEAD
Current branch master is up to date.
Switched to branch '17'
Already on '17'
Current branch 17 is up to date.
t1k:ship
rake t1k:ship
~/W/w/matanza2_test git:17 ❯❯❯ rake t1k:ship ✭
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.
Current branch master is up to date.
Updating bfae756..c2de9eb
Fast-forward
app/models/notum.rb | 3 +++
1 file changed, 3 insertions(+)
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)
nothing to commit, working directory clean
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 480 bytes | 0 bytes/s, done.
Total 5 (delta 3), reused 0 (delta 0)
To git@github.com:rodrigomaia/matanza2_test.git
bfae756..c2de9eb master -> master
~/W/w/matanza2_test git:master ❯❯❯
Como usar?
gem 't1k'
14
15 T1k.configure do |config|
16 config[:github_user] = 'rodrigomaia'
17 config[:github_repo] = 'matanza2_test'
18 config[:github_oauth_token] = ENV["GITHUB_TOKEN"]
19 config[:trello_developer_public_key] = ENV["TRELLO_KEY"]
20 config[:trello_member_token] = ENV["TRELLO_TOKEN"]
21 config[:trello_user_name] = 'rudrige'
22 config[:trello_board_name] = 't1k'
23 end
Código do t1k
1 require 'rake'
2
3 # rake t1k:hack['uD2GBBMf']
4 namespace :t1k do
5 desc "Cria issue e atualiza cartão do trello"
6
7 task :hack, [:path_card_part] do |t, args|
8 code_card = T1k::hack args[:path_card_part]
9
10 system 'git checkout master'
11 system 'git pull --rebase origin master'
12 system "git checkout -b #{code_card}"
13 end
14 end
1 require 'rake'
2
3 #rake t1k:commit['comentario do commit',close]
4 namespace :t1k do
5 desc "Commita com a info da issue para vincular ao github"
6
7 task :commit, [:comment, :close] do |t, args|
8 closed = args[:close] == 'close' ? "close " : ""
9 branch = `git branch | grep '*' | awk '{print $2}'`
10 system "git commit -m '[#{closed}##{branch.strip}] #{args[:comment]}'"
11 end
12 end
1 require 'rake'
2
3 #rake t1k:sink
4 namespace :t1k do
5 desc "Sincroniza branch atual com o master"
6
7 task :sink do |t, args|
8 branch = `git branch | grep '*' | awk '{print $2}'`
9 system "git checkout master"
10 system "git pull --rebase origin master"
11 system "git checkout #{branch.strip}"
12 system "git rebase master #{branch.strip}"
13 end
14 end
1 require 'rake'
2
3 #rake t1k:ship
4 namespace :t1k do
5 desc "Faz merge com o master e pusha"
6
7 task :ship do |t, args|
8 branch = `git branch | grep '*' | awk '{print $2}'`
9 system "git checkout master"
10 system "git pull --rebase"
11 system "git merge #{branch.strip}"
12 system "git commit -v"
13 system "git push origin master"
14 end
15 end
2 require "trello"
3 require "github_api"
4
5 module T1k
6 @@config = {}
7
8 def self.configure &block
9 block.call @@config
10 config_trello
11 config_github
12 end
13
14 def self.hack url_card
15 card = get_card url_card
16 issue = create_issue card.name
17 code_issue = get_issue_code issue
18
19 update_card card, code_issue
20 puts "Card ##{code_issue[:code]} created and tracked"
21 code_issue[:code]
22 end
23
24 private
25
26 def self.get_card url_card
27 begin
28 puts "Catching card"
29 me = Trello::Member.find(@@config[:trello_user_name])
30 board = me.boards.select{|x| x.name.upcase == @@config[:trello_board_name].upcase}.first
31 card = board.cards.select{|x| x.url.index(url_card)}.first
32 raise if card.nil?
33
34 card
35 rescue
36 raise 'Card not found'
37 end
38 end
39
40 def self.update_card card, issue_code
41 puts "Updating card"
42 card.name = "[##{issue_code[:code]}] #{card.name}"
43 card.desc = "#{issue_code[:link]} #{card.desc}"
44 card.save
45 end
46
47 def self.create_issue title
48 begin
49 puts "Creating issue"
50 github_auth = Github.new :oauth_token => @@config[:github_oauth_token]
51 github_auth.issues.create user: @@config[:github_user], repo: @@config[:github_repo], title: title
52 rescue
53 raise 'Issue not created'
54 end
55 end
56
57 def self.get_issue_code issue
58 url_issue = issue.html_url
59 code = url_issue[url_issue.rindex('/')+1..url_issue.size]
60 code_html_issue = {code: code,link: "Link to code: [#{code}](#{url_issue})”}
61
62 end
63
64 def self.config_trello
68 Trello.configure do |config|
69 config.developer_public_key = @@config[:trello_developer_public_key]
70 config.member_token = @@config[:trello_member_token]
71 end
72 end
73
74 def self.config_github
77 end
https://github.com/fortesinformatica/t1k
https://rubygems.org/gems/t1k
[ t1k ]

More Related Content

What's hot

DESTRUCTOR EXAMPLES
DESTRUCTOR EXAMPLESDESTRUCTOR EXAMPLES
DESTRUCTOR EXAMPLESsrishti80
 
Construire une application JavaFX 8 avec gradle
Construire une application JavaFX 8 avec gradleConstruire une application JavaFX 8 avec gradle
Construire une application JavaFX 8 avec gradleThierry Wasylczenko
 
Data structure programs in c++
Data structure programs in c++Data structure programs in c++
Data structure programs in c++mmirfan
 
The Node.js Event Loop: Not So Single Threaded
The Node.js Event Loop: Not So Single ThreadedThe Node.js Event Loop: Not So Single Threaded
The Node.js Event Loop: Not So Single ThreadedBryan Hughes
 
The Ring programming language version 1.3 book - Part 59 of 88
The Ring programming language version 1.3 book - Part 59 of 88The Ring programming language version 1.3 book - Part 59 of 88
The Ring programming language version 1.3 book - Part 59 of 88Mahmoud Samir Fayed
 
c++ program for Canteen management
c++ program for Canteen managementc++ program for Canteen management
c++ program for Canteen managementSwarup Kumar Boro
 
Mysql5.1 character set testing
Mysql5.1 character set testingMysql5.1 character set testing
Mysql5.1 character set testingPhilip Zhong
 
LISA QooxdooTutorial Slides
LISA QooxdooTutorial SlidesLISA QooxdooTutorial Slides
LISA QooxdooTutorial SlidesTobias Oetiker
 
The Ring programming language version 1.5.2 book - Part 74 of 181
The Ring programming language version 1.5.2 book - Part 74 of 181The Ring programming language version 1.5.2 book - Part 74 of 181
The Ring programming language version 1.5.2 book - Part 74 of 181Mahmoud Samir Fayed
 
PyconKR 2018 Deep dive into Coroutine
PyconKR 2018 Deep dive into CoroutinePyconKR 2018 Deep dive into Coroutine
PyconKR 2018 Deep dive into CoroutineDaehee Kim
 
Compare mysql5.1.50 mysql5.5.8
Compare mysql5.1.50 mysql5.5.8Compare mysql5.1.50 mysql5.5.8
Compare mysql5.1.50 mysql5.5.8Philip Zhong
 
Mysql handle socket
Mysql handle socketMysql handle socket
Mysql handle socketPhilip Zhong
 
Call stack, event loop and async programming
Call stack, event loop and async programmingCall stack, event loop and async programming
Call stack, event loop and async programmingMasters Academy
 
LvivPy4 - Threading vs asyncio
LvivPy4 - Threading vs asyncioLvivPy4 - Threading vs asyncio
LvivPy4 - Threading vs asyncioRoman Rader
 
こわくないよ❤️ Playframeworkソースコードリーディング入門
こわくないよ❤️ Playframeworkソースコードリーディング入門こわくないよ❤️ Playframeworkソースコードリーディング入門
こわくないよ❤️ Playframeworkソースコードリーディング入門tanacasino
 
Степан Кольцов — Rust — лучше, чем C++
Степан Кольцов — Rust — лучше, чем C++Степан Кольцов — Rust — лучше, чем C++
Степан Кольцов — Rust — лучше, чем C++Yandex
 

What's hot (20)

DESTRUCTOR EXAMPLES
DESTRUCTOR EXAMPLESDESTRUCTOR EXAMPLES
DESTRUCTOR EXAMPLES
 
Construire une application JavaFX 8 avec gradle
Construire une application JavaFX 8 avec gradleConstruire une application JavaFX 8 avec gradle
Construire une application JavaFX 8 avec gradle
 
Data structure programs in c++
Data structure programs in c++Data structure programs in c++
Data structure programs in c++
 
The Node.js Event Loop: Not So Single Threaded
The Node.js Event Loop: Not So Single ThreadedThe Node.js Event Loop: Not So Single Threaded
The Node.js Event Loop: Not So Single Threaded
 
Gevent rabbit rpc
Gevent rabbit rpcGevent rabbit rpc
Gevent rabbit rpc
 
#JavaFX.forReal() - ElsassJUG
#JavaFX.forReal() - ElsassJUG#JavaFX.forReal() - ElsassJUG
#JavaFX.forReal() - ElsassJUG
 
The Ring programming language version 1.3 book - Part 59 of 88
The Ring programming language version 1.3 book - Part 59 of 88The Ring programming language version 1.3 book - Part 59 of 88
The Ring programming language version 1.3 book - Part 59 of 88
 
c++ program for Canteen management
c++ program for Canteen managementc++ program for Canteen management
c++ program for Canteen management
 
Mysql5.1 character set testing
Mysql5.1 character set testingMysql5.1 character set testing
Mysql5.1 character set testing
 
LISA QooxdooTutorial Slides
LISA QooxdooTutorial SlidesLISA QooxdooTutorial Slides
LISA QooxdooTutorial Slides
 
The Ring programming language version 1.5.2 book - Part 74 of 181
The Ring programming language version 1.5.2 book - Part 74 of 181The Ring programming language version 1.5.2 book - Part 74 of 181
The Ring programming language version 1.5.2 book - Part 74 of 181
 
PyconKR 2018 Deep dive into Coroutine
PyconKR 2018 Deep dive into CoroutinePyconKR 2018 Deep dive into Coroutine
PyconKR 2018 Deep dive into Coroutine
 
Cooking pies with Celery
Cooking pies with CeleryCooking pies with Celery
Cooking pies with Celery
 
Compare mysql5.1.50 mysql5.5.8
Compare mysql5.1.50 mysql5.5.8Compare mysql5.1.50 mysql5.5.8
Compare mysql5.1.50 mysql5.5.8
 
Hello c
Hello cHello c
Hello c
 
Mysql handle socket
Mysql handle socketMysql handle socket
Mysql handle socket
 
Call stack, event loop and async programming
Call stack, event loop and async programmingCall stack, event loop and async programming
Call stack, event loop and async programming
 
LvivPy4 - Threading vs asyncio
LvivPy4 - Threading vs asyncioLvivPy4 - Threading vs asyncio
LvivPy4 - Threading vs asyncio
 
こわくないよ❤️ Playframeworkソースコードリーディング入門
こわくないよ❤️ Playframeworkソースコードリーディング入門こわくないよ❤️ Playframeworkソースコードリーディング入門
こわくないよ❤️ Playframeworkソースコードリーディング入門
 
Степан Кольцов — Rust — лучше, чем C++
Степан Кольцов — Rust — лучше, чем C++Степан Кольцов — Rust — лучше, чем C++
Степан Кольцов — Rust — лучше, чем C++
 

Similar to Workflow && t1k

Openstack 101
Openstack 101Openstack 101
Openstack 101POSSCON
 
Reverse engineering Swisscom's Centro Grande Modem
Reverse engineering Swisscom's Centro Grande ModemReverse engineering Swisscom's Centro Grande Modem
Reverse engineering Swisscom's Centro Grande ModemCyber Security Alliance
 
Railsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshareRailsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slidesharetomcopeland
 
Introducing Scylla Manager: Cluster Management and Task Automation
Introducing Scylla Manager: Cluster Management and Task AutomationIntroducing Scylla Manager: Cluster Management and Task Automation
Introducing Scylla Manager: Cluster Management and Task AutomationScyllaDB
 
Rootkit on Linux X86 v2.6
Rootkit on Linux X86 v2.6Rootkit on Linux X86 v2.6
Rootkit on Linux X86 v2.6fisher.w.y
 
Jdk 7 4-forkjoin
Jdk 7 4-forkjoinJdk 7 4-forkjoin
Jdk 7 4-forkjoinknight1128
 
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
파이썬 개발환경 구성하기의 끝판왕 - Docker Composeraccoony
 
Gitlab Training with GIT and SourceTree
Gitlab Training with GIT and SourceTreeGitlab Training with GIT and SourceTree
Gitlab Training with GIT and SourceTreeTeerapat Khunpech
 
Introducción a git y GitHub
Introducción a git y GitHubIntroducción a git y GitHub
Introducción a git y GitHubLucas Videla
 
Global Interpreter Lock: Episode I - Break the Seal
Global Interpreter Lock: Episode I - Break the SealGlobal Interpreter Lock: Episode I - Break the Seal
Global Interpreter Lock: Episode I - Break the SealTzung-Bi Shih
 
Triangle OpenStack meetup 09 2013
Triangle OpenStack meetup 09 2013Triangle OpenStack meetup 09 2013
Triangle OpenStack meetup 09 2013Dan Radez
 
Calculator Week2.DS_Store__MACOSXCalculator Week2._.DS_St.docx
Calculator Week2.DS_Store__MACOSXCalculator Week2._.DS_St.docxCalculator Week2.DS_Store__MACOSXCalculator Week2._.DS_St.docx
Calculator Week2.DS_Store__MACOSXCalculator Week2._.DS_St.docxRAHUL126667
 
44CON London 2015 - Jtagsploitation: 5 wires, 5 ways to root
44CON London 2015 - Jtagsploitation: 5 wires, 5 ways to root44CON London 2015 - Jtagsploitation: 5 wires, 5 ways to root
44CON London 2015 - Jtagsploitation: 5 wires, 5 ways to root44CON
 
GPU Programming on CPU - Using C++AMP
GPU Programming on CPU - Using C++AMPGPU Programming on CPU - Using C++AMP
GPU Programming on CPU - Using C++AMPMiller Lee
 
Everything you didn't know you needed
Everything you didn't know you neededEverything you didn't know you needed
Everything you didn't know you neededHenry Schreiner
 
Sacándole jugo a git
Sacándole jugo a gitSacándole jugo a git
Sacándole jugo a gitBerny Cantos
 

Similar to Workflow && t1k (20)

Github integration-kostyasha
Github integration-kostyashaGithub integration-kostyasha
Github integration-kostyasha
 
Osol Pgsql
Osol PgsqlOsol Pgsql
Osol Pgsql
 
Openstack 101
Openstack 101Openstack 101
Openstack 101
 
Reverse engineering Swisscom's Centro Grande Modem
Reverse engineering Swisscom's Centro Grande ModemReverse engineering Swisscom's Centro Grande Modem
Reverse engineering Swisscom's Centro Grande Modem
 
Railsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshareRailsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshare
 
Introducing Scylla Manager: Cluster Management and Task Automation
Introducing Scylla Manager: Cluster Management and Task AutomationIntroducing Scylla Manager: Cluster Management and Task Automation
Introducing Scylla Manager: Cluster Management and Task Automation
 
Rootkit on Linux X86 v2.6
Rootkit on Linux X86 v2.6Rootkit on Linux X86 v2.6
Rootkit on Linux X86 v2.6
 
Jdk 7 4-forkjoin
Jdk 7 4-forkjoinJdk 7 4-forkjoin
Jdk 7 4-forkjoin
 
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
 
Gitlab Training with GIT and SourceTree
Gitlab Training with GIT and SourceTreeGitlab Training with GIT and SourceTree
Gitlab Training with GIT and SourceTree
 
Introducción a git y GitHub
Introducción a git y GitHubIntroducción a git y GitHub
Introducción a git y GitHub
 
Global Interpreter Lock: Episode I - Break the Seal
Global Interpreter Lock: Episode I - Break the SealGlobal Interpreter Lock: Episode I - Break the Seal
Global Interpreter Lock: Episode I - Break the Seal
 
Triangle OpenStack meetup 09 2013
Triangle OpenStack meetup 09 2013Triangle OpenStack meetup 09 2013
Triangle OpenStack meetup 09 2013
 
Calculator Week2.DS_Store__MACOSXCalculator Week2._.DS_St.docx
Calculator Week2.DS_Store__MACOSXCalculator Week2._.DS_St.docxCalculator Week2.DS_Store__MACOSXCalculator Week2._.DS_St.docx
Calculator Week2.DS_Store__MACOSXCalculator Week2._.DS_St.docx
 
44CON London 2015 - Jtagsploitation: 5 wires, 5 ways to root
44CON London 2015 - Jtagsploitation: 5 wires, 5 ways to root44CON London 2015 - Jtagsploitation: 5 wires, 5 ways to root
44CON London 2015 - Jtagsploitation: 5 wires, 5 ways to root
 
Basic Linux kernel
Basic Linux kernelBasic Linux kernel
Basic Linux kernel
 
GPU Programming on CPU - Using C++AMP
GPU Programming on CPU - Using C++AMPGPU Programming on CPU - Using C++AMP
GPU Programming on CPU - Using C++AMP
 
Everything you didn't know you needed
Everything you didn't know you neededEverything you didn't know you needed
Everything you didn't know you needed
 
Sacándole jugo a git
Sacándole jugo a gitSacándole jugo a git
Sacándole jugo a git
 
syn
synsyn
syn
 

Recently uploaded

Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 

Recently uploaded (20)

Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 

Workflow && t1k

  • 3. Criamos uma issue no github Incluimos no comentário do commit, o #código da issue
  • 6. t1k
  • 7.
  • 8.
  • 11. ~/W/w/matanza2_test git:master ❯❯❯ rake t1k:hack[E7lUvZ6Y] Catching card Creating issue Updating card Card #17 created and tracked Already on 'master' Your branch is up-to-date with 'origin/master'. From github.com:rodrigomaia/matanza2_test * branch master -> FETCH_HEAD Current branch master is up to date. Switched to a new branch '17' ~/W/w/matanza2_test git:17 ❯❯❯
  • 12.
  • 15. ~/W/w/matanza2_test git:17 ❯❯❯ rake t1k:commit['criando método de teste', [17 c2de9eb] [close #17] criando método de teste 1 file changed, 3 insertions(+)
  • 18. ~/W/w/matanza2_test git:17 ❯❯❯ rake t1k:sink Switched to branch 'master' Your branch is up-to-date with 'origin/master'. From github.com:rodrigomaia/matanza2_test * branch master -> FETCH_HEAD Current branch master is up to date. Switched to branch '17' Already on '17' Current branch 17 is up to date.
  • 21. ~/W/w/matanza2_test git:17 ❯❯❯ rake t1k:ship ✭ Switched to branch 'master' Your branch is up-to-date with 'origin/master'. Current branch master is up to date. Updating bfae756..c2de9eb Fast-forward app/models/notum.rb | 3 +++ 1 file changed, 3 insertions(+) On branch master Your branch is ahead of 'origin/master' by 1 commit. (use "git push" to publish your local commits) nothing to commit, working directory clean Counting objects: 5, done. Delta compression using up to 4 threads. Compressing objects: 100% (5/5), done. Writing objects: 100% (5/5), 480 bytes | 0 bytes/s, done. Total 5 (delta 3), reused 0 (delta 0) To git@github.com:rodrigomaia/matanza2_test.git bfae756..c2de9eb master -> master ~/W/w/matanza2_test git:master ❯❯❯
  • 22.
  • 24. gem 't1k' 14 15 T1k.configure do |config| 16 config[:github_user] = 'rodrigomaia' 17 config[:github_repo] = 'matanza2_test' 18 config[:github_oauth_token] = ENV["GITHUB_TOKEN"] 19 config[:trello_developer_public_key] = ENV["TRELLO_KEY"] 20 config[:trello_member_token] = ENV["TRELLO_TOKEN"] 21 config[:trello_user_name] = 'rudrige' 22 config[:trello_board_name] = 't1k' 23 end
  • 26. 1 require 'rake' 2 3 # rake t1k:hack['uD2GBBMf'] 4 namespace :t1k do 5 desc "Cria issue e atualiza cartão do trello" 6 7 task :hack, [:path_card_part] do |t, args| 8 code_card = T1k::hack args[:path_card_part] 9 10 system 'git checkout master' 11 system 'git pull --rebase origin master' 12 system "git checkout -b #{code_card}" 13 end 14 end
  • 27. 1 require 'rake' 2 3 #rake t1k:commit['comentario do commit',close] 4 namespace :t1k do 5 desc "Commita com a info da issue para vincular ao github" 6 7 task :commit, [:comment, :close] do |t, args| 8 closed = args[:close] == 'close' ? "close " : "" 9 branch = `git branch | grep '*' | awk '{print $2}'` 10 system "git commit -m '[#{closed}##{branch.strip}] #{args[:comment]}'" 11 end 12 end
  • 28. 1 require 'rake' 2 3 #rake t1k:sink 4 namespace :t1k do 5 desc "Sincroniza branch atual com o master" 6 7 task :sink do |t, args| 8 branch = `git branch | grep '*' | awk '{print $2}'` 9 system "git checkout master" 10 system "git pull --rebase origin master" 11 system "git checkout #{branch.strip}" 12 system "git rebase master #{branch.strip}" 13 end 14 end
  • 29. 1 require 'rake' 2 3 #rake t1k:ship 4 namespace :t1k do 5 desc "Faz merge com o master e pusha" 6 7 task :ship do |t, args| 8 branch = `git branch | grep '*' | awk '{print $2}'` 9 system "git checkout master" 10 system "git pull --rebase" 11 system "git merge #{branch.strip}" 12 system "git commit -v" 13 system "git push origin master" 14 end 15 end
  • 30. 2 require "trello" 3 require "github_api" 4 5 module T1k 6 @@config = {} 7 8 def self.configure &block 9 block.call @@config 10 config_trello 11 config_github 12 end 13 14 def self.hack url_card 15 card = get_card url_card 16 issue = create_issue card.name 17 code_issue = get_issue_code issue 18 19 update_card card, code_issue 20 puts "Card ##{code_issue[:code]} created and tracked" 21 code_issue[:code] 22 end 23 24 private 25 26 def self.get_card url_card 27 begin 28 puts "Catching card" 29 me = Trello::Member.find(@@config[:trello_user_name]) 30 board = me.boards.select{|x| x.name.upcase == @@config[:trello_board_name].upcase}.first 31 card = board.cards.select{|x| x.url.index(url_card)}.first 32 raise if card.nil? 33 34 card 35 rescue 36 raise 'Card not found' 37 end 38 end 39 40 def self.update_card card, issue_code 41 puts "Updating card" 42 card.name = "[##{issue_code[:code]}] #{card.name}" 43 card.desc = "#{issue_code[:link]} #{card.desc}" 44 card.save 45 end 46 47 def self.create_issue title 48 begin 49 puts "Creating issue" 50 github_auth = Github.new :oauth_token => @@config[:github_oauth_token] 51 github_auth.issues.create user: @@config[:github_user], repo: @@config[:github_repo], title: title 52 rescue 53 raise 'Issue not created' 54 end 55 end 56 57 def self.get_issue_code issue 58 url_issue = issue.html_url 59 code = url_issue[url_issue.rindex('/')+1..url_issue.size] 60 code_html_issue = {code: code,link: "Link to code: [#{code}](#{url_issue})”} 61 62 end 63 64 def self.config_trello 68 Trello.configure do |config| 69 config.developer_public_key = @@config[:trello_developer_public_key] 70 config.member_token = @@config[:trello_member_token] 71 end 72 end 73 74 def self.config_github 77 end