2024-03-20 16:30:31 +02:00
< h2 > < img align = "middle" src = "https://raw.githubusercontent.com/odb/official-bash-logo/master/assets/Logos/Icons/PNG/64x64.png" >
2024-05-22 11:35:38 +02:00
OctoPower - Easy JCB Powers to Composer PHP package
2024-03-20 16:30:31 +02:00
< / h2 >
2024-05-22 11:35:38 +02:00
With this script we can easily package multiple power classes in an automated way from a json configuration file, and environment variables into a composer package.
2024-03-20 16:30:31 +02:00
2021-06-08 08:20:21 +02:00
> program only for ubuntu/debian and Gitea systems at this time (should you like to use it on other OS's please open and issue...)
---
# Install
```shell
2024-05-22 11:35:38 +02:00
$ sudo curl -L "https://git.vdm.dev/api/v1/repos/octoleo/octopower/raw/src/octopower" -o /usr/local/bin/octopower
$ sudo chmod +x /usr/local/bin/octopower
2021-06-08 08:20:21 +02:00
```
---
# Usage
> To see the help menu
```shell
2024-05-22 11:35:38 +02:00
$ octopower -h
2021-06-08 08:20:21 +02:00
```
---
2024-05-22 11:35:38 +02:00
## Help Menu (octopower)
2021-06-08 08:20:21 +02:00
```txt
2024-05-22 11:35:38 +02:00
Usage: octopower [OPTION...]
2021-06-08 08:20:21 +02:00
Options
======================================================
-p | --packager=< packager Name >
2024-05-22 11:35:38 +02:00
Packager name
example: octopower -p="Vast Development Method"
======================================================
2021-06-08 08:20:21 +02:00
-pu | --packager-url=< //packager.url>
2024-05-22 11:35:38 +02:00
Packager url
example: octopower -pu="https://git.vdm.dev/"
======================================================
2023-02-14 15:41:51 +02:00
-md | --main-dir=< path >
2024-05-22 11:35:38 +02:00
load the main working directory
example: octopower --main-dir=/src
======================================================
2021-06-08 08:20:21 +02:00
-e | --env=< file >
2024-05-22 11:35:38 +02:00
load the environment variables file
example: octopower --env=/src/.env
======================================================
2023-02-14 15:41:51 +02:00
--conf | --config=< path / url >
2024-05-22 11:35:38 +02:00
load the configuration for the package in json format
file-example: src/example.json
example: octopower --config=config.json
======================================================
2023-02-14 15:41:51 +02:00
-ld | --licence-dir=< path >
2024-05-22 11:35:38 +02:00
load the licence directory
example: octopower --licence-dir=/src/licence
======================================================
2021-06-08 08:20:21 +02:00
-t | --token=< access_token >
2024-05-22 11:35:38 +02:00
load the global token
example: octopower --token=xxxxxxxxxxxxxxxxxxxxxxxxx
======================================================
2021-06-08 08:20:21 +02:00
-u | --url=< gitea >
2024-05-22 11:35:38 +02:00
Global url of the Gitea instance
example: octopower --url="git.vdm.dev"
======================================================
2021-06-08 08:20:21 +02:00
-a | --api=< //gitea.api>
2024-05-22 11:35:38 +02:00
Global api of the Gitea instance
example: octopower --api="https://git.vdm.dev/api/v1"
======================================================
2021-06-08 08:20:21 +02:00
-q | --quiet
2024-05-22 11:35:38 +02:00
mute all output messages
example: octopower --quiet
======================================================
2021-06-08 08:20:21 +02:00
--update
2024-05-22 11:35:38 +02:00
to update your install
example: octopower --update
======================================================
2021-06-08 08:20:21 +02:00
--uninstall
2024-05-22 11:35:38 +02:00
to uninstall this script
example: octopower --uninstall
======================================================
2021-06-08 08:20:21 +02:00
-h|--help
2024-05-22 11:35:38 +02:00
display this help menu
example: octopower -h
example: octopower --help
======================================================
OctoPower v1.0.0
======================================================
2021-06-08 08:20:21 +02:00
```
### Local Environment Variables File
Give the path to your .env file to the program like this:
```shell
2024-05-22 11:35:38 +02:00
$ octopower --env="/home/username/.config/octopower/custom.env"
2021-06-08 08:20:21 +02:00
```
Or with an environment variable you set before using the program like this:
```shell
2024-05-22 11:35:38 +02:00
$ export VDM_ENV_FILE_PATH="/home/username/.config/octopower/custom.env"
2021-06-08 08:20:21 +02:00
```
2024-05-22 11:35:38 +02:00
> Default path is: /home/$USER/.config/octopower/.env
2021-06-08 08:20:21 +02:00
### API ACCESS TOKEN (never share your token)
You can set your API access token for Gitea via the .env file like this:
```shell
VDM_GLOBAL_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxx"
```
Or you can pass the token directly to the script like this:
```shell
2024-05-22 11:35:38 +02:00
$ octopower --token="xxxxxxxxxxxxxxxxxxxxxxxxx"
2021-06-08 08:20:21 +02:00
```
Or with an environment variable you set before using the program like this:
```shell
$ export VDM_GLOBAL_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxx"
```
### Configuration File
2024-05-22 11:35:38 +02:00
To see the example of the json configuration options check out [config/octopower.json ](https://git.vdm.dev/octoleo/octopower/src/branch/master/config/octopower.json ).
2021-06-08 08:20:21 +02:00
You can set your configuration file path via the .env file like this:
```shell
2024-05-22 11:35:38 +02:00
VDM_PACKAGE_CONF_FILE="/home/username/.config/octopower/package_name_config.json"
2021-06-08 08:20:21 +02:00
```
Or you can pass it to the program by URL:
```shell
2024-05-22 11:35:38 +02:00
$ octopower --conf="https://git.vdm.dev/api/v1/repos/octoleo/octopower/raw/config/octopower.json"
2021-06-08 08:20:21 +02:00
```
Or via a local file path:
```shell
2024-05-22 11:35:38 +02:00
$ octopower --conf="/home/username/.config/octopower/package_name_config.json"
2021-06-08 08:20:21 +02:00
```
Or with an environment variable you set before using the program like this:
```shell
2024-05-22 11:35:38 +02:00
$ export VDM_PACKAGE_CONF_FILE="/home/username/.config/octopower/package_name_config.json"
2021-06-08 08:20:21 +02:00
```
---
## Uninstall
```shell
2024-05-22 11:35:38 +02:00
$ octopower --uninstall
2021-06-08 08:20:21 +02:00
```
---
# Free Software License
```txt
@copyright Copyright (C) 2021 Llewellyn van der Merwe. All rights reserved.
@license GNU General Public License version 2; see LICENSE
2024-05-22 11:35:38 +02:00
```