aboutsummaryrefslogtreecommitdiff
path: root/odp-publish-icon.yaml
diff options
context:
space:
mode:
authorAnders Roxell <anders.roxell@linaro.org>2016-08-19 14:14:19 +0200
committerAnders Roxell <anders.roxell@linaro.org>2016-08-19 14:14:19 +0200
commit2e18de2ad6cc763bb23f62d13ca7ed5e7f07c148 (patch)
tree636b1a29a6d444600598c3f5740be837bf30b229 /odp-publish-icon.yaml
parent906222ca0a422d1cf4c2dfc85bcadc878068654a (diff)
add new odp-publish-icon job
Change-Id: Ibd267bb6aa792371f2fa03cb4f0f14d391c36584 Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Diffstat (limited to 'odp-publish-icon.yaml')
-rw-r--r--odp-publish-icon.yaml78
1 files changed, 78 insertions, 0 deletions
diff --git a/odp-publish-icon.yaml b/odp-publish-icon.yaml
new file mode 100644
index 0000000000..be7c36051c
--- /dev/null
+++ b/odp-publish-icon.yaml
@@ -0,0 +1,78 @@
+- job:
+ name: odp-publish-icon
+ project-type: freestyle
+ defaults: global
+ description: |
+ * ODP publish icon.
+ properties:
+ - authorization:
+ anonymous:
+ - job-read
+ - job-extended-read
+ linaro:
+ - job-read
+ - job-extended-read
+ - job-build
+ - job-cancel
+ - build-discarder:
+ num-to-keep: 30
+ days-to-keep: 30
+ parameters:
+ - string:
+ name: UPSTREAM_BUILD_URL
+ default: ''
+ - string:
+ name: UPSTREAM_GIT_BRANCH
+ default: 'master'
+ disabled: false
+ node: master
+ child-workspace: .
+ display-name: 'ODP publish icon'
+ wrappers:
+ - timestamps
+ - build-name:
+ name: '#${BUILD_NUMBER}-${GIT_REVISION,length=8}'
+ - timeout:
+ timeout: 20
+ builders:
+ - linaro-publish-token
+ - shell: |
+ #!/bin/bash
+
+ set -ex
+
+ # Prepare to publish to docs.opendataplane.org/snapshots
+ mkdir -p doc_snapshots
+ wget -q ${UPSTREAM_BUILD_URL}/badge/icon -O doc_snapshots/icon
+
+ # Construct URL
+ trimmed_build_url=$(echo ${UPSTREAM_BUILD_URL} | sed 's|.*jenkins/job/||g')
+ upstream_job_name=$(echo ${trimmed_build_url} | awk -F'/' '{print $1}')
+ upstream_axis=$(echo ${trimmed_build_url} | awk -F'/' '{print $2}')
+ upstream_buildnumber=$(echo ${trimmed_build_url} | awk -F'/' '{print $3}')
+
+ construct_publish_path=${upstream_job_name}/${UPSTREAM_GIT_BRANCH}
+ for axis in $(echo $( echo ${upstream_axis}| sed 's|,| |g')); do
+ construct_publish_path=${construct_publish_path}/$(echo ${axis}|awk -F'=' '{print $2}')
+ done
+
+ - ssh:
+ site: 'docs.opendataplane.org'
+ target: 'incoming/${construct_publish_path}/${upstream_buildnumber}'
+ source: 'doc_snapshots/**'
+ command: |
+ cd /srv/docs.opendataplane.org
+ mkdir -p snapshots/${construct_publish_path}/${upstream_buildnumber}
+ cp -a incoming/${construct_publish_path}/${upstream_buildnumber}/icon snapshots/${construct_publish_path}/${upstream_buildnumber}
+ rm -rf $(pwd)/snapshots/${construct_publish_path}/latest
+ ln -sf $(pwd)/snapshots/${construct_publish_path}/${upstream_buildnumber} snapshots/${construct_publish_path}/latest
+ rm -rf incoming/${construct_publish_path}/${upstream_buildnumber}
+ timeout: 120000
+ remove-prefix: 'doc_snapshots'
+ always-publish-from-master: true
+ publishers:
+ - warnings:
+ console-log-parsers:
+ - 'GNU Make + GNU C Compiler (gcc)'
+ - email:
+ recipients: 'anders.roxell@linaro.org, fathi.boudra@linaro.org'