add initial files

This commit is contained in:
2022-05-06 16:19:50 +01:00
parent edce34ff27
commit bb18e7ab98
7 changed files with 247 additions and 6 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 ox
- git fetch --all --tags
- git checkout tags/${DRONE_TAG}
depends_on:
- "checkout submodule"
- name: cargo build
image: rust:latest
commands:
- cd ox
- 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 ox/target/x86_64-unknown-linux-gnu/release/ox ./dist/usr/sbin/ox
- cp -R ./usr ./dist
- chmod +x ./dist/usr/sbin/ox
- cd dist
- makepkg -l y -c y ../unraid-ox-${DRONE_TAG}.txz
depends_on:
- "cargo build"
- name: prepare release
image: vbatts/slackware:14.2
commands:
- echo "ox ${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-ox-${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
settings:
api_key:
from_secret: GITHUB_KEY
files:
- ./unraid-ox-${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

View File

@@ -1,14 +1,14 @@
# ox
# bottom
This is the repository for the unraid ox plugin.
This is the repository for the unraid bottom plugin.
<img src="https://git.panaetius.co.uk/dtomlinson91/unraid-ox/raw/branch/main/assets/unraid-ox.png"/>
<img src="https://git.panaetius.co.uk/dtomlinson91/unraid-bottom/raw/branch/main/assets/unraid-bottom.gif"/>
Ox is a code editor that runs in your terminal.
A customizable cross-platform graphical process/system monitor for the terminal.
For more information see the [ox repository](https://github.com/curlpipe/ox).
For more information see the [bottom repository](https://github.com/ClementTsang/bottom).
## dev
Drone builds the plugin source using cargo on a new tag creation.
Tag versions follow ox releases.
Tag versions follow bottom releases.

BIN
assets/unraid-bottom.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 MiB

71
dev.unraid-bottom.plg Normal file
View File

@@ -0,0 +1,71 @@
<?xml version='1.0' standalone='yes'?>
<!DOCTYPE PLUGIN [
<!ENTITY name "unraid-ox">
<!ENTITY author "dtomlinson">
<!ENTITY org "dtomlinson91">
<!ENTITY version "0.2.7">
<!ENTITY gitURL "https://git.panaetius.co.uk/&org;/&name;">
<!ENTITY pluginURL "&gitURL;/raw/branch/master/&name;.plg">
<!ENTITY releaseURL "&gitURL;/releases/download/&version;/&name;-&version;.txz">
<!ENTITY md5 "8b7554b64237bc0935493d21f53869fe">
<!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-06
- Initial release - ox 0.2.7
</CHANGES>
<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 Name="/boot/config/plugins/&name;/&name;-&version;.txz" Run="upgradepkg --install-new">
<URL>&releaseURL;</URL>
<MD5>&md5;</MD5>
</FILE>
<FILE Name="&emhttp;/README.md">
<INLINE>
**ox**
Ox is a code editor that runs in your terminal.
For more information see the [ox repository](https://github.com/curlpipe/ox).
</INLINE>
</FILE>
<FILE Run="/bin/bash" Method="remove">
<INLINE>
echo "*** Removing ox ***"
# Remove plugin related files
removepkg &name;-&version;
rm -rf &emhttp;
rm -rf &plugin;
echo
echo "*** Successfully removed ox ***"
</INLINE>
</FILE>
</PLUGIN>

70
unraid-bottom.plg Normal file
View File

@@ -0,0 +1,70 @@
<?xml version='1.0' standalone='yes'?>
<!DOCTYPE PLUGIN [
<!ENTITY name "unraid-ox">
<!ENTITY author "dtomlinson">
<!ENTITY org "dtomlinson91">
<!ENTITY version "0.2.7">
<!ENTITY gitURL "https://github.com/&org;/&name;">
<!ENTITY pluginURL "&gitURL;/raw/master/&name;.plg">
<!ENTITY releaseURL "&gitURL;/releases/download/&version;/&name;-&version;.txz">
<!ENTITY md5 "8b7554b64237bc0935493d21f53869fe">
<!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-06
- Initial release - ox 0.2.7
</CHANGES>
<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 Name="/boot/config/plugins/&name;/&name;-&version;.txz" Run="upgradepkg --install-new">
<URL>&releaseURL;</URL>
<MD5>&md5;</MD5>
</FILE>
<FILE Name="&emhttp;/README.md">
<INLINE>
**ox**
Ox is a code editor that runs in your terminal.
For more information see the [ox repository](https://github.com/curlpipe/ox).
</INLINE>
</FILE>
<FILE Run="/bin/bash" Method="remove">
<INLINE>
echo "*** Removing ox ***"
# Remove plugin related files
removepkg &name;-&version;
rm -rf &emhttp;
rm -rf &plugin;
echo
echo "*** Successfully removed ox ***"
</INLINE>
</FILE>
</PLUGIN>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB