ibm power systems 1q’15 launch messaging and...

17
9/22/2016 1 Welcome to the Waitless World © 2015 IBM Corporation Constellations on i – Orion, Git and RPG Jesse Gorzinski – [email protected] IBM i Emerging Solutions © 2015 IBM Corporation Welcome to the Waitless World Git – what is it? Linus Torvalds inventor of Linux wanted a better source control system so he wrote one Very popular in the open source community and increasingly in enterprises Distributed Version Control System Some distinctives NOT a server! Just a simple executable Stores all of its meta data in one .git directory at the root of your repository Very fast !

Upload: others

Post on 26-Jun-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: IBM Power Systems 1Q’15 launch messaging and …lisug.org/presentations/Git_and_Orion_for_LISUG.pdfGit hooks • To install a git hook, just put an executable file in the hooks directory

9/22/2016

1

Welcome to the Waitless World

© 2015 IBM Corporation

Constellations on i –Orion, Git and RPG

Jesse Gorzinski – [email protected]

IBM i Emerging Solutions

© 2015 IBM Corporation

Welcome to the Waitless World

Git – what is it?

• Linus Torvalds – inventor of Linux wanted a better source control system – so

he wrote one

• Very popular in the open source community and increasingly in enterprises

• Distributed Version Control System

• Some distinctives

• NOT a server! Just a simple executable

• Stores all of its meta data in one .git directory at the root of your

repository

• Very fast !

Page 2: IBM Power Systems 1Q’15 launch messaging and …lisug.org/presentations/Git_and_Orion_for_LISUG.pdfGit hooks • To install a git hook, just put an executable file in the hooks directory

9/22/2016

2

© 2015 IBM Corporation

Welcome to the Waitless World

Snapshots, Not Differences -> Nearly every operation

local -> FAST!!

From https://git-scm.com/book/en/v2/Getting-Started-Git-Basics

Other VCS store deltas from the

original

Git stores full copies (links, compressed)

Everyone has a full repository

Nearly every operation is local

Full redundancy with all other

repositories

© 2015 IBM Corporation

Welcome to the Waitless World

Hash codes

• All content is check-summed into a SHA-1 hash code

• From then on the file is referred to by that hash code

• Probability of collision is very small ~ # of sand grains on earth

• => the content is tracked so empty directories are not

• Commits are also referred to by a hash code

Page 3: IBM Power Systems 1Q’15 launch messaging and …lisug.org/presentations/Git_and_Orion_for_LISUG.pdfGit hooks • To install a git hook, just put an executable file in the hooks directory

9/22/2016

3

© 2015 IBM Corporation

Welcome to the Waitless World

Small & Fast!

source: https://git-scm.com/about/small-and-fast

© 2015 IBM Corporation

Welcome to the Waitless World

High-level flow

Page 4: IBM Power Systems 1Q’15 launch messaging and …lisug.org/presentations/Git_and_Orion_for_LISUG.pdfGit hooks • To install a git hook, just put an executable file in the hooks directory

9/22/2016

4

© 2015 IBM Corporation

Welcome to the Waitless World

Staging area?

• Before the commit, files get "staged"

• Why?

– Commit only one of several changed files

– Commit only a portion of a changed file!

© 2015 IBM Corporation

Welcome to the Waitless World

Branching and Merging

image source= https://git-scm.com/about

Page 5: IBM Power Systems 1Q’15 launch messaging and …lisug.org/presentations/Git_and_Orion_for_LISUG.pdfGit hooks • To install a git hook, just put an executable file in the hooks directory

9/22/2016

5

© 2015 IBM Corporation

Welcome to the Waitless World

Cherry-picking

source: https://git-scm.com/book/en/v2/Distributed-Git-Maintaining-a-Project

© 2015 IBM Corporation

Welcome to the Waitless World

Cherry-picking

source: https://git-scm.com/book/en/v2/Distributed-Git-Maintaining-a-Project

Page 6: IBM Power Systems 1Q’15 launch messaging and …lisug.org/presentations/Git_and_Orion_for_LISUG.pdfGit hooks • To install a git hook, just put an executable file in the hooks directory

9/22/2016

6

© 2015 IBM Corporation

Welcome to the Waitless World

Git hooks

• To install a git hook, just put an executable file in the hooks directory

• The name of the file is the hook

• Example, to install a post-receive hook, do this from the .git/hooks directory

(depending on how you created the repository, the hooks directory may need

to be created)

• Then, populate the file with the commands needed

© 2015 IBM Corporation

Welcome to the Waitless World

git hooks (https://git-scm.com/docs/githooks)

• applypatch-msg

• pre-applypatch

• post-applypatch

• pre-commit

• prepare-commit-msg

• commit-msg

• post-commit

• pre-rebase

• post-checkout

• post-merge

• pre-push

• pre-receive

• update

• post-receive

• post-update

• push-to-checkout

• pre-auto-gc

• post-rewrite

• rebase

Page 7: IBM Power Systems 1Q’15 launch messaging and …lisug.org/presentations/Git_and_Orion_for_LISUG.pdfGit hooks • To install a git hook, just put an executable file in the hooks directory

9/22/2016

7

© 2015 IBM Corporation

Welcome to the Waitless World

Git hook example

© 2015 IBM Corporation

Welcome to the Waitless World

bit.ly/5733sc1-op1 - 5733SC1 instructions

ssh-keygen contained in 5733SC1 IBM Portable Utilities for i5/OS

*BASE & Option 1

$ ssh-keygen$ ls ~/.sshauthorized_keys id_rsa id_rsa.pub known_hosts

ssh-keygen creates necessary files

Copy/paste id_rsa.pub into GitHub/Bitbucket web interface

$ cat ~/.ssh/id_rsa.pubssh-rsa AAAABxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxpomIpqNexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxLUMp4zhi4BqGHIl [email protected]

To communicate with repository via SSH, you need to give them

your public SSH key for password-less authentication.

SSH

Page 8: IBM Power Systems 1Q’15 launch messaging and …lisug.org/presentations/Git_and_Orion_for_LISUG.pdfGit hooks • To install a git hook, just put an executable file in the hooks directory

9/22/2016

8

© 2015 IBM Corporation

Welcome to the Waitless World

Where can I get Git?

• Can download to your PC

• Can add to your Eclipse

• Can use http://github.org right now and have it hosted in the cloud

• this how a lot of open source is developed

• Or ……

• Install it on your IBM i !

• 5733-OPS option 6

• And then install PTF

• Coming soon

• Follow DeveloperWork Page on 5733OPS

© 2015 IBM Corporation

Welcome to the Waitless World

Orion

Powerful

Web Editor

- Supports

open source

languages

AND free form

RPG

Zero install – runs in the browser – on any platform –

cheaper, easier than SEU

Compact

Git UI

- Strong git

source

control

support in

elegant and

powerful

single page

layout

Versatile theming – editor can be light, dark – by customization

or importing themes

Page 9: IBM Power Systems 1Q’15 launch messaging and …lisug.org/presentations/Git_and_Orion_for_LISUG.pdfGit hooks • To install a git hook, just put an executable file in the hooks directory

9/22/2016

9

© 2015 IBM Corporation

Welcome to the Waitless World

Free form RPG in Orion!

© 2015 IBM Corporation

Welcome to the Waitless World

• Aaron Bartell published an article just recently on Orion/RPG

• He told me that he had the most screen caps in any article he has ever

written

• Detailed scenario of how to develop in RPG using Orion

Industry pundits have already published articles

http://www.mcpressonline.com/rpg/techtip-shoot-for-orion-with-your-rpg.html

Page 10: IBM Power Systems 1Q’15 launch messaging and …lisug.org/presentations/Git_and_Orion_for_LISUG.pdfGit hooks • To install a git hook, just put an executable file in the hooks directory

9/22/2016

10

© 2015 IBM Corporation

Welcome to the Waitless World

Think through the implications of editing RPG in a

browser

• You can now edit RPG on any device that has a browser

• Windows

• Linux

• Mac

• Tablet

• Phone

• Etc.

• It requires no installation per user

© 2015 IBM Corporation

Welcome to the Waitless World

Orion - Language Support

• First class editor support for

• JavaScript

• HTML

• CSS

• Basic editing for

• Free form RPG

• Python

• PHP

• C/C++

• Ruby

• Etc.

Page 11: IBM Power Systems 1Q’15 launch messaging and …lisug.org/presentations/Git_and_Orion_for_LISUG.pdfGit hooks • To install a git hook, just put an executable file in the hooks directory

9/22/2016

11

© 2015 IBM Corporation

Welcome to the Waitless World

Orion is actively being developed – key part of IBM’s

strategic BlueMix

© 2015 IBM Corporation

Welcome to the Waitless World

Where can I get Orion?

• See https://wiki.eclipse.org/Orion

• Can download to your PC

• Can use http://orionhub.org right now and have it hosted in the

cloud

• Or ……

• Install it on your IBM i !

• 5733-OPS option 8

• And then install PTF

• Coming soon

• Follow DeveloperWork Page on 5733OPS

• Only this version supports free form RPG

Page 12: IBM Power Systems 1Q’15 launch messaging and …lisug.org/presentations/Git_and_Orion_for_LISUG.pdfGit hooks • To install a git hook, just put an executable file in the hooks directory

9/22/2016

12

© 2015 IBM Corporation

Welcome to the Waitless World

RDi and Git

• Eclipse has a free extension to support

Git called EGit

• Anyone with Eclipse can install it from

the Help->Eclipse Marketplace…

• If you have RDi Java Modernization

Edition – it is an optional component

© 2015 IBM Corporation

Welcome to the Waitless World

Think through the implications of Orion + Git

Here's a scenario:

Jesse is travelling. He's at the airport and just has a tablet and his

phone. He receives an urgent call from Edmund that there's a

bug in his code and Sam's pay is incorrect. He logs onto Orion,

fixes the bug, and pushes the change back to Git. Back at the

office, Edmund fetches the change from Git into an i Project in

RDi and recompiles the program. Sam's pay is fixed and the

problem didn't have to wait until Jesse returned from his trip.

Page 13: IBM Power Systems 1Q’15 launch messaging and …lisug.org/presentations/Git_and_Orion_for_LISUG.pdfGit hooks • To install a git hook, just put an executable file in the hooks directory

9/22/2016

13

© 2015 IBM Corporation

Welcome to the Waitless World

Edit RPG to change Sam’s pay – original pay 50000.99

© 2015 IBM Corporation

Welcome to the Waitless World

Sam’s pay is edited – now 50000.33

Page 14: IBM Power Systems 1Q’15 launch messaging and …lisug.org/presentations/Git_and_Orion_for_LISUG.pdfGit hooks • To install a git hook, just put an executable file in the hooks directory

9/22/2016

14

© 2015 IBM Corporation

Welcome to the Waitless World

Git view to commit the change

© 2015 IBM Corporation

Welcome to the Waitless World

Push change using Git

Page 15: IBM Power Systems 1Q’15 launch messaging and …lisug.org/presentations/Git_and_Orion_for_LISUG.pdfGit hooks • To install a git hook, just put an executable file in the hooks directory

9/22/2016

15

© 2015 IBM Corporation

Welcome to the Waitless World

Change is now in the Git repository history

© 2015 IBM Corporation

Welcome to the Waitless World

Fetch from Git into RDi

Page 16: IBM Power Systems 1Q’15 launch messaging and …lisug.org/presentations/Git_and_Orion_for_LISUG.pdfGit hooks • To install a git hook, just put an executable file in the hooks directory

9/22/2016

16

© 2015 IBM Corporation

Welcome to the Waitless World

Change made in tablet is now in RDi iProject where it can be built and run!

© 2015 IBM Corporation

Welcome to the Waitless World

Page 17: IBM Power Systems 1Q’15 launch messaging and …lisug.org/presentations/Git_and_Orion_for_LISUG.pdfGit hooks • To install a git hook, just put an executable file in the hooks directory

9/22/2016

17

© 2015 IBM Corporation

Welcome to the Waitless World

Demo