generated from Templates/Baseline
add upload command #3
@ -6,7 +6,7 @@
|
|||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://gitea.ocram85.com/plugins/gitea-package/">
|
<a href="https://gitea.ocram85.com/plugins/gitea-package/">
|
||||||
<img
|
<img
|
||||||
src="/plugins/gitea-package/raw/branch/master/assets/social-logo.png"
|
src="/plugins/gitea-package/raw/branch/main/assets/social-logo.png"
|
||||||
alt="gitea-package"
|
alt="gitea-package"
|
||||||
>
|
>
|
||||||
</a>
|
</a>
|
||||||
@ -21,8 +21,8 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://drone.ocram85.com/plugins/gitea-package">
|
<a href="https://ci.ocram85.com/plugins/gitea-package" target="_blank">
|
||||||
<img src="https://drone.ocram85.com/api/badges/plugins/gitea-package/status.svg" alt="Main Branch Build Status">
|
<img src="https://ci.ocram85.com/api/badges/plugins/gitea-package/status.svg" alt="Main Branch Build Status">
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
@ -48,11 +48,26 @@ showSettings() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uploadArtifact() {
|
uploadArtifact() {
|
||||||
|
say "Starting file upload..."
|
||||||
cout=$(curl --output /dev/null --write-out "%{http_code}" \
|
cout=$(curl --output /dev/null --write-out "%{http_code}" \
|
||||||
--user "$PLUGIN_USER:$PLUGIN_PASSWORD" \
|
--user "$PLUGIN_USER:$PLUGIN_PASSWORD" \
|
||||||
--upload-file "$PLUGIN_FILE_SOURCE" \
|
--upload-file "$PLUGIN_FILE_SOURCE" \
|
||||||
"$CI_FORGE_URL/api/packages/$PLUGIN_OWNER/generic/$PLUGIN_PACKAGE_NAME/$PLUGIN_PACKAGE_VERSION/$PLUGIN_FILE_NAME")
|
"$CI_FORGE_URL/api/packages/$PLUGIN_OWNER/generic/$PLUGIN_PACKAGE_NAME/$PLUGIN_PACKAGE_VERSION/$PLUGIN_FILE_NAME")
|
||||||
say "Curl output is: $cout" "uploadArtifact"
|
say "Curl output is: $cout" "uploadArtifact"
|
||||||
|
|
||||||
|
if [ "$cout" = "201" ]; then
|
||||||
|
say "Upload sucessfully finished." "uploadArtifact"
|
||||||
|
exit 0
|
||||||
|
elif [ "$cout" = "400" ]; then
|
||||||
|
sayE "Upload failed! (Bad Request)" "uploadArtifact"
|
||||||
|
exit 1
|
||||||
|
elif [ "$cout" = "409" ]; then
|
||||||
|
sayW "A file with the same name exist already in the package." "uploadArtifact"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
sayE "Unknown upload response! ($cout)" "uploadArtifact"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
|
Loading…
Reference in New Issue
Block a user