From 9a8783fae389652ac1a0f7d18cb668ae0cb47df6 Mon Sep 17 00:00:00 2001
From: Clark Boylan <clark.boylan@gmail.com>
Date: Thu, 26 Oct 2017 09:25:57 -0700
Subject: [PATCH] Create dir needed to publish gerrit plugins

rsync will only create a single directory to copy contents in so we need
to create every dir level above that. In this case are copying to
$workdir/artifacts/plugins/$plugin and were only creating the artifacts
dir and rsync will only attempt to mkdir $plugin so this fails on
missing the plugins dir.

Fix this by also creating the plugins dir.

Change-Id: I93ecb3d39cc751bb7d4a17173fd02e41ea77b620
---
 .../legacy/its-storyboard-gerrit-plugin-stable-2.13/post.yaml  | 3 ++-
 .../legacy/javamelody-gerrit-plugin-stable-2.13/post.yaml      | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/playbooks/legacy/its-storyboard-gerrit-plugin-stable-2.13/post.yaml b/playbooks/legacy/its-storyboard-gerrit-plugin-stable-2.13/post.yaml
index 0afff6d7..b0b9ca8d 100644
--- a/playbooks/legacy/its-storyboard-gerrit-plugin-stable-2.13/post.yaml
+++ b/playbooks/legacy/its-storyboard-gerrit-plugin-stable-2.13/post.yaml
@@ -3,8 +3,9 @@
 
     - name: Ensure artifacts directory exists
       file:
-        path: '{{ zuul.executor.work_root }}/artifacts'
+        path: '{{ zuul.executor.work_root }}/artifacts/plugins'
         state: directory
+        recurse: yes
       delegate_to: localhost
 
     - name: Copy files from {{ ansible_user_dir }}/workspace/ on node
diff --git a/playbooks/legacy/javamelody-gerrit-plugin-stable-2.13/post.yaml b/playbooks/legacy/javamelody-gerrit-plugin-stable-2.13/post.yaml
index e68d0854..5df4aa87 100644
--- a/playbooks/legacy/javamelody-gerrit-plugin-stable-2.13/post.yaml
+++ b/playbooks/legacy/javamelody-gerrit-plugin-stable-2.13/post.yaml
@@ -3,8 +3,9 @@
 
     - name: Ensure artifacts directory exists
       file:
-        path: '{{ zuul.executor.work_root }}/artifacts'
+        path: '{{ zuul.executor.work_root }}/artifacts/plugins'
         state: directory
+        recurse: yes
       delegate_to: localhost
 
     - name: Copy files from {{ ansible_user_dir }}/workspace/ on node