First release of OctoPower.

This commit is contained in:
Llewellyn van der Merwe 2024-05-22 11:35:38 +02:00
parent ee4b5003cd
commit e2ea411a7f
Signed by: Llewellyn
GPG Key ID: A9201372263741E7
7 changed files with 1877 additions and 1837 deletions

126
README.md
View File

@ -1,102 +1,98 @@
<h2><img align="middle" src="https://raw.githubusercontent.com/odb/official-bash-logo/master/assets/Logos/Icons/PNG/64x64.png" >
Octojpack - Easy Joomla Extension Packaging
OctoPower - Easy JCB Powers to Composer PHP package
</h2>
Written by Llewellyn van der Merwe (@llewellynvdm)
With this script we can easily package multiple extensions in an automated way from a json configuration file, and environment variables.
Linted by [#ShellCheck](https://github.com/koalaman/shellcheck)
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.
> 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
$ sudo curl -L "https://git.vdm.dev/api/v1/repos/octoleo/octojpack/raw/src/octojpack" -o /usr/local/bin/octojpack
$ sudo chmod +x /usr/local/bin/octojpack
$ 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
```
---
# Usage
> To see the help menu
```shell
$ octojpack -h
$ octopower -h
```
---
## Help Menu (octojpack)
## Help Menu (octopower)
```txt
Usage: octojpack [OPTION...]
Usage: octopower [OPTION...]
Options
======================================================
-p | --packager=<packager Name>
Packager name
example: octojpack -p="Vast Development Method"
======================================================
Packager name
example: octopower -p="Vast Development Method"
======================================================
-pu | --packager-url=<//packager.url>
Packager url
example: octojpack -pu="https://git.vdm.dev/"
======================================================
Packager url
example: octopower -pu="https://git.vdm.dev/"
======================================================
-md | --main-dir=<path>
load the main working directory
example: octojpack --main-dir=/src
======================================================
load the main working directory
example: octopower --main-dir=/src
======================================================
-e | --env=<file>
load the environment variables file
example: octojpack --env=/src/.env
======================================================
load the environment variables file
example: octopower --env=/src/.env
======================================================
--conf | --config=<path/url>
load the configuration for the package in json format
file-example: src/example.json
example: octojpack --config=config.json
======================================================
load the configuration for the package in json format
file-example: src/example.json
example: octopower --config=config.json
======================================================
-ld | --licence-dir=<path>
load the licence directory
example: octojpack --licence-dir=/src/licence
======================================================
load the licence directory
example: octopower --licence-dir=/src/licence
======================================================
-t | --token=<access_token>
load the global token
example: octojpack --token=xxxxxxxxxxxxxxxxxxxxxxxxx
======================================================
load the global token
example: octopower --token=xxxxxxxxxxxxxxxxxxxxxxxxx
======================================================
-u | --url=<gitea>
Global url of the Gitea instance
example: octojpack --url="git.vdm.dev"
======================================================
Global url of the Gitea instance
example: octopower --url="git.vdm.dev"
======================================================
-a | --api=<//gitea.api>
Global api of the Gitea instance
example: octojpack --api="https://git.vdm.dev/api/v1"
======================================================
Global api of the Gitea instance
example: octopower --api="https://git.vdm.dev/api/v1"
======================================================
-q | --quiet
mute all output messages
example: octojpack --quiet
======================================================
mute all output messages
example: octopower --quiet
======================================================
--update
to update your install
example: octojpack --update
======================================================
to update your install
example: octopower --update
======================================================
--uninstall
to uninstall this script
example: octojpack --uninstall
======================================================
to uninstall this script
example: octopower --uninstall
======================================================
-h|--help
display this help menu
example: octojpack -h
example: octojpack --help
======================================================
Octojpack
======================================================
display this help menu
example: octopower -h
example: octopower --help
======================================================
OctoPower v1.0.0
======================================================
```
### Local Environment Variables File
Give the path to your .env file to the program like this:
```shell
$ octojpack --env="/home/username/.config/octojpack/custom.env"
$ octopower --env="/home/username/.config/octopower/custom.env"
```
Or with an environment variable you set before using the program like this:
```shell
$ export VDM_ENV_FILE_PATH="/home/username/.config/octojpack/custom.env"
$ export VDM_ENV_FILE_PATH="/home/username/.config/octopower/custom.env"
```
> Default path is: /home/$USER/.config/octojpack/.env
> Default path is: /home/$USER/.config/octopower/.env
### API ACCESS TOKEN (never share your token)
@ -106,7 +102,7 @@ VDM_GLOBAL_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxx"
```
Or you can pass the token directly to the script like this:
```shell
$ octojpack --token="xxxxxxxxxxxxxxxxxxxxxxxxx"
$ octopower --token="xxxxxxxxxxxxxxxxxxxxxxxxx"
```
Or with an environment variable you set before using the program like this:
```shell
@ -115,33 +111,33 @@ $ export VDM_GLOBAL_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxx"
### Configuration File
To see the example of the json configuration options check out [src/example.json](https://git.vdm.dev/octoleo/octojpack/src/branch/master/src/example.json).
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).
You can set your configuration file path via the .env file like this:
```shell
VDM_PACKAGE_CONF_FILE="/home/username/.config/octojpack/package_name_config.json"
VDM_PACKAGE_CONF_FILE="/home/username/.config/octopower/package_name_config.json"
```
Or you can pass it to the program by URL:
```shell
$ octojpack --conf="https://git.vdm.dev/api/v1/repos/octoleo/octojpack/raw/src/example.json"
$ octopower --conf="https://git.vdm.dev/api/v1/repos/octoleo/octopower/raw/config/octopower.json"
```
Or via a local file path:
```shell
$ octojpack --conf="/home/username/.config/octojpack/package_name_config.json"
$ octopower --conf="/home/username/.config/octopower/package_name_config.json"
```
Or with an environment variable you set before using the program like this:
```shell
$ export VDM_PACKAGE_CONF_FILE="/home/username/.config/octojpack/package_name_config.json"
$ export VDM_PACKAGE_CONF_FILE="/home/username/.config/octopower/package_name_config.json"
```
---
## Uninstall
```shell
$ octojpack --uninstall
$ octopower --uninstall
```
---
# Free Software License
```txt
@copyright Copyright (C) 2021 Llewellyn van der Merwe. All rights reserved.
@license GNU General Public License version 2; see LICENSE
```
```

6
config/env Normal file
View File

@ -0,0 +1,6 @@
GIT_AUTHOR_NAME='USERNAME'
GIT_AUTHOR_EMAIL='username@domain.com'
GIT_GPG_SIGN=true
GIT_SIGNING_KEY='xxxxxxxxxxxxxxx'
VDM_GLOBAL_TOKEN='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
VDM_PACKAGE_CONF_FILE='/home/username/projectname/.octopower'

81
config/octopower.json Normal file
View File

@ -0,0 +1,81 @@
{
"global": {
"api": "https://git.vdm.dev/api/v1",
"url": "git.vdm.dev"
},
"package": {
"name": "vdm/superpower",
"code_name": "vdm_superpower",
"type": "library",
"description": "VDM SuperPower Library",
"homepage": "https://git.vdm.dev/joomla/superpowers",
"keywords": ["VDM", "JCB", "SuperPower"],
"license": "GNU General Public License version 2 or later",
"php": "^8.1.0",
"version": "1.0.0",
"author": "Llewellyn van der Merwe",
"author_email": "joomla@vdm.io",
"author_url": "https://dev.vdm.io"
},
"repository": {
"owner": "joomla",
"repo": "superpower"
},
"repositories": [
{
"owner": "joomla",
"repo": "super-powers"
}
],
"powers": [
"06f8eada-d59b-441c-b287-0aea1793da5a",
"0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a",
"11572d9b-e3d5-4b29-904c-9618d8f2bfd8",
"1198aecf-84c6-45d2-aea8-d531aa4afdfa",
"152c8793-8b75-4715-996a-257b9f65451c",
"1f28cb53-60d9-4db1-b517-3c7dc6b429ef",
"215b35ac-1b26-4838-bbcf-d1fdbbd9353f",
"2ad31f74-f579-499d-b98b-c4f54fd615dd",
"2da6d6c4-eb29-4d69-8bc2-36d96e916adf",
"30c5b4c2-f75f-4d15-869a-f8bfedd87358",
"3cf76fbf-fd95-4a33-878e-7aff6d36b7f6",
"43134867-5cb8-4280-9be8-309fd2fd135f",
"4815e1c7-a433-443d-a112-d1e03d7df84b",
"491dbe41-f26c-4de9-8a95-fcf87b35b56f",
"4b225c51-d293-48e4-b3f6-5136cf5c3f18",
"4dd11b9b-3c64-460b-aaa6-62ba467db7aa",
"524eb8f6-38d4-47dc-92ad-98b94e099ac0",
"52a1d14f-304a-431c-8fa4-411179942db5",
"584747d1-3a86-453d-b7a3-a2219de8d777",
"59b1a2ea-d77e-4040-ac8c-e65cd8743e9b",
"640b5352-fb09-425f-a26e-cd44eda03f15",
"64a6ff6c-069c-4a11-a76b-db5e36c27690",
"64e291c2-11f1-423d-a44d-837cc12cc017",
"6cbef8f8-4813-48e3-b05a-65e1aea95171",
"7179fde6-1e51-4b51-8545-7ca18f74a0f4",
"7d494d91-ab60-43cd-aecf-d50e07f7f30e",
"7e822c03-1b20-41d1-9427-f5b8d5836af7",
"8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff",
"91004529-94a9-4590-b842-e7c6b624ecf5",
"9c513baf-b279-43fd-ae29-a585c8cbc4f0",
"9ef0eb24-aae4-4f5a-99af-d724db44808f",
"a223b31e-ea1d-4cdf-92ae-5f9becffaff0",
"a8935cbe-7701-40dc-bfd5-675f2d600954",
"ad12ca1c-d3ce-4e7f-88c5-c6c92bdedc48",
"af0eedbe-603b-4671-8e5a-28165d88254b",
"b3d2ec33-76d4-4c3b-bb2c-86ac14a221ce",
"b84e947d-2a13-44f7-ac0f-3902ae55ae0c",
"bfd1d6d5-56c1-4fe9-9fee-1c5910e1f5d8",
"c09e8968-c767-4175-bb3d-8432f206a2c7",
"caf33c5d-858c-4f9a-894f-ab302ec5445a",
"cce56585-58b0-4f72-a92c-e2635ea52d83",
"cddcac51-9a46-47c4-ba59-105c70453bd6",
"ce8cf834-6bac-44fb-941c-861f7e046cc0",
"cefe4092-a4c2-41a6-a683-bd3ab5419cc6",
"db87c339-5bb6-4291-a7ef-2c48ea1b06bc",
"e0f6ddbe-2a35-4537-942c-faff2ebd04f6",
"f3c04c28-bce4-422e-be93-7d163e4e342b",
"ff7d0111-8f79-42aa-ac14-b53ba2c49369",
"ffbd4e1f-a342-4080-ab7d-1de3741bf319"
]
}

4
src/.gitignore vendored
View File

@ -1,5 +1,5 @@
conf.json
packager
licenses
.octojpack
.env
.octopc
.env

View File

@ -1,197 +0,0 @@
{
"global": {
"packager": "Vast Development Method",
"packager_url": "https://dev.vdm.io/",
"url": "git.vdm.dev",
"api": "https://git.vdm.dev/api/v1"
},
"package": {
"name": "PKG_COMPONENT_BUILDER_PRO",
"code_name": "component_builder_pro",
"package_name": "pkg_component_builder_pro",
"min_joomla_version": "3.8",
"max_joomla_version": "3.10",
"copyright": "Copyright (C) 2015 Llewellyn van der Merwe. All rights reserved.",
"copyright_year": "2015",
"license": "GNU General Public License version 2; see LICENSE",
"license_file": "LICENSE",
"author": "Llewellyn van der Merwe",
"author_email": "joomla@vdm.io",
"author_url": "https://io.vdm.dev",
"description": "The Joomla Component Builder Package (PRO) that bundles JCB Pro Component all the plugins and features available to Pro Members into one package for easy install and update of your JCB system.",
"update_servers": "https://io.vdm.dev/update/componentbuilder_update_server.xml",
"version_id": "com_componentbuilder"
},
"repository": {
"owner": "joomla",
"repo": "pkg-component-builder-pro"
},
"files": [
{
"owner": "joomla",
"repo": "Component-Builder-Pro",
"id": "com_componentbuilder",
"type": "component",
"token_name": "VDM_GLOBAL_TOKEN",
"api_name": "VDM_GLOBAL_API"
},
{
"owner": "joomla",
"repo": "plg_installer_componentbuilder",
"id": "ComponentBuilder",
"type": "plugin",
"group": "installer",
"token_name": "VDM_GLOBAL_TOKEN",
"api_name": "VDM_GLOBAL_API"
},
{
"owner": "joomla",
"repo": "plg_content_componentbuilderadminheaderstabs",
"id": "ComponentBuilderAdminHeadersTabs",
"type": "plugin",
"group": "content",
"token_name": "VDM_GLOBAL_TOKEN",
"api_name": "VDM_GLOBAL_API"
},
{
"owner": "joomla",
"repo": "plg_content_componentbuildercomponentdashboardheaderstabs",
"id": "ComponentBuilderComponentDashboardHeadersTabs",
"type": "plugin",
"group": "content",
"token_name": "VDM_GLOBAL_TOKEN",
"api_name": "VDM_GLOBAL_API"
},
{
"owner": "joomla",
"repo": "plg_content_componentbuildercomponentheaderstabs",
"id": "ComponentBuilderComponentHeadersTabs",
"type": "plugin",
"group": "content",
"token_name": "VDM_GLOBAL_TOKEN",
"api_name": "VDM_GLOBAL_API"
},
{
"owner": "joomla",
"repo": "plg_content_componentbuildercustomadminheaderstabs",
"id": "ComponentBuilderCustomAdminHeadersTabs",
"type": "plugin",
"group": "content",
"token_name": "VDM_GLOBAL_TOKEN",
"api_name": "VDM_GLOBAL_API"
},
{
"owner": "joomla",
"repo": "plg_content_componentbuilderfieldorderingtabs",
"id": "ComponentBuilderFieldOrderingTabs",
"type": "plugin",
"group": "content",
"token_name": "VDM_GLOBAL_TOKEN",
"api_name": "VDM_GLOBAL_API"
},
{
"owner": "joomla",
"repo": "plg_content_componentbuilderlanguagetabs",
"id": "ComponentBuilderLanguageTabs",
"type": "plugin",
"group": "content",
"token_name": "VDM_GLOBAL_TOKEN",
"api_name": "VDM_GLOBAL_API"
},
{
"owner": "joomla",
"repo": "plg_content_componentbuilderprivacytabs",
"id": "ComponentBuilderPrivacyTabs",
"type": "plugin",
"group": "content",
"token_name": "VDM_GLOBAL_TOKEN",
"api_name": "VDM_GLOBAL_API"
},
{
"owner": "joomla",
"repo": "plg_content_componentbuildersiteheaderstabs",
"id": "ComponentBuilderSiteHeadersTabs",
"type": "plugin",
"group": "content",
"token_name": "VDM_GLOBAL_TOKEN",
"api_name": "VDM_GLOBAL_API"
},
{
"owner": "joomla",
"repo": "plg_extension_componentbuilderactionlogcompiler",
"id": "ComponentBuilderActionLogCompiler",
"type": "plugin",
"group": "extension",
"token_name": "VDM_GLOBAL_TOKEN",
"api_name": "VDM_GLOBAL_API"
},
{
"owner": "joomla",
"repo": "plg_extension_componentbuilderexportcompiler",
"id": "ComponentBuilderExportCompiler",
"type": "plugin",
"group": "extension",
"token_name": "VDM_GLOBAL_TOKEN",
"api_name": "VDM_GLOBAL_API"
},
{
"owner": "joomla",
"repo": "plg_extension_componentbuilderfieldorderingcompiler",
"id": "ComponentBuilderFieldOrderingCompiler",
"type": "plugin",
"group": "extension",
"token_name": "VDM_GLOBAL_TOKEN",
"api_name": "VDM_GLOBAL_API"
},
{
"owner": "joomla",
"repo": "plg_extension_componentbuilderheaderscompiler",
"id": "ComponentBuilderHeadersCompiler",
"type": "plugin",
"group": "extension",
"token_name": "VDM_GLOBAL_TOKEN",
"api_name": "VDM_GLOBAL_API"
},
{
"owner": "joomla",
"repo": "plg_extension_componentbuilderlanguagepackaging",
"id": "ComponentBuilderLanguagePackaging",
"type": "plugin",
"group": "extension",
"token_name": "VDM_GLOBAL_TOKEN",
"api_name": "VDM_GLOBAL_API"
},
{
"owner": "joomla",
"repo": "plg_extension_componentbuilderpowersautoloadercompiler",
"id": "ComponentBuilderPowersAutoloaderCompiler",
"type": "plugin",
"group": "extension",
"token_name": "VDM_GLOBAL_TOKEN",
"api_name": "VDM_GLOBAL_API"
},
{
"owner": "joomla",
"repo": "plg_extension_componentbuilderprivacycompiler",
"id": "ComponentBuilderPrivacyCompiler",
"type": "plugin",
"group": "extension",
"token_name": "VDM_GLOBAL_TOKEN",
"api_name": "VDM_GLOBAL_API"
}
],
"languages": [
{
"tag": "en-GB",
"ini": "sys.ini",
"key": "PKG_COMPONENT_BUILDER_PRO",
"value": "Component Builder Pro Package"
},
{
"tag": "en-GB",
"ini": "ini",
"key": "PKG_COMPONENT_BUILDER_PRO",
"value": "Component Builder Pro Package"
}
]
}

File diff suppressed because it is too large Load Diff

1727
src/octopower Executable file

File diff suppressed because it is too large Load Diff