Skip to content
Snippets Groups Projects
Commit 1b14cd88 authored by Mike Marchetti's avatar Mike Marchetti Committed by garciadeblas
Browse files

add common ci-pipeline code


Signed-off-by: default avatarMike Marchetti <mmarchetti@sandvine.com>
Change-Id:      I03d2573e7ba670a34c0c7ee08b566994905e5f88
parent 20df3bbe
No related branches found
No related tags found
No related merge requests found
FROM ubuntu:16.04 FROM ubuntu:16.04
RUN apt-get update && \ RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get -y install git build-essential && \ DEBIAN_FRONTEND=noninteractive apt-get -y install git build-essential apt-utils && \
DEBIAN_FRONTEND=noninteractive apt-get -y install python python-dev python-all python-stdeb fakeroot pypi2deb && \ DEBIAN_FRONTEND=noninteractive apt-get -y install python python-dev python-all python-stdeb fakeroot pypi2deb && \
DEBIAN_FRONTEND=noninteractive apt-get -y install python-pip libmysqlclient-dev libssl-dev libffi-dev && \ DEBIAN_FRONTEND=noninteractive apt-get -y install python-pip libmysqlclient-dev libssl-dev libffi-dev && \
DEBIAN_FRONTEND=noninteractive pip install --upgrade pip && \ DEBIAN_FRONTEND=noninteractive pip install --upgrade pip && \
......
pipeline { properties([
agent any parameters([
stages { string(defaultValue: env.BRANCH_NAME, description: '', name: 'GERRIT_BRANCH'),
stage("Build") { string(defaultValue: 'osm/RO', description: '', name: 'GERRIT_PROJECT'),
agent { string(defaultValue: env.GERRIT_REFSPEC, description: '', name: 'GERRIT_REFSPEC'),
dockerfile true string(defaultValue: env.GERRIT_PATCHSET_REVISION, description: '', name: 'GERRIT_PATCHSET_REVISION'),
} string(defaultValue: 'https://osm.etsi.org/gerrit', description: '', name: 'PROJECT_URL_PREFIX'),
steps { booleanParam(defaultValue: false, description: '', name: 'TEST_INSTALL'),
sh 'make package' ])
stash name: "deb-files", includes: ".build/*.deb" ])
}
} def devops_checkout() {
stage("Unittest") { dir('devops') {
agent { git url: "${PROJECT_URL_PREFIX}/osm/devops", branch: params.GERRIT_BRANCH
dockerfile true }
} }
steps {
sh 'echo "UNITTEST"' node {
} checkout scm
} devops_checkout()
stage("Repo Component") {
agent any ci_helper = load "devops/jenkins/ci-pipelines/ci_stage_2.groovy"
steps { ci_helper.ci_pipeline( 'RO',
unstash "deb-files" params.PROJECT_URL_PREFIX,
sh ''' params.GERRIT_PROJECT,
mkdir -p pool/RO params.GERRIT_BRANCH,
mv .build/*.deb pool/RO/ params.GERRIT_REFSPEC,
mkdir -p dists/ReleaseOne/unstable/RO/binary-amd64/ params.GERRIT_PATCHSET_REVISION,
apt-ftparchive packages pool/RO > dists/ReleaseOne/unstable/RO/binary-amd64/Packages params.TEST_INSTALL)
gzip -9fk dists/ReleaseOne/unstable/RO/binary-amd64/Packages
'''
archiveArtifacts artifacts: "dists/**,pool/RO/*.deb"
}
}
}
} }
#!/bin/sh
rm -rf pool
rm -rf dists
mkdir -p pool/RO
mv .build/*.deb pool/RO/
mkdir -p dists/unstable/RO/binary-amd64/
apt-ftparchive packages pool/RO > dists/unstable/RO/binary-amd64/Packages
gzip -9fk dists/unstable/RO/binary-amd64/Packages
#!/bin/sh
make package
#!/bin/sh
echo "UNITTEST"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment