
Added one more step to CiCd UI form where user can set root and regilular users credentials by himself. Change-Id: I89be4fbe7ae4cc355456dda37680e52835ec6d10
128 lines
3.7 KiB
YAML
128 lines
3.7 KiB
YAML
Namespaces:
|
|
=: io.murano.opaas
|
|
std: io.murano
|
|
res: io.murano.resources
|
|
sys: io.murano.system
|
|
opaas: io.murano.opaas
|
|
puppet: io.murano.opaas.puppet
|
|
|
|
Name: CiCdEnvironment
|
|
|
|
Extends: std:Application
|
|
|
|
Properties:
|
|
ldap:
|
|
Contract: $.class(opaas:OpenLDAP)
|
|
Usage: Out
|
|
gerrit:
|
|
Contract: $.class(opaas:Gerrit)
|
|
Usage: Out
|
|
jenkins:
|
|
Contract: $.class(opaas:Jenkins)
|
|
Usage: Out
|
|
|
|
ldapRootUser:
|
|
Contract: $.string().notNull()
|
|
ldapRootPass:
|
|
Contract: $.string().notNull()
|
|
ldapRootEmail:
|
|
Contract: $.string().notNull()
|
|
ldapUser:
|
|
Contract: $.string()
|
|
ldapPass:
|
|
Contract: $.string()
|
|
ldapEmail:
|
|
Contract: $.string()
|
|
|
|
instance_name:
|
|
Contract: $.string().notNull()
|
|
flavor:
|
|
Contract: $.string().notNull()
|
|
image:
|
|
Contract: $.string().notNull()
|
|
keyname:
|
|
Contract: $.string().notNull()
|
|
availabilityZone:
|
|
Contract: $.string().notNull()
|
|
Default: nova
|
|
assignFloatingIp:
|
|
Contract: $.bool().notNull()
|
|
Default: true
|
|
|
|
Methods:
|
|
.init:
|
|
Body:
|
|
- $._environment: $.find(std:Environment).require()
|
|
|
|
deploy:
|
|
Body:
|
|
- $._environment.reporter.report($this, 'Deploying CI/CD')
|
|
|
|
# OpenLDAP
|
|
- If: $this.ldap = null
|
|
Then:
|
|
- $ldapInstanceName: concat($.instance_name, '-ldap')
|
|
- $ldapInstance: new(puppet:PuppetInstance, $._environment,
|
|
name => $ldapInstanceName,
|
|
flavor => $.flavor,
|
|
image => $.image,
|
|
keyname => $.keyname,
|
|
availabilityZone => $.availabilityZone,
|
|
assignFloatingIp => $.assignFloatingIp)
|
|
- $this.ldap: new(opaas:OpenLDAP, $._environment,
|
|
name => 'OpenLDAP',
|
|
instance => $ldapInstance,
|
|
domain => 'infra.local',
|
|
ldapRootUser => $.ldapRootUser,
|
|
ldapRootPass => $.ldapRootPass,
|
|
ldapRootEmail => $.ldapRootEmail,
|
|
ldapUser => $.ldapUser,
|
|
ldapPass => $.ldapPass,
|
|
ldapEmail => $.ldapEmail)
|
|
|
|
# Gerrit
|
|
- If: $this.gerrit = null
|
|
Then:
|
|
- $gerritInstanceName: concat($.instance_name, '-gerrit')
|
|
- $gerritInstance: new(puppet:PuppetInstance, $._environment,
|
|
name => $gerritInstanceName,
|
|
flavor => $.flavor,
|
|
image => $.image,
|
|
keyname => $.keyname,
|
|
availabilityZone => $.availabilityZone,
|
|
assignFloatingIp => $.assignFloatingIp)
|
|
- $this.gerrit: new(opaas:Gerrit, $this,
|
|
name => 'Gerrit',
|
|
instance => $gerritInstance,
|
|
ldap => $this.ldap)
|
|
|
|
# Jenkins
|
|
# set user and mail for accessing to Gerrit from Jenkins
|
|
- If: $this.jenkins = null
|
|
Then:
|
|
- $._environment.reporter.report($this,
|
|
'Jenkins credentials user={0}, password={1}'.format(
|
|
$.ldapUser, $.ldapPass))
|
|
- $jenkinsInstanceName: concat($.instance_name, '-jenkins')
|
|
- $jenkinsInstance: new(puppet:PuppetInstance, $._environment,
|
|
name => $jenkinsInstanceName,
|
|
flavor => $.flavor,
|
|
image => $.image,
|
|
keyname => $.keyname,
|
|
availabilityZone => $.availabilityZone,
|
|
assignFloatingIp => $.assignFloatingIp)
|
|
- $this.jenkins: new(opaas:Jenkins, $._environment,
|
|
name => 'Jenkins',
|
|
instance => $jenkinsInstance,
|
|
ldap => $this.ldap,
|
|
gerrit => $this.gerrit,
|
|
cfplugin => false,
|
|
gitUser => $.ldapUser,
|
|
gitEmail => $.ldapEmail)
|
|
|
|
# Deploy all
|
|
- Parallel:
|
|
- $this.ldap.deploy()
|
|
- $this.gerrit.deploy()
|
|
- $this.jenkins.deploy()
|