Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed support OSes and Fixed scripts, etc #34

Merged
merged 1 commit into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/build_helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1350,7 +1350,7 @@ if [ "${RUN_SHELLCHECK}" -eq 1 ]; then
# Fedora
#
if ({ RUNCMD "${INSTALLER_BIN}" "${INSTALL_CMD}" "${INSTALL_CMD_ARG}" "${INSTALL_AUTO_ARG}" ShellCheck || echo > "${PIPEFAILURE_FILE}"; } | sed -e 's/^/ /g') && rm "${PIPEFAILURE_FILE}" >/dev/null 2>&1; then
PRNERR "Failed to install cppcheck"
PRNERR "Failed to install shellcheck"
exit 1
fi

Expand All @@ -1377,7 +1377,7 @@ if [ "${RUN_SHELLCHECK}" -eq 1 ]; then
# Ubuntu or Debian
#
if ({ RUNCMD "${INSTALLER_BIN}" "${INSTALL_CMD}" "${INSTALL_CMD_ARG}" "${INSTALL_AUTO_ARG}" shellcheck || echo > "${PIPEFAILURE_FILE}"; } | sed -e 's/^/ /g') && rm "${PIPEFAILURE_FILE}" >/dev/null 2>&1; then
PRNERR "Failed to install cppcheck"
PRNERR "Failed to install shellcheck"
exit 1
fi

Expand All @@ -1386,7 +1386,7 @@ if [ "${RUN_SHELLCHECK}" -eq 1 ]; then
# Alpine
#
if ({ RUNCMD "${INSTALLER_BIN}" "${INSTALL_CMD}" "${INSTALL_CMD_ARG}" "${INSTALL_AUTO_ARG}" shellcheck || echo > "${PIPEFAILURE_FILE}"; } | sed -e 's/^/ /g') && rm "${PIPEFAILURE_FILE}" >/dev/null 2>&1; then
PRNERR "Failed to install cppcheck"
PRNERR "Failed to install shellcheck"
exit 1
fi

Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,15 @@ jobs:
container:
- ubuntu:24.04
- ubuntu:22.04
- ubuntu:20.04
- debian:bookworm
- debian:bullseye
- rockylinux:9
- rockylinux:8
- fedora:41
- fedora:40
- alpine:3.21
- alpine:3.20
- alpine:3.19
- alpine:3.18

container:
image: ${{ matrix.container }}
Expand Down
26 changes: 6 additions & 20 deletions .github/workflows/ostypevars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,20 +115,6 @@ elif echo "${CI_OSTYPE}" | grep -q -i -e "ubuntu:22.04" -e "ubuntu:jammy"; then
PKG_EXT="deb"
IS_OS_UBUNTU=1

elif echo "${CI_OSTYPE}" | grep -q -i -e "ubuntu:20.04" -e "ubuntu:focal"; then
DIST_TAG="ubuntu/focal"
INSTALL_PKG_LIST="git autoconf autotools-dev make dh-make fakeroot dpkg-dev devscripts pkg-config ruby-dev rubygems rubygems-integration procps dh-systemd"
INSTALLER_BIN="apt-get"
UPDATE_CMD="update"
UPDATE_CMD_ARG=""
INSTALL_CMD="install"
INSTALL_CMD_ARG=""
INSTALL_AUTO_ARG="-y"
INSTALL_QUIET_ARG="-qq"
PKG_OUTPUT_DIR="debian_build"
PKG_EXT="deb"
IS_OS_UBUNTU=1

elif echo "${CI_OSTYPE}" | grep -q -i -e "debian:12" -e "debian:bookworm"; then
DIST_TAG="debian/bookworm"
INSTALL_PKG_LIST="git autoconf autotools-dev make dh-make fakeroot dpkg-dev devscripts pkg-config ruby-dev rubygems rubygems-integration procps"
Expand Down Expand Up @@ -213,8 +199,8 @@ elif echo "${CI_OSTYPE}" | grep -q -i "fedora:40"; then
PKG_EXT="rpm"
IS_OS_FEDORA=1

elif echo "${CI_OSTYPE}" | grep -q -i "alpine:3.20"; then
DIST_TAG="alpine/v3.20"
elif echo "${CI_OSTYPE}" | grep -q -i "alpine:3.21"; then
DIST_TAG="alpine/v3.21"
INSTALL_PKG_LIST="bash sudo alpine-sdk automake autoconf musl-locales ruby-dev procps"
INSTALLER_BIN="apk"
UPDATE_CMD="update"
Expand All @@ -227,8 +213,8 @@ elif echo "${CI_OSTYPE}" | grep -q -i "alpine:3.20"; then
PKG_EXT="apk"
IS_OS_ALPINE=1

elif echo "${CI_OSTYPE}" | grep -q -i "alpine:3.19"; then
DIST_TAG="alpine/v3.19"
elif echo "${CI_OSTYPE}" | grep -q -i "alpine:3.20"; then
DIST_TAG="alpine/v3.20"
INSTALL_PKG_LIST="bash sudo alpine-sdk automake autoconf musl-locales ruby-dev procps"
INSTALLER_BIN="apk"
UPDATE_CMD="update"
Expand All @@ -241,8 +227,8 @@ elif echo "${CI_OSTYPE}" | grep -q -i "alpine:3.19"; then
PKG_EXT="apk"
IS_OS_ALPINE=1

elif echo "${CI_OSTYPE}" | grep -q -i "alpine:3.18"; then
DIST_TAG="alpine/v3.18"
elif echo "${CI_OSTYPE}" | grep -q -i "alpine:3.19"; then
DIST_TAG="alpine/v3.19"
INSTALL_PKG_LIST="bash sudo alpine-sdk automake autoconf musl-locales ruby-dev procps"
INSTALLER_BIN="apk"
UPDATE_CMD="update"
Expand Down
2 changes: 1 addition & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

Wrote from scratch the initial version of k2hr3-get-resource.

3. Hirotaka Wakabayashi <hiwakaba@yahoo-corp.jp>
2. Hirotaka Wakabayashi <hiwakaba@lycorp.co.jp>

Technical engineer of k2hr3-get-resource product.
65 changes: 34 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ K2HR3 Get Resource(K2HR3 Utilities)
[![GitHub forks](https://img.shields.io/github/forks/yahoojapan/k2hr3_get_resource.svg)](https://github.com/yahoojapan/k2hr3_get_resource/network)
[![GitHub stars](https://img.shields.io/github/stars/yahoojapan/k2hr3_get_resource.svg)](https://github.com/yahoojapan/k2hr3_get_resource/stargazers)
[![GitHub issues](https://img.shields.io/github/issues/yahoojapan/k2hr3_get_resource.svg)](https://github.com/yahoojapan/k2hr3_get_resource/issues)
[![debian packages](https://img.shields.io/badge/deb-packagecloud.io-844fec.svg)](https://packagecloud.io/antpickax/stable)
[![RPM packages](https://img.shields.io/badge/rpm-packagecloud.io-844fec.svg)](https://packagecloud.io/antpickax/stable)
[![debian packages](https://img.shields.io/badge/deb-packagecloud.io-844fec.svg)](https://packagecloud.io/antpickax/stable)
[![ALPINE packages](https://img.shields.io/badge/apk-packagecloud.io-844fec.svg)](https://packagecloud.io/antpickax/stable)

### **K2HR3** - **K2H**dkc based **R**esource and **R**oles and policy **R**ules

Expand Down Expand Up @@ -35,40 +36,42 @@ K2HR3 Get Resource is a Systemd Timer Service for retrieving RESOURCE data from
- Use the common directory /etc/antpickax.

### Documents
[K2HR3 Document](https://k2hr3.antpick.ax/index.html)
[K2HR3 Web Application Usage](https://k2hr3.antpick.ax/usage_app.html)
[K2HR3 Command Line Interface Usage](https://k2hr3.antpick.ax/cli.html)
[K2HR3 REST API Usage](https://k2hr3.antpick.ax/api.html)
[K2HR3 OpenStack Notification Listener Usage](https://k2hr3.antpick.ax/detail_osnl.html)
[K2HR3 Watcher Usage](https://k2hr3.antpick.ax/tools.html)
[K2HR3 Get Resource Usage](https://k2hr3.antpick.ax/tools.html)
[K2HR3 Utilities for Setup](https://k2hr3.antpick.ax/setup.html)
[K2HR3 Demonstration](https://demo.k2hr3.antpick.ax/)

[About k2hdkc](https://k2hdkc.antpick.ax/)
[About k2hash](https://k2hash.antpick.ax/)
[About chmpx](https://chmpx.antpick.ax/)
[About k2hash transaction plugin](https://k2htpdtor.antpick.ax/)

[About AntPickax](https://antpick.ax/)
- [K2HR3 Document](https://k2hr3.antpick.ax/index.html)
- [K2HR3 Web Application Usage](https://k2hr3.antpick.ax/usage_app.html)
- [K2HR3 Command Line Interface Usage](https://k2hr3.antpick.ax/cli.html)
- [K2HR3 REST API Usage](https://k2hr3.antpick.ax/api.html)
- [K2HR3 OpenStack Notification Listener Usage](https://k2hr3.antpick.ax/detail_osnl.html)
- [K2HR3 Watcher Usage](https://k2hr3.antpick.ax/tools.html)
- [K2HR3 Get Resource Usage](https://k2hr3.antpick.ax/tools.html)
- [K2HR3 Utilities for Setup](https://k2hr3.antpick.ax/setup.html)
- [K2HR3 Demonstration](https://demo.k2hr3.antpick.ax/)

- [About k2hdkc](https://k2hdkc.antpick.ax/)
- [About k2hash](https://k2hash.antpick.ax/)
- [About chmpx](https://chmpx.antpick.ax/)
- [About k2hash transaction plugin](https://k2htpdtor.antpick.ax/)

- [About AntPickax](https://antpick.ax/)

### Repositories
[K2HR3 main repository](https://github.com/yahoojapan/k2hr3)
[K2HR3 Web Application repository](https://github.com/yahoojapan/k2hr3_app)
[K2HR3 Command Line Interface repository](https://github.com/yahoojapan/k2hr3_cli)
[K2HR3 REST API repository](https://github.com/yahoojapan/k2hr3_api)
[K2HR3 OpenStack Notification Listener](https://github.com/yahoojapan/k2hr3_osnl)
[K2HR3 Utilities](https://github.com/yahoojapan/k2hr3_utils)
[K2HR3 Container Registration Sidecar](https://github.com/yahoojapan/k2hr3_sidecar)
[K2HR3 Get Resource](https://github.com/yahoojapan/k2hr3_get_resource)

[k2hdkc](https://github.com/yahoojapan/k2hdkc)
[k2hash](https://github.com/yahoojapan/k2hash)
[chmpx](https://github.com/yahoojapan/chmpx)
[k2hash transaction plugin](https://github.com/yahoojapan/k2htp_dtor)
- [K2HR3 main repository](https://github.com/yahoojapan/k2hr3)
- [K2HR3 Web Application repository](https://github.com/yahoojapan/k2hr3_app)
- [K2HR3 Command Line Interface repository](https://github.com/yahoojapan/k2hr3_cli)
- [K2HR3 REST API repository](https://github.com/yahoojapan/k2hr3_api)
- [K2HR3 OpenStack Notification Listener](https://github.com/yahoojapan/k2hr3_osnl)
- [K2HR3 Get Resource](https://github.com/yahoojapan/k2hr3_get_resource)
- [K2HR3 Utilities](https://github.com/yahoojapan/k2hr3_utils)
- [K2HR3 Container Registration Sidecar](https://github.com/yahoojapan/k2hr3_sidecar)

- [k2hdkc](https://github.com/yahoojapan/k2hdkc)
- [k2hash](https://github.com/yahoojapan/k2hash)
- [chmpx](https://github.com/yahoojapan/chmpx)
- [k2hash transaction plugin](https://github.com/yahoojapan/k2htp_dtor)

### Packages
[k2hr3-get-resource(packages)](https://packagecloud.io/app/antpickax/stable/search?q=k2hr3-get-resource)
- [RPM packages(packagecloud.io)](https://packagecloud.io/app/antpickax/stable/search?q=k2hr3-get-resource&filter=rpm&dist=&arch=)
- [Debian packages(packagecloud.io)](https://packagecloud.io/app/antpickax/stable/search?q=k2hr3-get-resource&filter=deb&dist=&arch=)
- [ALPINE packages(packagecloud.io)](https://packagecloud.io/app/antpickax/stable/search?q=k2hr3-get-resource&filter=all&dist=alpine&arch=)

### License
This software is released under the MIT License, see the license file.
Expand Down
8 changes: 4 additions & 4 deletions autogen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,18 @@ while [ $# -ne 0 ]; do
echo "[ERROR] Parameters are something wrong."
exit 1

elif [ "$1" = "-h" ] || [ "$1" = "-H" ] || [ "$1" = "--help" ] || [ "$1" = "--HELP" ]; then
elif echo "$1" | grep -q -i -e "^-h$" -e "^--help$"; then
echo "Usage: ${AUTOGEN_NAME} [--help(-h)] [--no_update_version_file(-nu)] [--no_aclocal_force(-na)] [--no_check_ver_diff(-nc)]"
exit 0

elif [ "$1" = "-nu" ] || [ "$1" = "-NU" ] || [ "$1" = "--no_update_version_file" ] || [ "$1" = "--NO_UPDATE_VERSION_FILE" ]; then
elif echo "$1" | grep -q -i -e "^-nu$" -e "^--no_update_version_file$"; then
UPDATE_VERSION_FILE=0
FORCEPARAM="" # do not need force

elif [ "$1" = "-na" ] || [ "$1" = "-NA" ] || [ "$1" = "--no_aclocal_force" ] || [ "$1" = "--NO_ACLOCAL_FORCE" ]; then
elif echo "$1" | grep -q -i -e "^-na$" -e "^--no_aclocal_force$"; then
FORCEPARAM=""

elif [ "$1" = "-nc" ] || [ "$1" = "-NC" ] || [ "$1" = "--no_check_ver_diff" ] || [ "$1" = "--NO_CHECK_VER_DIFF" ]; then
elif echo "$1" | grep -q -i -e "^-nc$" -e "^--no_check_ver_diff$"; then
PARAMETERS="$1"

else
Expand Down
8 changes: 4 additions & 4 deletions buildutils/alpine_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ while [ $# -ne 0 ]; do
if [ -z "$1" ]; then
break

elif [ "$1" = "-h" ] || [ "$1" = "-H" ] || [ "$1" = "--help" ] || [ "$1" = "--HELP" ]; then
elif echo "$1" | grep -q -i -e "^-h$" -e "^--help$"; then
func_usage "${PRGNAME}"
exit 0

elif [ "$1" = "-b" ] || [ "$1" = "-B" ] || [ "$1" = "--buildnum" ] || [ "$1" = "--BUILDNUM" ]; then
elif echo "$1" | grep -q -i -e "^-b$" -e "^--buildnum$"; then
if [ -n "${BUILD_NUMBER}" ]; then
echo "[ERROR] Already --buildnum(-b) option is specified(${BUILD_NUMBER})." 1>&2
exit 1
Expand All @@ -119,7 +119,7 @@ while [ $# -ne 0 ]; do
fi
BUILD_NUMBER="$1"

elif [ "$1" = "-p" ] || [ "$1" = "-P" ] || [ "$1" = "--product" ] || [ "$1" = "--PRODUCT" ]; then
elif echo "$1" | grep -q -i -e "^-p$" -e "^--product$"; then
if [ -n "${PACKAGE_NAME}" ]; then
echo "[ERROR] Already --product(-p) option is specified(${PACKAGE_NAME})." 1>&2
exit 1
Expand All @@ -131,7 +131,7 @@ while [ $# -ne 0 ]; do
fi
PACKAGE_NAME="$1"

elif [ "$1" = "-y" ] || [ "$1" = "-Y" ] || [ "$1" = "--yes" ] || [ "$1" = "--YES" ]; then
elif echo "$1" | grep -q -i -e "^-y$" -e "^--yes$"; then
if [ "${NO_INTERACTIVE}" -ne 0 ]; then
echo "[ERROR] Already --yes(-y) option is specified." 1>&2
exit 1
Expand Down
18 changes: 9 additions & 9 deletions buildutils/debian_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ while [ $# -ne 0 ]; do
if [ -z "$1" ]; then
break

elif [ "$1" = "-h" ] || [ "$1" = "-H" ] || [ "$1" = "--help" ] || [ "$1" = "--HELP" ]; then
elif echo "$1" | grep -q -i -e "^-h$" -e "^--help$"; then
func_usage "${PRGNAME}"
exit 0

elif [ "$1" = "-b" ] || [ "$1" = "-B" ] || [ "$1" = "--buildnum" ] || [ "$1" = "--BUILDNUM" ]; then
elif echo "$1" | grep -q -i -e "^-b$" -e "^--buildnum$"; then
if [ "${BUILD_NUMBER}" -ne 0 ]; then
echo "[ERROR] Already --buildnum(-b) option is specified(${BUILD_NUMBER})." 1>&2
exit 1
Expand All @@ -128,7 +128,7 @@ while [ $# -ne 0 ]; do
fi
BUILD_NUMBER="$1"

elif [ "$1" = "-p" ] || [ "$1" = "-P" ] || [ "$1" = "--product" ] || [ "$1" = "--PRODUCT" ]; then
elif echo "$1" | grep -q -i -e "^-p$" -e "^--product$"; then
if [ -n "${PACKAGE_NAME}" ]; then
echo "[ERROR] Already --product(-p) option is specified(${PACKAGE_NAME})." 1>&2
exit 1
Expand All @@ -140,7 +140,7 @@ while [ $# -ne 0 ]; do
fi
PACKAGE_NAME="$1"

elif [ "$1" = "-c" ] || [ "$1" = "-C" ] || [ "$1" = "--class" ] || [ "$1" = "--CLASS" ]; then
elif echo "$1" | grep -q -i -e "^-c$" -e "^--class$"; then
if [ -n "${PKG_CLASS_NAME}" ]; then
echo "[ERROR] Already --class(-c) option is specified(${PKG_CLASS_NAME})." 1>&2
exit 1
Expand All @@ -152,7 +152,7 @@ while [ $# -ne 0 ]; do
fi
PKG_CLASS_NAME="$1"

elif [ "$1" = "-dt" ] || [ "$1" = "-DT" ] || [ "$1" = "--disttype" ] || [ "$1" = "--DISTTYPE" ]; then
elif echo "$1" | grep -q -i -e "^-dt$" -e "^--disttype$"; then
if [ -n "${OS_VERSION_NAME}" ]; then
echo "[ERROR] Already --disttype(-dt) option is specified(${OS_VERSION_NAME})." 1>&2
exit 1
Expand All @@ -164,14 +164,14 @@ while [ $# -ne 0 ]; do
fi
OS_VERSION_NAME="$1"

elif [ "$1" = "-r" ] || [ "$1" = "-R" ] || [ "$1" = "--rootdir" ] || [ "$1" = "--ROOTDIR" ]; then
elif echo "$1" | grep -q -i -e "^-r$" -e "^--rootdir$"; then
if [ "${IS_ROOTDIR}" -ne 0 ]; then
echo "[ERROR] Already --rootdir(-r) option is specified." 1>&2
exit 1
fi
IS_ROOTDIR=1

elif [ "$1" = "-y" ] || [ "$1" = "-Y" ] || [ "$1" = "--yes" ] || [ "$1" = "--YES" ]; then
elif echo "$1" | grep -q -i -e "^-y$" -e "^--yes$"; then
if [ "${NO_INTERACTIVE}" -ne 0 ]; then
echo "[ERROR] Already --yes(-y) option is specified." 1>&2
exit 1
Expand Down Expand Up @@ -255,9 +255,9 @@ if [ "${NO_INTERACTIVE}" -eq 0 ]; then
printf '[INPUT] Confirm (y/n) : '
read -r CONFIRM

if [ "${CONFIRM}" = "y" ] || [ "${CONFIRM}" = "Y" ] || [ "${CONFIRM}" = "yes" ] || [ "${CONFIRM}" = "YES" ]; then
if echo "${CONFIRM}" | grep -q -i -e "^y$" -e "^yes$"; then
IS_CONFIRMED=1
elif [ "${CONFIRM}" = "n" ] || [ "${CONFIRM}" = "N" ] || [ "${CONFIRM}" = "no" ] || [ "${CONFIRM}" = "NO" ]; then
elif echo "${CONFIRM}" | grep -q -i -e "^n$" -e "^no$"; then
echo "Interrupt this processing, bye..."
exit 0
fi
Expand Down
10 changes: 5 additions & 5 deletions buildutils/make_release_version_file.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,31 +68,31 @@ while [ $# -ne 0 ]; do
if [ -z "$1" ]; then
break

elif [ "$1" = "-h" ] || [ "$1" = "-H" ] || [ "$1" = "--help" ] || [ "$1" = "--HELP" ]; then
elif echo "$1" | grep -q -i -e "^-h$" -e "^--help$"; then
func_usage "${PRGNAME}"
exit 0

elif [ "$1" = "-ng" ] || [ "$1" = "-NG" ] || [ "$1" = "--not_use_git" ] || [ "$1" = "--NOT_USE_GIT" ]; then
elif echo "$1" | grep -q -i -e "^-ng$" -e "^--not_use_git$"; then
if [ "${NOT_USE_GIT}" -ne 0 ]; then
echo "[ERROR] already --not_use_git(-ng) option is specified." 1>&2
exit 1
fi
NOT_USE_GIT=1

elif [ "$1" = "-nd" ] || [ "$1" = "-ND" ] || [ "$1" = "--no_check_ver_diff" ] || [ "$1" = "--NO_CHECK_VER_DIFF" ]; then
elif echo "$1" | grep -q -i -e "^-nd$" -e "^--no_check_ver_diff$"; then
if [ "${NO_CHECK_VER_DIFF}" -ne 0 ]; then
echo "[ERROR] already --no_check_ver_diff(-nd) option is specified." 1>&2
exit 1
fi
NO_CHECK_VER_DIFF=1

elif [ "$1" = "-f" ] || [ "$1" = "-F" ] || [ "$1" = "--file" ] || [ "$1" = "--FILE" ]; then
elif echo "$1" | grep -q -i -e "^-f$" -e "^--file$"; then
if [ -n "${CHANGELOG_FILE}" ]; then
echo "[ERROR] already --file(-f) option is specified(${CHANGELOG_FILE})." 1>&2
exit 1
fi
shift
if [ $# -eq 0 ] || [ -z "$1" ]; then
if [ $# -eq 0 ]; then
echo "[ERROR] Must set changelog file path after -file(-f) option." 1>&2
exit 1
fi
Expand Down
2 changes: 1 addition & 1 deletion buildutils/make_rpm_changelog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ while [ $# -ne 0 ]; do
if [ -z "$1" ]; then
break

elif [ "$1" = "-h" ] || [ "$1" = "-H" ] || [ "$1" = "--help" ] || [ "$1" = "--HELP" ]; then
elif echo "$1" | grep -q -i -e "^-h$" -e "^--help$"; then
func_usage "${PRGNAME}"
exit 0

Expand Down
Loading