Browse code

Jenkinsfile: save docker-py artifacts

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 8b6da9d82f9609c7c3329caa67778edf61933600)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Sebastiaan van Stijn authored on 2019/08/11 05:58:17
Showing 1 changed files
... ...
@@ -83,6 +83,23 @@ pipeline {
83 83
                             post {
84 84
                                 always {
85 85
                                     junit testResults: 'bundles/test-docker-py/junit-report.xml', allowEmptyResults: true
86
+
87
+                                    sh '''
88
+                                    echo "Ensuring container killed."
89
+                                    docker rm -vf docker-pr$BUILD_NUMBER || true
90
+                                    '''
91
+
92
+                                    sh '''
93
+                                    echo 'Chowning /workspace to jenkins user'
94
+                                    docker run --rm -v "$WORKSPACE:/workspace" busybox chown -R "$(id -u):$(id -g)" /workspace
95
+                                    '''
96
+
97
+                                    sh '''
98
+                                    echo 'Creating docker-py-bundles.tar.gz'
99
+                                    tar -czf docker-py-bundles.tar.gz bundles/test-docker-py/*.xml bundles/test-docker-py/*.log
100
+                                    '''
101
+
102
+                                    archiveArtifacts artifacts: 'docker-py-bundles.tar.gz'
86 103
                                 }
87 104
                             }
88 105
                         }