Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 99 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
#!/usr/bin/env groovy

properties([
[$class: 'RebuildSettings', autoRebuild: false, rebuildDisabled: false],
parameters([
string(defaultValue: 'nova glance kestone',
description: 'components with custom images',
name: 'COMPONENTS_LIST'),
booleanParam(defaultValue: true,
description: 'Install/Re-install openstack-kolla, If your slave already have it installed you can set it to false (uncheck)',
name: 'INSTALL_KOLLA'),
booleanParam(defaultValue: true,
description: 'Install/Re-install openstack-helm, If your slave already have it installed you can set it to false (uncheck)',
name: 'INSTALL_OSH')
]),
[$class: 'ThrottleJobProperty', categories: [], limitOneJobWithMatchingParams: false, maxConcurrentPerNode: 0, maxConcurrentTotal: 0, paramsToUseForLimit: '', throttleEnabled: false, throttleOption: 'project'], pipelineTriggers([])
])

node('slave') {
stage('slave precheck') {
sh '''#!/bin/bash -xe
sudo apt-get install -y python-pip libpython-all-dev libpython3-all-dev libffi-dev libssl-dev gcc git ntp tox ansible docker.io
if [ -z "${COMPONENTS_LIST}" ];then
echo "ERROR: COMPONENTS_LIST parameter is empty"
exit 1
fi
echo ${COMPONENT_LIST}
echo 'Precheck complete!'
'''
}
stage('deploy Kolla') {
sh '''#!/bin/bash -xe

if ! ${INSTALL_KOLLA}; then
echo "Skipping installation phase"
exit 0
fi

echo "Kolla deployment"
rm -rf kolla/
git clone https://git.openstack.org/openstack/kolla -b stable/newton
pip install kolla/
cd kolla/
tox -e py27
tox -e genconfig
'''
}

stage('Generate Images') {
sh '''#!/bin/bash -xe
cd kolla
source .tox/py27/bin/activate
for os_component in ${COMPONENTS_LIST}; do
kolla-build -b ubuntu -t source ${os_component}
done
'''
}

stage('deploy OSH') {
sh '''#!/bin/bash -xe

if ! ${INSTALL_OSH}; then
echo "Skipping installation phase"
exit 0
fi

rm -rf openstack-helm/
git clone https://github.com/openstack/openstack-helm.git

export INTEGRATION=aio INTEGRATION_TYPE=basic

cd openstack-helm

bash tools/gate/setup_gate.sh
'''
}

stage('Upgrade images') {
sh '''#!/bin/bash -xe
echo ${COMPONENTS_LIST}
cd openstack-helm/
for os_component in ${COMPONENTS_LIST}; do
sed -i 's|docker.io/kolla|kolla|g' ${os_component}/values.yaml
helm upgrade -f ${os_component}/values.yaml ${os_component} ${os_component}
done
'''
}

stage('Rally') {
sh '''#!/bin/bash -xe
'''
}

stage('Results') {
sh '''#!/bin/bash -xe
'''
}

}
121 changes: 121 additions & 0 deletions osh/seedjobs/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
#!/usr/bin/env groovy

properties([
[$class: 'RebuildSettings', autoRebuild: false, rebuildDisabled: false],
parameters([
string(defaultValue: 'nova glance kestone',
description: 'components with custom images',
name: 'COMPONENTS_LIST'
),
booleanParam(
defaultValue: true,
description: 'Install/Re-install openstack-kolla, If your slave already have it installed you can set it to false (uncheck)',
name: 'INSTALL_KOLLA'
),
booleanParam(
defaultValue: true,
description: 'Install/Re-install openstack-helm, If your slave already have it installed you can set it to false (uncheck)',
name: 'INSTALL_OSH'
)
]),

[$class: 'ThrottleJobProperty', categories: [],
limitOneJobWithMatchingParams: false,
maxConcurrentPerNode: 0,
maxConcurrentTotal: 0,
paramsToUseForLimit: '',
throttleEnabled: false,
throttleOption: 'project'
],
pipelineTriggers([])
])

node('slave') {
customWorkspace "~/TEST/"
stage('slave precheck') {
slackSend channel: '#test-jenkins',
color: 'good',
message: 'slackSend "started ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)"',
teamDomain: 'att-comdev',
tokenCredentialId: 'comdev-slack'

sh '''#!/bin/bash -xe
sudo apt-get install -y python-pip libpython-all-dev libpython3-all-dev libffi-dev libssl-dev gcc git ntp tox ansible docker.io
if [ -z "${COMPONENTS_LIST}" ];then
echo "ERROR: COMPONENTS_LIST parameter is empty"
exit 1
fi
echo ${COMPONENT_LIST}
echo 'Precheck complete!'
'''
}
stage('deploy Kolla') {
sh '''#!/bin/bash -xe

if ! ${INSTALL_KOLLA}; then
echo "Skipping installation phase"
exit 0
fi

echo "Kolla deployment"
rm -rf kolla/
git clone https://git.openstack.org/openstack/kolla -b stable/newton
pip install kolla/
cd kolla/
tox -e py27
tox -e genconfig
'''
}

stage('Generate Images') {
sh '''#!/bin/bash -xe
cd kolla
source .tox/py27/bin/activate
for os_component in ${COMPONENTS_LIST}; do
kolla-build -b ubuntu -t source ${os_component}
done
'''
}

stage('deploy OSH') {
sh '''#!/bin/bash -xe

if ! ${INSTALL_OSH}; then
echo "Skipping installation phase"
exit 0
fi

rm -rf openstack-helm/
git clone https://github.com/openstack/openstack-helm.git

export INTEGRATION=aio INTEGRATION_TYPE=basic

cd openstack-helm

bash tools/gate/setup_gate.sh
'''
}

stage('Upgrade images') {
sh '''#!/bin/bash -xe
echo ${COMPONENTS_LIST}
cd openstack-helm/
for os_component in ${COMPONENTS_LIST}; do
sed -i 's|docker.io/kolla|kolla|g' ${os_component}/values.yaml
helm upgrade -f ${os_component}/values.yaml ${os_component} ${os_component}
done
'''
}

stage('Rally') {
sh '''#!/bin/bash -xe
'''
}

stage('Results') {
sh '''#!/bin/bash -xe
echo SUCCESS
'''
}

}
102 changes: 102 additions & 0 deletions osh/seedjobs/KollaBuild.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
#!/usr/bin/env groovy

properties([
[$class: 'RebuildSettings', autoRebuild: false, rebuildDisabled: false],
parameters([
string(defaultValue: 'nova glance kestone',
description: 'components with custom images',
name: 'COMPONENTS_LIST'),
booleanParam(defaultValue: true,
description: 'Install/Re-install openstack-kolla, If your slave already have it installed you can set it to false (uncheck)',
name: 'INSTALL_KOLLA'),
booleanParam(defaultValue: true,
description: 'Install/Re-install openstack-helm, If your slave already have it installed you can set it to false (uncheck)',
name: 'INSTALL_OSH')
]),
[$class: 'ThrottleJobProperty', categories: [], limitOneJobWithMatchingParams: false, maxConcurrentPerNode: 0, maxConcurrentTotal: 0, paramsToUseForLimit: '', throttleEnabled: false, throttleOption: 'project'], pipelineTriggers([])
])

node('slave') {
stage('slave precheck') {
sh '''#!/bin/bash -xe
sudo apt-get install -y python-pip libpython-all-dev libpython3-all-dev libffi-dev libssl-dev gcc git ntp tox ansible docker.io
if ! id | grep -q docker; then
sudo adduser $USER docker||:
fi
if [ -z "${COMPONENTS_LIST}" ];then
echo "ERROR: COMPONENTS_LIST parameter is empty"
exit 1
fi
echo ${COMPONENT_LIST}
echo 'Precheck complete!'
'''
}
stage('deploy Kolla') {
sh '''#!/bin/bash -xe

if ! ${INSTALL_KOLLA}; then
echo "Skipping installation phase"
exit 0
fi

echo "Kolla deployment"
rm -rf kolla/
git clone https://git.openstack.org/openstack/kolla -b stable/newton
pip install kolla/
cd kolla/
tox -e py27
tox -e genconfig
'''
}

stage('Generate Images') {
sh '''#!/bin/bash -xe
cd kolla
source .tox/py27/bin/activate
for os_component in ${COMPONENTS_LIST}; do
kolla-build -b ubuntu -t source ${os_component}
done
'''
}

stage('deploy OSH') {
sh '''#!/bin/bash -xe

if ! ${INSTALL_OSH}; then
echo "Skipping installation phase"
exit 0
fi

rm -rf openstack-helm/
git clone https://github.com/openstack/openstack-helm.git

export INTEGRATION=aio INTEGRATION_TYPE=basic

cd openstack-helm

bash tools/gate/setup_gate.sh
'''
}

stage('Upgrade images') {
sh '''#!/bin/bash -xe
echo ${COMPONENTS_LIST}
cd openstack-helm/
for os_component in ${COMPONENTS_LIST}; do
sed -i 's|docker.io/kolla|kolla|g' ${os_component}/values.yaml
helm upgrade -f ${os_component}/values.yaml ${os_component} ${os_component}
done
'''
}

stage('Rally') {
sh '''#!/bin/bash -xe
'''
}

stage('Results') {
sh '''#!/bin/bash -xe
'''
}

}
67 changes: 67 additions & 0 deletions test/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
pipeline {
agent {
// "node" is a new agent type that works the same as "label" but allows
// additional parameters, such as "customWorkspace" below.
node {
label "some-label"
// This is equivalent to the "ws(...)" step - sets the workspace on the
// agent to a hard-coded path. If it's not an absolute path, it'll be
// relative to the agent's workspace root.
customWorkspace "/use/this/path/instead"
}
}

// Shared libraries can now be loaded in through the Declarative syntax,
// as shown below.
libraries {
lib("some-lib@master")
}

// REGRESSION: JENKINS-42748 - string escaping for Windows paths in
// "environment" when using single quotes. This is being investigated.
environment {
FOO = "BAR"
// Environment variables can now reference other environment variables!
BARCAMP = "${FOO}CAMP"
// They can also reference the workspace path!
PATH_IN_WS = "${WORKSPACE}/child/path"
}

stages {
stage('some-stage') {
// REGRESSION: JENKINS-42762 - in 1.1.1, you can't nest multiple
// conditions directly within "when". You need to use "when { allOf { ... } }"
// instead. This will be fixed in the next release.
when {
// We have added logical conditions for "when" - specifically...

// "anyOf" - contains 1 or more nested condition and will resolve
// to true if *any* of the nested conditions are true.
anyOf {
// "allOf" - contains 1 or more nested conditions an will resolve
// to true if *all* of the nested conditions are true.
allOf {
branch "master"
expression {
// REGRESSION: JENKINS-42829 - methods defined elsewhere in
// the Jenkinsfile currently can't be used in "when" "expression"s.
return true
}
}
// "not" - contains 1 nested condition and will resolve to true
// if the nested condition is false.
not {
branch "some-other-branch-entirely"
}
}
}
steps {
// We've added the "validateDeclarativePipeline('some-file')" step,
// which will let you perform validation of a Declarative Pipeline
// from within a different Pipeline. This step can be used in
// Scripted Pipeline as well.
echo validateDeclarativePipeline("some-other-file.groovy")
}
}
}
}