From 6b07a9f20c81921b443711f4b069bef50c669c11 Mon Sep 17 00:00:00 2001 From: Sam Chesney Date: Mon, 19 Aug 2019 20:02:35 +0100 Subject: [PATCH] Update Jenkins Pipeline to use new agents Also add build triggers on changes to the toolchain. --- .gitignore | 1 + Brewfile | 7 +++++++ Jenkinsfile | 32 ++++++++++++++++++++++++++++---- Pipfile | 7 +++++++ cpanfile | 2 ++ 5 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 Brewfile create mode 100644 Pipfile create mode 100644 cpanfile diff --git a/.gitignore b/.gitignore index e7404e0..ab417e1 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ **/.settings/* *.pyc **/test_results.csv +**/.venv/** # waf build files .lock-waf_* diff --git a/Brewfile b/Brewfile new file mode 100644 index 0000000..2fd6d0b --- /dev/null +++ b/Brewfile @@ -0,0 +1,7 @@ +tap 'homebrew/core' + +brew 'perl' +brew 'cpanm' + +brew 'python@2' +brew 'pipenv' diff --git a/Jenkinsfile b/Jenkinsfile index 8b60cd2..ff0752f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,12 +1,36 @@ -@Library('xmos_jenkins_shared_library@master') _ +@Library('xmos_jenkins_shared_library@develop') _ + getApproval() + pipeline { agent { - label 'x86&&macOS&&Apps' + label 'x86_64&&brew' } environment { - VIEW = 'logging' REPO = 'lib_logging' + VIEW = "${env.JOB_NAME.contains('PR-') ? REPO+'_'+env.CHANGE_TARGET : REPO+'_'+env.BRANCH_NAME}" + } + triggers { + /* Trigger this Pipeline on changes to the repos dependencies + * + * If this Pipeline is running in a pull request, the triggers are set + * on the base branch the PR is set to merge in to. + * + * Otherwise the triggers are set on the branch of a matching name to the + * one this Pipeline is on. + */ + upstream( + upstreamProjects: + (env.JOB_NAME.contains('PR-') ? + "../tools_released/${env.CHANGE_TARGET}," + + "../tools_xmostest/${env.CHANGE_TARGET}," + + "../xdoc_released/${env.CHANGE_TARGET}" + : + "../tools_released/${env.BRANCH_NAME}," + + "../tools_xmostest/${env.BRANCH_NAME}," + + "../xdoc_released/${env.BRANCH_NAME}"), + threshold: hudson.model.Result.SUCCESS + ) } options { skipDefaultCheckout() @@ -14,7 +38,7 @@ pipeline { stages { stage('Get view') { steps { - prepareAppsSandbox("${VIEW}", "${REPO}") + xcorePrepareSandbox("${VIEW}", "${REPO}") } } stage('Library checks') { diff --git a/Pipfile b/Pipfile new file mode 100644 index 0000000..6d52bfd --- /dev/null +++ b/Pipfile @@ -0,0 +1,7 @@ +[[source]] +name = "pypi" +url = "https://pypi.org/simple" +verify_ssl = true + +[dev-packages] +flake8 = "*" diff --git a/cpanfile b/cpanfile new file mode 100644 index 0000000..071f5e6 --- /dev/null +++ b/cpanfile @@ -0,0 +1,2 @@ +requires 'File::Copy::Recursive'; +requires 'LWP::Simple'