releng/ci-workshop.git
7 years agoFix Shellcheck bugs in Gerrit Auth Script 03/9803/1
Trevor Bramwell [Fri, 6 Apr 2018 21:13:38 +0000 (14:13 -0700)]
Fix Shellcheck bugs in Gerrit Auth Script

Change-Id: I7d1846fe50274576e71e30c2bdeeef7578722b04
Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
7 years agoSetup and Configure Nexus 45/7145/4
Trevor Bramwell [Sat, 28 Oct 2017 12:55:56 +0000 (05:55 -0700)]
Setup and Configure Nexus

Adds the Nexus (v2) container and does the following:

 - Creates the initial 'logs' repository
 - Configures Jenkins to be able to talk to Nexus by creating a
   settings.xml, and installing the needed packages on the
   jenkins-agent.
 - Installs required plugins for the jjb logs publishing job, including
   downloading PostBuildScript during the Jenkins container build.
 - Directs requests to 'jenkins.localhost', etc, on the jenkins-agent
   through the nginx container.
 - Sets the Jenkins Markup Formatter to 'Safe HTML' so the logs link can
   be displayed.

Change-Id: I63c783156bcffd1699e9ca7fe1a114ee2ed54bed
Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
7 years agoConfigure GLOBAL_JJB_VERSION Through Environment 44/7144/3
Trevor Bramwell [Sat, 28 Oct 2017 12:51:21 +0000 (05:51 -0700)]
Configure GLOBAL_JJB_VERSION Through Environment

Pulling GLOBAL_JJB_VERSION from the environment allows for creating the
initial ci-management repo with a specific global-jjb version without
having to rebuild the init container.

This also modifies paths to the 'wait-for-it.sh' script to be absolute.

Change-Id: Ic2e7c2a9871fda176a678e245a57d1fde898c0a9
Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
7 years agoConfigure Jenkins Global Properties through Env 43/7143/3
Trevor Bramwell [Sat, 28 Oct 2017 12:48:58 +0000 (05:48 -0700)]
Configure Jenkins Global Properties through Env

By looking for these properties through the Jenkins environment, the
container no longer needs to be rebuilt each time JJB configuration
variables change; it can just be restarted.

Change-Id: I4b96e130ee94963f3ea94c9eb5eb3b5b77a1413f
Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
7 years agoRearrange Jenkins Agent Environment Variables 42/7142/3
Trevor Bramwell [Sat, 28 Oct 2017 12:45:12 +0000 (05:45 -0700)]
Rearrange Jenkins Agent Environment Variables

Moves the public key into config.env, and JAVA_OPTS into
docker-compose.yml since other containers look for the JAVA_OPTS
variable and it contains Jenkins specific information.

Change-Id: I775ac6fee8fdf3ec318368be973c43e8925d0fe5
Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
7 years agoCreate script for uploading ssh pubkey to Gerrit 41/7141/3
Trevor Bramwell [Thu, 26 Oct 2017 18:57:05 +0000 (11:57 -0700)]
Create script for uploading ssh pubkey to Gerrit

'gerrit-auth.sh' takes a single argument of an ssh public-key file to be
added to the sandbox user in Gerrit. This way users don't need to go
through an error-prone setup of copy & pasting the curl command. Some
explainations of curl errors are also provided.

Change-Id: I5b3af284348953b2cea37dedfff5b6bed852e4b7
Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
7 years agoMake Container Versions Configurable 40/7140/2
Trevor Bramwell [Wed, 18 Oct 2017 05:51:28 +0000 (22:51 -0700)]
Make Container Versions Configurable

There is a global 'environment' file for docker-compose called '.env'
which sits in the same directory as the yaml file[1]. Besides a shell
environment, This is where default values passed to the docker-compose
command line can be stored.

By having container specific versions listed here users of
ci-management will have an eaiser time bringing up a matrix of
different infrastructure configurations.

[1] https://docs.docker.com/compose/environment-variables/#the-env-file

Change-Id: Ie2bd92376fa817b13f4eb1d123f9fca8e10b99a5
Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
7 years agoMove LDAP configs to base directory 85/6785/1
Trevor Bramwell [Tue, 10 Oct 2017 23:33:00 +0000 (16:33 -0700)]
Move LDAP configs to base directory

This removes the need for a 'config' directory and config values have
been collapsed to 'config.env' and instance specific configuration is
stored under the instance name.

Change-Id: I64e2c93f42c799750ff2baf47033c2a909279483
Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
7 years agoMove Jenkins Groovy Scripts under jenkins/scripts 84/6784/1
Trevor Bramwell [Tue, 10 Oct 2017 23:31:13 +0000 (16:31 -0700)]
Move Jenkins Groovy Scripts under jenkins/scripts

This should help de-clutter the current jenkins directory containing the
Dockerfile and configs.

Change-Id: Iea68c13640291e9a654424300454319a0df2bd1a
Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
7 years agoCollapse Environment Files 83/6783/1
Trevor Bramwell [Thu, 5 Oct 2017 18:35:37 +0000 (11:35 -0700)]
Collapse Environment Files

Having all the environment variables in one place should help people
track down where settings are instead of having to dig through several
files.

Change-Id: Iceea0e7bf508f7a427a777077ed23b51e6791f0d
Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
7 years agoFull Integration of Jenkins and Gerrit 65/6265/2
Trevor Bramwell [Sun, 13 Aug 2017 06:27:46 +0000 (23:27 -0700)]
Full Integration of Jenkins and Gerrit

- Run exclusive services with NGINX

  In favor of writing individual configs for NGINX, and since all we're
  doing is reverse proxying, using jwilder/nginx-proxy and setting
  VIRTUAL_HOST should be all we need to get NGINX working and allows for
  individual services to be brought up without causing NGINX to fall
  over due the other upstream not being online.

- Config Jenkins & Gerrit integration through several Groovy scripts

  These scripts provide all the initial configuration needed to get
  Jenkins and Gerrit talking to each other. They include:

  - Disabling the CLI over remoting
  - Enabling CSRF protection
  - Enabling the Agent -> Master subsystem
  - Setting the Jenkins hostname
  - Creating SSH credentials for connecting Jenkins to Gerrit
  - Configuring the Gerrit-Trigger plugins
  - Adding a single Jenkins SSH agent
  - Creating a JJB ini file through the Config Files plugin that Jenkins
    agent will use to configure JJB
  - Setting the global environment variable GIT_URL requires by
    Global-JJB

- Initialization Container

  After the Jenkins and Gerrit are some more work is needed to allow
  them to interact such as:

  - Creating an ssh key in Jenkins home directory
  - Creating a user in Gerrit that Jenkins will use to access the
    event-stream over ssh
  - Writing out the basic configuration for a ci-management repository
  - Bootstrapping JJB jobs into Jenkins
  - Adding the Verified label to Gerrit

  These are all done outside of the context of the Gerrit and Jenkins
  containers because most of them rely on processes already running, and
  allow us to use unmodified upstream containers.

- Updating plugins required by Global-JJB

Change-Id: I13cda69989c4832d451be1b841d177c9fdaf9e27
Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
7 years agoInitial Commit 01/5801/3
Trevor Bramwell [Wed, 9 Aug 2017 17:47:35 +0000 (10:47 -0700)]
Initial Commit

Change-Id: I8cfcd9adc88146a32c7621470a4dcbf5b5643690
Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
7 years agoSetup initial .gitreview and .gitignore 82/5782/2
Andrew Grimberg [Tue, 8 Aug 2017 22:01:40 +0000 (15:01 -0700)]
Setup initial .gitreview and .gitignore

Configure new repository with .gitreview and .gitignore

Change-Id: I8251a6d0ae1da9f50be57160795055b5c8d3a413
Signed-off-by: Andrew Grimberg <agrimberg@linuxfoundation.org>
7 years agoAdd Coala linting 99/5799/1
Andrew Grimberg [Wed, 9 Aug 2017 17:29:39 +0000 (10:29 -0700)]
Add Coala linting

Change-Id: Id378925dcebe48c23465401240df0f647f8ae1ad
Signed-off-by: Andrew Grimberg <agrimberg@linuxfoundation.org>
7 years agoInitial empty repository
Andrew Grimberg [Tue, 8 Aug 2017 21:59:50 +0000 (21:59 +0000)]
Initial empty repository