#------------------------------------------------------------------------------
Build VM from CentOS 6.6 images:
- CentOS-6.6-x86_64-bin-DVD1.iso
- CentOS-6.6-x86_64-bin-DVD2.iso
Select "Linux Easy Install"
Set Display User: Perforce
Set Username: perforce
Set Password: 4F@stSCM
Do not enable folder sharing.
Use the same password, 4F@stSCM in any and all places that a password
for anything is required.
Customize Settings:
Save as GitFusionDemo.vmwarevm
Processors and Memory: Upgrade RAM, 1.0G -> 2.0G
Hard Disk: Downgrade disk, 20.0G -> 8.0 G
Advanced: Enable VNC, Password: 4F@stSCM (default port, 5900)
Hit the 'Play' button.
#------------------------------------------------------------------------------
Reset Root Password:
Restart VM.
Press 'e' early in the GRUB startup process.
Select the 'kernel' line.
Press 'e' again.
After the word 'quiet', add: init=/bin/bash
Hit Enter, then with the kernel line selected, hit 'b'.
At the login prompt, run:
mount -rw -o remount /
passwd
# Set the new password, following the prompts. Use: 4F@stSCM
Restart the VM.
#------------------------------------------------------------------------------
Set the hostname:
Login as root.
hostname bos-p4d-01.p4demo.com
vi /etc/sysconfig/network
#Edit:
HOSTNAME=bos-p4d-01.p4demo.com
#Edit:
vi /etc/hosts
127.0.0.1 bos-p4d-01.p4demo.com bos-p4d-01 perforce
shutdown -r now
#------------------------------------------------------------------------------
Update the OS:
Login as root.
yum update -y
yum install epel-release -y
#------------------------------------------------------------------------------
Connect to Perforce Package Repository:
Continue as root.
rpm --import http://package.perforce.com/perforce.pubkey
echo -e "[perforce]\nname=Perforce\nbaseurl=http://package.perforce.com/yum/rhel/6/x86_64/\nenabled=1\ngpgcheck=1" > /etc/yum.repos.d/perforce.repo
#------------------------------------------------------------------------------
Get Helix executables:
Login as root.
cd /usr/local/bin
for e in p4 p4d p4broker; do wget ftp://ftp.perforce.com/perforce/r15.1/bin.linux26x86_64/$e; chmod +x $e; done
#------------------------------------------------------------------------------
Install Git Fusion:
Continue as root.
yum install perforce-git-fusion -y
#yum install perforce-server (or not, instead use SDP and wget).
yum install perforce-swarm
yum install perforce-swarm-optional
yum install perforce-swarm-triggers
passwd git
vi /etc/cron.d/perforce-*
# Crontab out every-minute calls to silence emails.
# Change the last line of /etc/cron.d/perforce-git-fusion to:
* * * * * /bin/bash -l -c /opt/perforce/git-fusion/home/perforce-git-fusion/update_authorized_keys.sh
#------------------------------------------------------------------------------
Then, create that update_authorized_keys.sh script with these contents:
#!/bin/bash
date >> ~/uak.log
/opt/perforce/git-fusion/bin/python3.3 /opt/perforce/git-fusion/libexec/p4gf_auth_update_authorized_keys.py -v >> ~/uak.log 2>&1
#------------------------------------------------------------------------------
# Configure Git Fusion
# Set to 4F@stSCM
/opt/perforce/git-fusion/libexec/configure-git-fusion.sh
Inputs:
new
super (default)
4F@stSCM
ssl:1666 (default)
bos-p4d-01 (Trim the ".p4demo.com" from the end)
/opt/perforce/data/servers/bos-p4d-01 (default)
America/New_York
4F@stSCM
#------------------------------------------------------------------------------
# Poke a hole in the firewall.
Login as root.
cd /etc/sysconfig
vi iptables
# Add:
-A INPUT -m state --state NEW -m tcp -p tcp --deport 1666 -j ACCEPT
service iptables restart
#------------------------------------------------------------------------------
# Create and update the spec depot.
#------------------------------------------------------------------------------
# Get latest git. OPTIONAL! The default git is not the latest, but
# that's OK 'cuz the one installed along with Git Fusion in
# /opt/perforce/git-fusion/bin can be used. Add that dir to PATH for
# your personal Linux accounts on this server.
# Ref: http://tecadmin.net/install-git-2-0-on-centos-rhel-fedora/
### yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
### yum install gcc perl-ExtUtils-MakeMaker
### wget https://www.kernel.org/pub/software/scm/git/git-2.3.5.tar.gz
### wget https://www.kernel.org/pub/software/scm/git/git-manpages-2.3.5.tar.gz
### tar -xzvpf git-2.3.5.tar.gz
### cd git-2.3.5
### make all 2>&1 | tee build.log
### make install 2>&1 | tee install.log
### #make prefix=/usr/local/git all
### #make prefix=/usr/local/git install
#------------------------------------------------------------------------------
# Get some Git repos to play with. These are some
# used be Perforce QA. Grab them from Git Hub.
git clone https://github.com/hakimel/reveal.js.git
git clone https://github.com/antirez/redis
git clone https://github.com/mbostock/d3
# GF Setup
#Setup a repo config; add as: //.git-fusion/repos/reveal/p4gf_config
#---
[@repo]
description = reveal.js config
charset = utf8
enable-git-branch-creation = yes
enable-git-merge-commits = yes
ignore-author-permissions = no
change-owner = author
[master]
git-branch-name = master
view = //depot/reveal/main-dev/... ...
[dev]
git-branch-name = dev
view = //depot/reveal/dev/... ...
[embed]
git-branch-name = embed
view = //depot/reveal/embed/... ...
[flexbox]
git-branch-name = flexbox
view = //depot/reveal/flexbox/... ...
[gh-pages]
git-branch-name = gh-pages
view = //depot/reveal/gh-pages/... …
#---
# Add user:
./git-fusion/users/ttyler/keys/ttyler_laptop_rsa.pub
cd reveal.js
git branch -a
for b in dev embed flexbox gh-pages master; do git checkout $b; done
#git remote add git-fusion https://super@ssl:192.168.90.165/reveal
git remote add git-fusion ssh://git@192.168.90.165/reveal.js
git remote -v
git push --all git-fusion
# Add Git users to Perforce with this script:
#------------------------------------------------------------------------------
# For simple demos, just create a Perforce account named 'unknown_git'.
# This also applies in the real world when importing 3rd party repos when
# you don't need accounts for the individual users. If you need accounts,
# use this script to create them initially:
#------------------------------------------------------------------------------
# OPTIONAL: Use this if you want to go thru an iterative user-mapping
# process to "get it right," or just skip this and cheat by creating
# the "unknown_git" user in Perforce. This impacts import into Perforce
# from existing Git repos, but not export.
# Set Perforce context somehow, P4PORT/P4USER at least, to a super user.
cd /where/your/git/repo/is
p4 -u ftp -p workshop.perforce.com:1666 print -q -o add_p4user_from_gitlog.pl //guest/tom_tyler/tmp/add_p4user_from_gitlog.pl
./add_p4user_from_gitlog.pl
# Sometimes there are users that need manual mapping, e.g. if there are cases
# where users have multiple email addresses, or two or muser users have the
# same value to the left of the '@' in the email address. An iterative
# 'git push' trial and error process is one way to get the p4gf_usermap file
# right.
#------------------------------------------------------------------------------
Reference Docs:
http://www.perforce.com/perforce/doc.current/manuals/git-fusion/chapter_a21_s5v_pl.html