Using LCFG Build Tools with Git

Ensure you have the latest package versions installed

!profile.packages mEXTRA(?perl-LCFG-Build-VCS-0.4.2-1/noarch ?perl-LCFG-Build-Tools-0.12.0-1/noarch)

Install git2cl from EPEL, e.g.

!profile.packages mEXTRA(git2cl-2.0-0.8.git8373c9f.el7.noarch.rpm)

svn2git can be used to migrate from Subversion to Git, retaining tags and mapping user identities to email addresses. We installed this manually rather than from an RPM.

Start the SSH agent and add my private key:

-bash-4.2$ eval `ssh-agent`
Agent pid 29967
-bash-4.2$ ssh-add 
Enter passphrase for /localdisk/home/kenny/.ssh/id_rsa: 
Identity added: /localdisk/home/kenny/.ssh/id_rsa (/localdisk/home/kenny/.ssh/id_rsa)

Set my email address for Git to use in commits:

git config --global user.email Kenneth.MacDonald@ed.ac.uk

Clone the remote Git repo, in this case we are cloning the Wake On LAN source code (was at version 7.0.2)

-bash-4.2$ git clone git@git.ecdf.ed.ac.uk:enterprise_services/wake-on-lan.git
Cloning into 'wake-on-lan'...
The authenticity of host 'git.ecdf.ed.ac.uk (129.215.213.121)' can't be established.
ECDSA key fingerprint is SHA256:fWNlZZn2DAAxUgn55v1xN7Kg2rYT+gDs6Vr4KBonMfQ.
ECDSA key fingerprint is MD5:d8:3f:01:8d:b6:59:f9:ce:d1:df:4e:aa:56:cf:ec:98.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'git.ecdf.ed.ac.uk,129.215.213.121' (ECDSA) to the list of known hosts.
X11 forwarding request failed on channel 0
remote: Enumerating objects: 230, done.
remote: Counting objects: 100% (230/230), done.
remote: Compressing objects: 100% (103/103), done.
remote: Total 230 (delta 124), reused 230 (delta 124)
Receiving objects: 100% (230/230), 61.16 KiB | 0 bytes/s, done.
Resolving deltas: 100% (124/124), done.

Now make a small change, in this example we will rename the README file to README.md, remembering to fix the RPM specfile as well.

-bash-4.2$ cd wake-on-lan/
-bash-4.2$ ls
ChangeLog       labmon    lib    README        specfile
CMakeLists.txt  lcfg.yml  mywol  README.BUILD
-bash-4.2$ git mv README README.md
-bash-4.2$ vi specfile 
-bash-4.2$ git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#   renamed:    README -> README.md
#
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#   modified:   specfile
#

Commit the change to the local git repo:

-bash-4.2$ git commit -a -m "Rename README to README.md"
[master ec382d9] Rename README to README.md
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename README => README.md (100%)

Make a micro release as usual:

-bash-4.2$ lcfg-reltool micro
Auto-detected that the GIT module should be used.
Checking that all file changes have been committed.
Generating Changelog from git log
Tagging wake-on-lan at version 7.0.3
X11 forwarding request failed on channel 0
To git@git.ecdf.ed.ac.uk:enterprise_services/wake-on-lan.git
   4d411b6..03f5a60  master -> master
 * [new tag]         wake_on_lan_7_0_3 -> wake_on_lan_7_0_3

-- kenny - 2019-12-06

Comments

%COMMENT%


This topic: LCFG > DocsForLCFGDevelopers > BuildTools > BuildToolsGit
Topic revision: r1 - 2019-12-06 - kenny
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback