Compare commits

...

4 Commits

2 changed files with 18 additions and 9 deletions

View File

@ -1,7 +1,13 @@
# Octojpack - Easy Joomla Extension Packaging
<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
</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)
> 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

View File

@ -3,7 +3,7 @@
# Program name
PROGRAM_NAME="Octojpack"
PROGRAM_CODE="octojpack"
PROGRAM_VERSION="1.3.0"
PROGRAM_VERSION="1.3.2"
PROGRAM_V="1.3"
PROGRAM_URL="https://git.vdm.dev/octoleo/${PROGRAM_CODE}"
@ -249,7 +249,7 @@ function setValueFromJson() {
}
# Safely use eval to dynamically set the value
eval "$target_var"=\'"$value"\'
declare -g "$target_var"="$value"
}
# Get value from JSON
@ -795,10 +795,9 @@ function setPackageXml() {
_echo "[info] Setting the Package XML..."
# set the local version
local version
# remove all but numbers and points
# TODO we need to allow only stable versions (when getting the tags)
# shellcheck disable=SC2001
version=$(echo "${VDM_PACKAGE_VERSION:-1.0.0}" | sed 's/[^0-9.]//g')
# remove the v in front of the version (number-state-number)
version="${VDM_PACKAGE_VERSION:-1.0.0}"
version="${version/#v/}"
# add the package details
{
echo '<?xml version="1.0" encoding="utf-8"?>'
@ -1034,7 +1033,11 @@ function setRepository() {
# give little notice of progress
_echo "[info] Pushing (TO CREATE) changes to (${VDM_PACKAGE_OWNER}/${VDM_PACKAGE_REPO}) repository"
# push to creat the repository (if allowed)
git push -u origin master >/dev/null 2>&1 || return 30
if [[ "${VDM_PACKAGE_REPO_BRANCH}" == 'default' ]]; then
git push -u origin master >/dev/null 2>&1 || return 30
else
git push -u origin "${VDM_PACKAGE_REPO_BRANCH:-master}" >/dev/null 2>&1 || return 30
fi
git push --tags >/dev/null 2>&1 || return 30
fi
fi
@ -1051,7 +1054,7 @@ function getExistingRepository() {
git clone "ssh://git@${VDM_PACKAGE_URL}/${VDM_PACKAGE_OWNER}/${VDM_PACKAGE_REPO}.git" >/dev/null 2>&1 || return 23
else
# clone the existing repository
git clone -b "${VDM_PACKAGE_REPO_BRANCH}" "ssh://git@${VDM_PACKAGE_URL}/${VDM_PACKAGE_OWNER}/${VDM_PACKAGE_REPO}.git" >/dev/null 2>&1 || return 23
git clone -b "${VDM_PACKAGE_REPO_BRANCH:-master}" "ssh://git@${VDM_PACKAGE_URL}/${VDM_PACKAGE_OWNER}/${VDM_PACKAGE_REPO}.git" >/dev/null 2>&1 || return 23
fi
# success
return 0