0.3.1
All checks were successful
continuous-integration/drone/tag Build is passing

This commit is contained in:
2022-05-15 18:30:54 +01:00
parent c4df4b5582
commit b4fc15e611
9 changed files with 311 additions and 1 deletions

99
.drone.yml Normal file
View File

@@ -0,0 +1,99 @@
kind: pipeline
type: docker
name: default
trigger:
event:
- tag
concurrency:
limit: 1
workspace:
path: /drone/src
steps:
- name: checkout submodule
image: alpine/git
commands:
- git submodule update --init --recursive
- name: checkout tag
image: alpine/git
commands:
- cd ouch
- git fetch --all --tags
- git checkout tags/${DRONE_TAG}
depends_on:
- "checkout submodule"
- name: cargo build
image: rust:latest
commands:
- cd ouch
- cargo build --release --target x86_64-unknown-linux-gnu
- cd target/x86_64-unknown-linux-gnu/release
depends_on:
- "checkout tag"
- name: build slackware package
image: vbatts/slackware:14.2
commands:
- mkdir -p dist/usr/sbin
- cp ouch/target/x86_64-unknown-linux-gnu/release/ouch ./dist/usr/sbin/ouch
- cp -R ./usr ./dist
- chmod +x ./dist/usr/sbin/ouch
- cd dist
- makepkg -l y -c y ../unraid-ouch-${DRONE_TAG}.txz
depends_on:
- "cargo build"
- name: prepare release
image: vbatts/slackware:14.2
commands:
- echo "ouch ${DRONE_TAG} - built@$(date '+%FT%TZ') [Drone ${DRONE_SYSTEM_VERSION}]" > ./release_note
- cat ./release_note
depends_on:
- "build slackware package"
- name: publish gitea release
image: plugins/gitea-release
settings:
api_key:
from_secret: GITEA_KEY
base_url: https://git.panaetius.co.uk
files:
- ./unraid-ouch-${DRONE_TAG}.txz
checksum:
- md5
title: ${DRONE_TAG}
note: ./release_note
file_exists: "skip"
when:
event: tag
depends_on:
- "prepare release"
- name: publish github release
image: plugins/github-release@sha256:24f5fb388173c0ec211d1c73d2c4441efd3cd24d0ba9eea148b98c40d03807ff
settings:
api_key:
from_secret: GITHUB_KEY
files:
- ./unraid-ouch-${DRONE_TAG}.txz
checksum:
- md5
title: ${DRONE_TAG}
note: ./release_note
file_exists: "skip"
when:
event: tag
depends_on:
- "prepare release"
- name: slack
image: plugins/slack
settings:
webhook:
from_secret: BUILD_STATUS_SLACK_WEBHOOK
username: drone
when:
status:
- "success"
- "failure"
depends_on:
- "publish gitea release"
- "publish github release"

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.DS_STORE

3
.gitmodules vendored Normal file
View File

@@ -0,0 +1,3 @@
[submodule "ouch"]
path = ouch
url = https://github.com/ouch-org/ouch

View File

@@ -1 +1,14 @@
# unraid-ouch # ouch
This is the repository for the unraid ouch plugin.
<img src="https://git.panaetius.co.uk/dtomlinson91/unraid-ouch/raw/branch/main/assets/unraid-ouch.png"/>
ouch stands for Obvious Unified Compression Helper and is a CLI tool to help you compress and decompress files of several formats.
For more information see the [ouch repository](https://github.com/ouch-org/ouch).
## dev
Drone builds the plugin source using cargo on a new tag creation.
Tag versions follow rip releases.

BIN
assets/unraid-ouch.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

97
dev.unraid-rip.plg Normal file
View File

@@ -0,0 +1,97 @@
<?xml version='1.0' standalone='yes'?>
<!DOCTYPE PLUGIN [
<!ENTITY name "unraid-ouch">
<!ENTITY author "dtomlinson">
<!ENTITY org "dtomlinson91">
<!ENTITY version "0.3.1">
<!ENTITY gitURL "https://git.panaetius.co.uk/&org;/&name;">
<!ENTITY pluginURL "&gitURL;/raw/branch/main/&name;.plg">
<!ENTITY releaseURL "&gitURL;/releases/download/&version;/&name;-&version;.txz">
<!ENTITY releaseMD5URL "&gitURL;/releases/download/&version;/md5sum.txt">
<!ENTITY plugin "/boot/config/plugins/&name;">
<!ENTITY emhttp "/usr/local/emhttp/plugins/&name;">
]>
<PLUGIN name="&name;" author="&author;" version="&version;" pluginURL="&pluginURL;" min="6.8.3">
<CHANGES>
### 2022-05-15
- Initial release - ouch 0.3.1
</CHANGES>
<FILE Name="&plugin;/&name;-&version;.txz">
<URL>&releaseURL;</URL>
</FILE>
<FILE Name="&plugin;/&name;-&version;.md5">
<URL>&releaseMD5URL;</URL>
</FILE>
<FILE Run="/bin/bash">
<INLINE>
local_package_file_md5=$(/usr/bin/md5sum &plugin;/&name;-&version;.txz)
remote_package_file_md5=$(/usr/bin/cat &name;-&version;.md5)
if test $local_package_file_md5 != remote_package_file_md5
then
echo "*** md5 of download package does not match - removing files and exiting ***"
rm &plugin;/&name;-&version;.txz
rm &name;-&version;.md5
exit 1
else
echo "*** md5 check successful ***"
fi
</INLINE>
</FILE>
<FILE Run="/bin/bash">
<INLINE>
<!-- remove previous version if present -->
file=$(/usr/bin/ls /boot/config/plugins/&name;/&name;*.txz | grep -v '&version;')
if [ ! -z "$file" ]
then
filename=$(basename -- $file)
previous="${filename%.*}"
echo "*** previous version ${previous} found - uninstalling ***"
removepkg $previous
rm -f $file
else
echo "*** no previous version found - first time install ***"
fi
</INLINE>
</FILE>
<FILE Run="/bin/bash">
<INLINE>
upgradepkg --install-new &plugin;/&name;-&version;.txz
</INLINE>
</FILE>
<FILE Name="&emhttp;/README.md">
<INLINE>
**ouch**
ouch stands for Obvious Unified Compression Helper and is a CLI tool to help you compress and decompress files of several formats.
For more information see the [ouch repository](https://github.com/ouch-org/ouch).
</INLINE>
</FILE>
<FILE Run="/bin/bash" Method="remove">
<INLINE>
echo "*** Removing ouch ***"
# Remove plugin related files
removepkg &name;-&version;
rm -rf &emhttp;
rm -rf &plugin;
echo
echo "*** Successfully removed ouch ***"
</INLINE>
</FILE>
</PLUGIN>

1
ouch Submodule

Submodule ouch added at 35481bdb4d

96
unraid-rip.plg Normal file
View File

@@ -0,0 +1,96 @@
<?xml version='1.0' standalone='yes'?>
<!DOCTYPE PLUGIN [
<!ENTITY name "unraid-ouch">
<!ENTITY author "dtomlinson">
<!ENTITY org "dtomlinson91">
<!ENTITY version "0.3.1">
<!ENTITY gitURL "https://github.com/&org;/&name;">
<!ENTITY pluginURL "&gitURL;/raw/main/&name;.plg">
<!ENTITY releaseURL "&gitURL;/releases/download/&version;/&name;-&version;.txz">
<!ENTITY releaseMD5URL "&gitURL;/releases/download/&version;/md5sum.txt">
<!ENTITY plugin "/boot/config/plugins/&name;">
<!ENTITY emhttp "/usr/local/emhttp/plugins/&name;">
]>
<PLUGIN name="&name;" author="&author;" version="&version;" pluginURL="&pluginURL;" min="6.8.3">
<CHANGES>
### 2022-05-15
- Initial release - ouch 0.3.1
</CHANGES>
<FILE Name="&plugin;/&name;-&version;.txz">
<URL>&releaseURL;</URL>
</FILE>
<FILE Name="&plugin;/&name;-&version;.md5">
<URL>&releaseMD5URL;</URL>
</FILE>
<FILE Run="/bin/bash">
<INLINE>
local_package_file_md5=$(/usr/bin/md5sum &plugin;/&name;-&version;.txz)
remote_package_file_md5=$(/usr/bin/cat &name;-&version;.md5)
if test $local_package_file_md5 != remote_package_file_md5
then
echo "*** md5 of download package does not match - removing files and exiting ***"
rm &plugin;/&name;-&version;.txz
rm &name;-&version;.md5
exit 1
else
echo "*** md5 check successful ***"
fi
</INLINE>
</FILE>
<FILE Run="/bin/bash">
<INLINE>
<!-- remove previous version if present -->
file=$(/usr/bin/ls /boot/config/plugins/&name;/&name;*.txz | grep -v '&version;')
if [ ! -z "$file" ]
then
filename=$(basename -- $file)
previous="${filename%.*}"
echo "*** previous version ${previous} found - uninstalling ***"
removepkg $previous
rm -f $file
else
echo "*** no previous version found - first time install ***"
fi
</INLINE>
</FILE>
<FILE Run="/bin/bash">
<INLINE>
upgradepkg --install-new &plugin;/&name;-&version;.txz
</INLINE>
</FILE>
<FILE Name="&emhttp;/README.md">
<INLINE>
**ouch**
ouch stands for Obvious Unified Compression Helper and is a CLI tool to help you compress and decompress files of several formats.
For more information see the [ouch repository](https://github.com/ouch-org/ouch).
</INLINE>
</FILE>
<FILE Run="/bin/bash" Method="remove">
<INLINE>
echo "*** Removing ouch ***"
# Remove plugin related files
removepkg &name;-&version;
rm -rf &emhttp;
rm -rf &plugin;
echo
echo "*** Successfully removed ouch ***"
</INLINE>
</FILE>
</PLUGIN>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB