This requires rebuilding the containers and recreating the volumes.
Change-Id: I60e2edf757112024e7315a367bf4ccfe20557c54
Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
127.0.1.2 gerrit.localhost
127.0.1.3 nexus.localhost
-Jenkins/Gerrit login: sandbox/sandbox
+Jenkins/Gerrit login: workshop/workshop
Nexus login: admin/admin123
Getting Started
ci-management repo.
Once the environment is up and running, copy your ssh public-key and add
-it to the sandbox user in Gerrit. This can be either be done through the
+it to the workshop user in Gerrit. This can be either be done through the
web interface or from the commandline::
./gerrit-auth.sh ~/.ssh/id_rsa.pub
Then you can clone the ci-management repo and modify it to your hearts
content::
- git clone ssh://sandbox@gerrit.localhost:29418/ci-management.git
+ git clone ssh://workshop@gerrit.localhost:29418/ci-management.git
Set the gitreview username::
- git config --add gitreview.username "sandbox"
+ git config --add gitreview.username "workshop"
And ensure the Change-Id hook exists::
environment can be considered stable:
General:
-- [ ] Replace 'sandbox' names with 'workshop' since sandbox was just a
+- [x] Replace 'sandbox' names with 'workshop' since sandbox was just a
placeholder
- [ ] Setup OpenLDAP over SSL by default
- [ ] Make things more configurable. There are a lot of hardcoded names
if [[ -s $KEYFILE ]]; then
# Upload SSH Public Key
- curl --fail -s -L -X POST -u "sandbox:sandbox" -H "Content-type:text/plain" \
+ curl --fail -s -L -X POST -u "workshop:workshop" -H "Content-type:text/plain" \
-d "@$KEYFILE" http://gerrit.localhost/a/accounts/self/sshkeys/ > /dev/null
# Provide guidance on curl errors
echo -e "\nYou can now clone the available repos:"
print_repos $GERRIT_REPOS
echo -e "\nWith the command:"
- echo -e " git clone ssh://sandbox@gerrit.localhost:29418/<repo>"
+ echo -e " git clone ssh://workshop@gerrit.localhost:29418/<repo>"
fi
fi
# successfully executing.
#
-GERRIT_KEY=/init/id_rsa-sandbox
+GERRIT_KEY=/init/id_rsa-workshop
JENKINS_KEY=/jenkins/.ssh/id_rsa
SSH_OPTIONS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
CI_MANAGEMENT_REPO=/init/ci-management
GLOBAL_JJB_VERSION=${GLOBAL_JJB_VERSION:-v0.6.0}
-# Generate a key for the sandbox user
-if [ ! -f /init/ssh-key-sandbox.done ]; then
+# Generate a key for the workshop user
+if [ ! -f /init/ssh-key-workshop.done ]; then
ssh-keygen -t rsa -N '' -f $GERRIT_KEY
-touch /init/ssh-key-sandbox.done
+touch /init/ssh-key-workshop.done
fi
##
# Be the first to login to gain Administrative rights
if [ ! -f /init/step-1.done ]; then
-curl -X POST --data "username=sandbox&password=sandbox" http://gerrit:8080/login \
+curl -X POST --data "username=workshop&password=workshop" http://gerrit:8080/login \
&& touch /init/step-1.done
fi
# Add generated ssh-pubkey to Gerrit keypairs
if [ ! -f /init/step-2.done ]; then
-curl -X POST --user "sandbox:sandbox" -H "Content-type: plain/text" \
+curl -X POST --user "workshop:workshop" -H "Content-type: plain/text" \
--data @"$GERRIT_KEY.pub" "http://gerrit:8080/a/accounts/self/sshkeys" \
&& touch /init/step-2.done
fi
# Create Jenkins ssh user in Gerrit
if [ ! -f /init/step-3.done ]; then
-ssh $SSH_OPTIONS -p 29418 sandbox@gerrit -i $GERRIT_KEY \
+ssh $SSH_OPTIONS -p 29418 workshop@gerrit -i $GERRIT_KEY \
gerrit create-account jenkins-workshop --full-name "Jenkins\ Workshop" \
--group "Non-Interactive\ Users" --ssh-key - < "$JENKINS_KEY.pub" \
&& touch /init/step-3.done
# Create ci-management repository
if [ ! -f /init/step-4.done ]; then
-ssh $SSH_OPTIONS -p 29418 sandbox@gerrit -i $GERRIT_KEY \
+ssh $SSH_OPTIONS -p 29418 workshop@gerrit -i $GERRIT_KEY \
gerrit create-project ci-management --id --so --empty-commit \
-d "Workshop\ CI-Management\ Repo" -p "All-Projects" \
&& touch /init/step-4.done
# Populate ci-management repository with global-jjb
if [ ! -f /init/step-5.done ]; then
ssh-keyscan -p 29418 gerrit >> /etc/ssh/ssh_known_hosts
- git config --file ~/.gitconfig user.email "sandbox@example.org"
- git config --file ~/.gitconfig user.name "sandbox"
+ git config --file ~/.gitconfig user.email "workshop@example.org"
+ git config --file ~/.gitconfig user.name "workshop"
eval "$(ssh-agent)"
ssh-add $GERRIT_KEY
- git clone ssh://sandbox@gerrit:29418/ci-management.git $CI_MANAGEMENT_REPO
+ git clone ssh://workshop@gerrit:29418/ci-management.git $CI_MANAGEMENT_REPO
mkdir -p $CI_MANAGEMENT_REPO/jjb
cd $CI_MANAGEMENT_REPO/jjb
git submodule add https://gerrit.linuxfoundation.org/infra/releng/global-jjb
[gerrit]
host=gerrit.localhost
port=29418
-username=sandbox
+username=workshop
project=ci-management.git
defaultbranch=master
EOF
[jenkins]
url=http://jenkins:8080/
-user=sandbox
-password=sandbox
+user=workshop
+password=workshop
query_plugins_info=True
EOF
# Ensure JJB is installed first
cd $ALL_PROJECTS
git init
- git remote add origin ssh://sandbox@gerrit:29418/All-Projects.git
+ git remote add origin ssh://workshop@gerrit:29418/All-Projects.git
git fetch origin refs/meta/config:refs/remotes/origin/meta/config
git checkout meta/config
[jenkins]
url=http://jenkins:8080/
-user=sandbox
-password=sandbox
+user=workshop
+password=workshop
query_plugins_info=True""");
store.save(config);
}
def strategy = new GlobalMatrixAuthorizationStrategy()
-strategy.add(Jenkins.ADMINISTER, 'sandbox-admins')
+strategy.add(Jenkins.ADMINISTER, 'workshop-admins')
strategy.add(Jenkins.READ,'anonymous')
strategy.add(Item.READ,'anonymous')
objectClass: organizationalUnit
ou: Groups
-# Password: sandbox
-dn: uid=sandbox,ou=Users,dc=example,dc=org
+dn: uid=workshop,ou=Users,dc=example,dc=org
changetype: add
objectClass: top
objectClass: person
objectClass: inetOrgPerson
-cn: Sandbox
+cn: Workshop
sn: User
-displayname: Sandbox User
-mail: sandbox@example.org
-userpassword: {SSHA}WyQT/fg9FHJ/zcXsdvs51tk5vSlyL0fM
+displayname: Workshop User
+mail: workshop@example.org
+userpassword: {SSHA}81Znic+ah7Tzk1lODaAmi+dbVrTp1iaT
-dn: cn=sandbox-admins,ou=Groups,dc=example,dc=org
+dn: cn=workshop-admins,ou=Groups,dc=example,dc=org
changetype: add
objectClass: top
objectClass: groupOfNames
-member: uid=sandbox,ou=Users,dc=example,dc=org
+member: uid=workshop,ou=Users,dc=example,dc=org