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>
--- /dev/null
+##
+# Global Options
+##
+JENKINS_CONTAINER_VERSION=lts
+GERRIT_CONTAINER_VERSION=latest
+OPENLDAP_CONTAINER_VERSION=latest
+# Container Versions stored in '.env'
---
version: '3'
services:
- jenkins
- gerrit
ldap:
- image: osixia/openldap:latest
+ image: "osixia/openldap:$OPENLDAP_CONTAINER_VERSION"
container_name: releng-ldap
env_file: config.env
command: "--loglevel debug --copy-service"
ports:
- "636:636"
jenkins:
- build: ./jenkins
+ build:
+ context: ./jenkins
+ args:
+ - JENKINS_VERSION=$JENKINS_CONTAINER_VERSION
container_name: releng-jenkins
env_file: config.env
environment:
environment:
- JENKINS_SLAVE_SSH_PUBKEY=ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDUX11sDBXacCE/LBdcXO4E27OZbWtjNadXPGIRTN1leUFWJlnljlZT31Wbml8fvp+5BKbVRHP/W9IWj/PlBTxrxOPMN2Rch40tarPU1PxWJYM203n6Ac+GWKcfSPiikmfXiJ+pJHs+0E1MVhpLe08pb3qVdvwAGdQXVC53dg9ebrb5KirbLvWdEMewfVlxdB2ru2p358QN5Y7HHsAqW1sMr18G1/O5bVJl7g1JbnQ+/YjVaJRo7cDuonTOeatlEMfZZXzlermgXCcVFSIo/oKuKbtilZ2ye17ax9kN4rfVAAXIeOAUZWeCad32EdQEO7xL956ZftXyV+jlw03CndD5
gerrit:
- image: openfrontier/gerrit:latest
+ image: "openfrontier/gerrit:$GERRIT_CONTAINER_VERSION"
container_name: releng-gerrit
env_file: config.env
environment:
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
##############################################################################
-FROM jenkins/jenkins:lts
+ARG JENKINS_VERSION=lts
+
+FROM jenkins/jenkins:${JENKINS_VERSION}
# Disable upgrade wizard
RUN echo 2.0 > /usr/share/jenkins/ref/jenkins.install.UpgradeWizard.state