From 28f817d83b3dee3ad6a314abb144c4da9d4e4e01 Mon Sep 17 00:00:00 2001 From: Trevor Bramwell Date: Thu, 5 Oct 2017 11:35:37 -0700 Subject: [PATCH] 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 --- config/gerrit.env => config.env | 47 ++++++++++++++++++++++++++++------------- config/jenkins.env | 19 ----------------- config/ldap.env | 25 ---------------------- config/postgres.env | 13 ------------ docker-compose.yml | 14 ++++++++---- 5 files changed, 42 insertions(+), 76 deletions(-) rename config/gerrit.env => config.env (51%) delete mode 100644 config/jenkins.env delete mode 100644 config/ldap.env delete mode 100644 config/postgres.env diff --git a/config/gerrit.env b/config.env similarity index 51% rename from config/gerrit.env rename to config.env index 2a90285..1e085e9 100644 --- a/config/gerrit.env +++ b/config.env @@ -1,21 +1,12 @@ -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 The Linux Foundation and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -############################################################################## - +## +# Gerrit +## #GERRIT_INIT_ARGS=" \ # --install-plugin=download-commands \ # --install-plugin=commit-message-length-validator \ # --install-plugin=replication \ # --install-plugin=delete-project \ # " - WEBURL=http://gerrit.localhost #DATABASE_TYPE=postgresql AUTH_TYPE=LDAP @@ -30,6 +21,32 @@ LDAP_GROUPBASE=ou=Groups,dc=example,dc=org LDAP_GROUPMEMBERPATTERN=(member=${dn}) LDAP_LOCALUSERNAMETOLOWERCASE=true -# nginx-proxy -VIRTUAL_HOST=gerrit.localhost -VIRTUAL_PORT=8080 +## +# Jenkins +## +JAVA_OPTS="-Djenkins.install.runSetupWizard=false" +JENKINS_OPTS="" +JENKINS_ADMIN_USER=admin +JENKINS_ADMIN_PASSWORD=password + +## +# Postgres +## +POSTGRES_USER=gerrit2 +POSTGRES_PASSWORD=gerrit +POSTGRES_DB=reviewdb + +## +# OpenLDAP +## +LDAP_ORGANISATION=Test Org +LDAP_DOMAIN=example.org +# Only set this if you want it different from the LDAP_DOMAIN +LDAP_BASE_DN=dc=example,dc=org +LDAP_READONLY_USER=true +LDAP_READONLY_USER_USERNAME=readonly +LDAP_READONLY_USER_PASSWORD=readonly +LDAP_ADMIN_PASSWORD=admin +LDAP_TLS=false +LDAP_TLS_ENFORCE=false +LDAP_REMOVE_CONFIG_AFTER_SETUP=false diff --git a/config/jenkins.env b/config/jenkins.env deleted file mode 100644 index 4f76cf1..0000000 --- a/config/jenkins.env +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 The Linux Foundation and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -############################################################################## -JAVA_OPTS="-Djenkins.install.runSetupWizard=false" -JENKINS_OPTS="" - -JENKINS_ADMIN_USER=admin -JENKINS_ADMIN_PASSWORD=password - -# nginx-proxy -VIRTUAL_HOST=jenkins.localhost -VIRTUAL_PORT=8080 diff --git a/config/ldap.env b/config/ldap.env deleted file mode 100644 index dbc43a6..0000000 --- a/config/ldap.env +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 The Linux Foundation and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -############################################################################## -LDAP_ORGANISATION=Test Org -LDAP_DOMAIN=example.org -# Only set this if you want it different from the LDAP_DOMAIN -LDAP_BASE_DN=dc=example,dc=org - -LDAP_READONLY_USER=true -LDAP_READONLY_USER_USERNAME=readonly -LDAP_READONLY_USER_PASSWORD=readonly - -LDAP_ADMIN_PASSWORD=admin - -LDAP_TLS=false -LDAP_TLS_ENFORCE=false - -LDAP_REMOVE_CONFIG_AFTER_SETUP=false diff --git a/config/postgres.env b/config/postgres.env deleted file mode 100644 index bdffe8b..0000000 --- a/config/postgres.env +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2017 The Linux Foundation and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -############################################################################## -POSTGRES_USER=gerrit2 -POSTGRES_PASSWORD=gerrit -POSTGRES_DB=reviewdb diff --git a/docker-compose.yml b/docker-compose.yml index b493244..e5a0684 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,7 +13,7 @@ services: ldap: image: osixia/openldap:latest container_name: releng-ldap - env_file: config/ldap.env + env_file: config.env command: "--loglevel debug --copy-service" volumes: - ./config/ldap/bootstrap/groups.ldif:/container/service/slapd/assets/config/bootstrap/ldif/custom/50-groups.ldif @@ -22,7 +22,10 @@ services: jenkins: build: ./jenkins container_name: releng-jenkins - env_file: config/jenkins.env + env_file: config.env + environment: + - VIRTUAL_HOST=jenkins.localhost + - VIRTUAL_PORT=8080 volumes: - jenkins:/var/jenkins_home expose: @@ -44,7 +47,10 @@ services: gerrit: image: openfrontier/gerrit:latest container_name: releng-gerrit - env_file: config/gerrit.env + env_file: config.env + environment: + - VIRTUAL_HOST=gerrit.localhost + - VIRTUAL_PORT=8080 volumes: - gerrit:/var/gerrit/review_site expose: @@ -59,7 +65,7 @@ services: - nginx postgres: image: postgres:latest - env_file: config/postgres.env + env_file: config.env expose: - "5432" nginx: -- 2.16.6