Skip to content

Commit

Permalink
Resolves voxpupuli#1090 Stage plugin before deleting existing plugin,…
Browse files Browse the repository at this point in the history
… remove, then move
  • Loading branch information
zoojar committed Mar 21, 2024
1 parent 66938db commit a5258ad
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions manifests/plugin.pp
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,12 @@
$checksum_type = undef
}

exec { "force ${plugin}-${version}":
command => "/bin/rm -rf ${jenkins::plugin_dir}/${plugin}",
exec { "force staged ${plugin}-${version}":
command => "/bin/rm -rf ${jenkins::plugin_dir}/${plugin}.staged",
}
-> archive { $plugin:
source => $download_url,
path => "${jenkins::plugin_dir}/${plugin}",
path => "${jenkins::plugin_dir}/${plugin}.staged",
checksum_verify => $checksum_verify,
checksum => $checksum,
checksum_type => $checksum_type,
Expand All @@ -197,6 +197,12 @@
require => $plugindir,
notify => $notify,
}
-> exec { "force ${plugin}-${version}":
command => "/bin/rm -rf ${jenkins::plugin_dir}/${plugin}",
}
-> exec { "stage ${plugin}-${version}":
command => "/bin/mv -f ${jenkins::plugin_dir}/${plugin}.staged ${jenkins::plugin_dir}/${plugin}",
}
$archive_require = Archive[$plugin]
} else {
$archive_require = undef
Expand Down

0 comments on commit a5258ad

Please sign in to comment.