forked from yahoojapan/k2hdkc_phpext
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed supported OS and PHP version and modified some codes
- Loading branch information
Takeshi Nakatani
committed
Nov 27, 2024
1 parent
61c7a4e
commit a5fcfc5
Showing
12 changed files
with
172 additions
and
774 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -532,7 +532,7 @@ run_pre_create_package() | |
run_create_package() | ||
{ | ||
if ! RUN_AS_SUBPROCESS="true" /bin/sh -c "${SWITCH_PHP_COMMAND} ${CREATE_PACKAGE_TOOL} ${CREATE_PACKAGE_TOOL_OPT_AUTO} --buildnum ${CI_BUILD_NUMBER} ${CREATE_PACKAGE_TOOL_OPT}"; then | ||
PRNERR "Failed to create debian type packages" | ||
PRNERR "Failed to create ${CI_OSTYPE} packages" | ||
return 1 | ||
fi | ||
return 0 | ||
|
@@ -828,12 +828,42 @@ if [ -n "${OPT_DEVELOPER_FULLNAME}" ]; then | |
CI_DEVELOPER_FULLNAME="${OPT_DEVELOPER_FULLNAME}" | ||
elif [ -n "${ENV_DEVELOPER_FULLNAME}" ]; then | ||
CI_DEVELOPER_FULLNAME="${ENV_DEVELOPER_FULLNAME}" | ||
else | ||
# [NOTE] | ||
# If this variable is not set in a project that uses configure, | ||
# an attempt will be made to load the value from configure.ac etc. | ||
# | ||
if [ -f "${SRCTOP}/configure.custom" ]; then | ||
CI_DEVELOPER_FULLNAME=$(grep '^[[:space:]]*DEB_NAME[[:space:]]*=' "${SRCTOP}/configure.custom" | sed -e 's|^[[:space:]]*DEB_NAME[[:space:]]*=[[:space:]]*||g' -e 's|^[[:space:]]*||g' -e 's|[[:space:]]*$||g') | ||
fi | ||
if [ -z "${CI_DEVELOPER_FULLNAME}" ] && [ -f "${SRCTOP}/config.m4" ]; then | ||
CI_DEVELOPER_FULLNAME=$(grep '^[[:space:]]*custom_dev_name[[:space:]]*=' "${SRCTOP}/config.m4" | grep -v 'DEB_NAME' | sed -e 's|^[[:space:]]*custom_dev_name[[:space:]]*=[[:space:]]*||g' -e 's|^[[:space:]]*||g' -e 's|[[:space:]]*$||g' -e 's|"||g') | ||
fi | ||
if [ -z "${CI_DEVELOPER_FULLNAME}" ]; then | ||
PRNWARN "DEVELOPER_FULLNAME is not set in the options or environment variables. There is no choice but to set the default value." | ||
CI_DEVELOPER_FULLNAME="ANTPICKAX_DEVELOPER" | ||
fi | ||
fi | ||
|
||
if [ -n "${OPT_DEVELOPER_EMAIL}" ]; then | ||
CI_DEVELOPER_EMAIL="${OPT_DEVELOPER_EMAIL}" | ||
elif [ -n "${ENV_DEVELOPER_EMAIL}" ]; then | ||
CI_DEVELOPER_EMAIL="${ENV_DEVELOPER_EMAIL}" | ||
else | ||
# [NOTE] | ||
# If this variable is not set in a project that uses configure, | ||
# an attempt will be made to load the value from configure.ac etc. | ||
# | ||
if [ -f "${SRCTOP}/configure.custom" ]; then | ||
CI_DEVELOPER_EMAIL=$(grep '^[[:space:]]*DEV_EMAIL[[:space:]]*=' "${SRCTOP}/configure.custom" | sed -e 's|^[[:space:]]*DEV_EMAIL[[:space:]]*=[[:space:]]*||g' -e 's|^[[:space:]]*||g' -e 's|[[:space:]]*$||g') | ||
fi | ||
if [ -z "${CI_DEVELOPER_EMAIL}" ] && [ -f "${SRCTOP}/config.m4" ]; then | ||
CI_DEVELOPER_EMAIL=$(grep '^[[:space:]]*custom_dev_email[[:space:]]*=' "${SRCTOP}/config.m4" | grep -v 'DEV_EMAIL' | sed -e 's|^[[:space:]]*custom_dev_email[[:space:]]*=[[:space:]]*||g' -e 's|^[[:space:]]*||g' -e 's|[[:space:]]*$||g' -e 's|"||g') | ||
fi | ||
if [ -z "${CI_DEVELOPER_EMAIL}" ]; then | ||
PRNWARN "DEVELOPER_EMAIL is not set in the options or environment variables. There is no choice but to set the default value." | ||
CI_DEVELOPER_EMAIL="[email protected]" | ||
fi | ||
fi | ||
|
||
if [ -n "${OPT_FORCE_PUBLISH}" ]; then | ||
|
@@ -901,13 +931,19 @@ elif [ -n "${ENV_PACKAGECLOUD_DOWNLOAD_REPO}" ]; then | |
fi | ||
|
||
# | ||
# Set environments for debian package | ||
# Set environments for debian/alpine package | ||
# | ||
if [ -n "${CI_DEVELOPER_FULLNAME}" ]; then | ||
export DEBEMAIL="${CI_DEVELOPER_FULLNAME}" | ||
export DEBFULLNAME="${CI_DEVELOPER_FULLNAME}" | ||
else | ||
PRNERR "\"CI_DEVELOPER_FULLNAME\" value is not set." | ||
exit 1 | ||
fi | ||
if [ -n "${CI_DEVELOPER_EMAIL}" ]; then | ||
export DEBFULLNAME="${CI_DEVELOPER_EMAIL}" | ||
export DEBEMAIL="${CI_DEVELOPER_EMAIL}" | ||
else | ||
PRNERR "\"CI_DEVELOPER_EMAIL\" value is not set." | ||
exit 1 | ||
fi | ||
|
||
# [NOTE] for ubuntu/debian | ||
|
@@ -1013,12 +1049,6 @@ elif [ "${IS_OS_DEBIAN}" -eq 1 ]; then | |
CREATE_PACKAGE_TOOL="${CREATE_PACKAGE_TOOL_DEBIAN}" | ||
CREATE_PACKAGE_TOOL_OPT="${CREATE_PACKAGE_TOOL_OPT_DEBIAN}" | ||
|
||
elif [ "${IS_OS_CENTOS}" -eq 1 ]; then | ||
BUILD_MAKE_EXT_OPT="${BUILD_MAKE_EXT_OPT_DEBIAN}" | ||
MAKE_TEST_OPT="${MAKE_TEST_OPT_DEBIAN}" | ||
CREATE_PACKAGE_TOOL="${CREATE_PACKAGE_TOOL_RPM}" | ||
CREATE_PACKAGE_TOOL_OPT="${CREATE_PACKAGE_TOOL_OPT_RPM}" | ||
|
||
elif [ "${IS_OS_FEDORA}" -eq 1 ]; then | ||
BUILD_MAKE_EXT_OPT="${BUILD_MAKE_EXT_OPT_RPM}" | ||
MAKE_TEST_OPT="${MAKE_TEST_OPT_RPM}" | ||
|
@@ -1160,7 +1190,6 @@ echo " SWITCH_PHP_COMMAND = ${SWITCH_PHP_COMMAND}" | |
echo "" | ||
echo " IS_OS_UBUNTU = ${IS_OS_UBUNTU}" | ||
echo " IS_OS_DEBIAN = ${IS_OS_DEBIAN}" | ||
echo " IS_OS_CENTOS = ${IS_OS_CENTOS}" | ||
echo " IS_OS_FEDORA = ${IS_OS_FEDORA}" | ||
echo " IS_OS_ROCKY = ${IS_OS_ROCKY}" | ||
echo " IS_OS_ALPINE = ${IS_OS_ALPINE}" | ||
|
@@ -1227,7 +1256,7 @@ if [ "${CI_USE_PACKAGECLOUD_REPO}" -eq 1 ]; then | |
# | ||
# Setup packagecloud.io repository | ||
# | ||
if [ "${IS_OS_CENTOS}" -eq 1 ] || [ "${IS_OS_FEDORA}" -eq 1 ] || [ "${IS_OS_ROCKY}" -eq 1 ]; then | ||
if [ "${IS_OS_FEDORA}" -eq 1 ] || [ "${IS_OS_ROCKY}" -eq 1 ]; then | ||
PC_REPO_ADD_SH="script.rpm.sh" | ||
PC_REPO_ADD_SH_RUN="bash" | ||
elif [ "${IS_OS_UBUNTU}" -eq 1 ] || [ "${IS_OS_DEBIAN}" -eq 1 ]; then | ||
|
@@ -1247,7 +1276,7 @@ if [ "${CI_USE_PACKAGECLOUD_REPO}" -eq 1 ]; then | |
exit 1 | ||
fi | ||
else | ||
PRNWARN "OS is not debian/ubuntu nor centos/fedora/rocky nor alpine, then we do not know which download script use. Thus skip to setup packagecloud.io repository." | ||
PRNWARN "OS is not debian/ubuntu nor fedora/rocky nor alpine, then we do not know which download script use. Thus skip to setup packagecloud.io repository." | ||
fi | ||
else | ||
PRNINFO "Not set packagecloud.io repository." | ||
|
@@ -1278,7 +1307,7 @@ PRNTITLE "Add PHP repositories" | |
|
||
if [ -n "${INSTALL_PHP_REPO}" ]; then | ||
PRNINFO "PHP repositories" | ||
if [ "${IS_OS_CENTOS}" -eq 1 ] || [ "${IS_OS_ROCKY}" -eq 1 ] || [ "${IS_OS_FEDORA}" -eq 1 ]; then | ||
if [ "${IS_OS_ROCKY}" -eq 1 ] || [ "${IS_OS_FEDORA}" -eq 1 ]; then | ||
if ({ RUNCMD "${INSTALLER_BIN}" "${INSTALL_CMD}" "${INSTALL_CMD_ARG}" "${INSTALL_AUTO_ARG}" "${INSTALL_QUIET_ARG}" "${INSTALL_PHP_REPO}" || echo > "${PIPEFAILURE_FILE}"; } | sed -e 's/^/ /g') && rm "${PIPEFAILURE_FILE}" >/dev/null 2>&1; then | ||
PRNERR "Failed to add PHP repository." | ||
exit 1 | ||
|
@@ -1414,28 +1443,7 @@ if [ "${CI_DO_PUBLISH}" -eq 1 ]; then | |
GEM_BIN="gem" | ||
GEM_INSTALL_CMD="install" | ||
|
||
if [ "${IS_OS_CENTOS}" -eq 1 ] && echo "${CI_OSTYPE}" | sed -e 's#:##g' | grep -q -i -e 'centos7' -e 'centos6'; then | ||
# | ||
# Case for CentOS | ||
# | ||
PRNWARN "OS is CentOS 7(6), so install ruby by special means(SCL)." | ||
|
||
if ({ RUNCMD "${INSTALLER_BIN}" "${INSTALL_CMD}" "${INSTALL_CMD_ARG}" "${INSTALL_AUTO_ARG}" "${INSTALL_QUIET_ARG}" centos-release-scl || echo > "${PIPEFAILURE_FILE}"; } | sed -e 's/^/ /g') && rm "${PIPEFAILURE_FILE}" >/dev/null 2>&1; then | ||
PRNERR "Failed to install SCL packages" | ||
exit 1 | ||
fi | ||
if ({ RUNCMD "${INSTALLER_BIN}" "${INSTALL_CMD}" "${INSTALL_CMD_ARG}" "${INSTALL_AUTO_ARG}" "${INSTALL_QUIET_ARG}" rh-ruby27 rh-ruby27-ruby-devel rh-ruby27-rubygem-rake || echo > "${PIPEFAILURE_FILE}"; } | sed -e 's/^/ /g') && rm "${PIPEFAILURE_FILE}" >/dev/null 2>&1; then | ||
PRNERR "Failed to install ruby packages" | ||
exit 1 | ||
fi | ||
. /opt/rh/rh-ruby27/enable | ||
|
||
if ({ RUNCMD "${GEM_BIN}" "${GEM_INSTALL_CMD}" package_cloud || echo > "${PIPEFAILURE_FILE}"; } | sed -e 's/^/ /g') && rm "${PIPEFAILURE_FILE}" >/dev/null 2>&1; then | ||
PRNERR "Failed to install packagecloud.io upload tools" | ||
exit 1 | ||
fi | ||
|
||
elif [ "${IS_OS_ALPINE}" -eq 1 ]; then | ||
if [ "${IS_OS_ALPINE}" -eq 1 ]; then | ||
# | ||
# Case for Alpine | ||
# | ||
|
@@ -1565,7 +1573,7 @@ if [ "${CI_DO_PUBLISH}" -eq 1 ]; then | |
|
||
else | ||
# | ||
# Case for other than CentOS / Alpine / Debian 10 / Rocky Linux 8 | ||
# Case for other than Alpine / Debian 10 / Rocky Linux 8 | ||
# | ||
if ({ RUNCMD "${GEM_BIN}" "${GEM_INSTALL_CMD}" rake package_cloud || echo > "${PIPEFAILURE_FILE}"; } | sed -e 's/^/ /g') && rm "${PIPEFAILURE_FILE}" >/dev/null 2>&1; then | ||
PRNERR "Failed to install packagecloud.io upload tools" | ||
|
@@ -1582,29 +1590,10 @@ PRNSUCCESS "Install published tools for uploading packages to packagecloud.io" | |
#-------------------------------------------------------------- | ||
PRNTITLE "Install cppcheck" | ||
|
||
IS_SET_ANOTHER_REPOSITORIES=0 | ||
if [ "${RUN_CPPCHECK}" -eq 1 ]; then | ||
PRNINFO "Install cppcheck package." | ||
|
||
if [ "${IS_OS_CENTOS}" -eq 1 ]; then | ||
# | ||
# CentOS | ||
# | ||
if ({ RUNCMD "${INSTALLER_BIN}" "${INSTALL_CMD}" "${INSTALL_CMD_ARG}" "${INSTALL_AUTO_ARG}" epel-release || echo > "${PIPEFAILURE_FILE}"; } | sed -e 's/^/ /g') && rm "${PIPEFAILURE_FILE}" >/dev/null 2>&1; then | ||
PRNERR "Failed to install epel repository" | ||
exit 1 | ||
fi | ||
if ({ RUNCMD yum-config-manager --disable epel || echo > "${PIPEFAILURE_FILE}"; } | sed -e 's/^/ /g') && rm "${PIPEFAILURE_FILE}" >/dev/null 2>&1; then | ||
PRNERR "Failed to disable epel repository" | ||
exit 1 | ||
fi | ||
if ({ RUNCMD "${INSTALLER_BIN}" --enablerepo=epel "${INSTALL_CMD}" "${INSTALL_CMD_ARG}" "${INSTALL_AUTO_ARG}" cppcheck || echo > "${PIPEFAILURE_FILE}"; } | sed -e 's/^/ /g') && rm "${PIPEFAILURE_FILE}" >/dev/null 2>&1; then | ||
PRNERR "Failed to install cppcheck from epel repository" | ||
exit 1 | ||
fi | ||
IS_SET_ANOTHER_REPOSITORIES=1 | ||
|
||
elif [ "${IS_OS_FEDORA}" -eq 1 ]; then | ||
if [ "${IS_OS_FEDORA}" -eq 1 ]; then | ||
# | ||
# Fedora | ||
# | ||
|
@@ -1647,7 +1636,6 @@ if [ "${RUN_CPPCHECK}" -eq 1 ]; then | |
PRNERR "Failed to install cppcheck" | ||
exit 1 | ||
fi | ||
IS_SET_ANOTHER_REPOSITORIES=1 | ||
|
||
elif [ "${IS_OS_UBUNTU}" -eq 1 ] || [ "${IS_OS_DEBIAN}" -eq 1 ]; then | ||
# | ||
|
@@ -1683,27 +1671,7 @@ PRNTITLE "Install shellcheck" | |
if [ "${RUN_SHELLCHECK}" -eq 1 ]; then | ||
PRNINFO "Install shellcheck package." | ||
|
||
if [ "${IS_OS_CENTOS}" -eq 1 ]; then | ||
# | ||
# CentOS | ||
# | ||
if [ "${IS_SET_ANOTHER_REPOSITORIES}" -eq 0 ]; then | ||
if ({ RUNCMD "${INSTALLER_BIN}" "${INSTALL_CMD}" "${INSTALL_CMD_ARG}" "${INSTALL_AUTO_ARG}" epel-release || echo > "${PIPEFAILURE_FILE}"; } | sed -e 's/^/ /g') && rm "${PIPEFAILURE_FILE}" >/dev/null 2>&1; then | ||
PRNERR "Failed to install epel repository" | ||
exit 1 | ||
fi | ||
if ({ RUNCMD yum-config-manager --disable epel || echo > "${PIPEFAILURE_FILE}"; } | sed -e 's/^/ /g') && rm "${PIPEFAILURE_FILE}" >/dev/null 2>&1; then | ||
PRNERR "Failed to disable epel repository" | ||
exit 1 | ||
fi | ||
IS_SET_ANOTHER_REPOSITORIES=1 | ||
fi | ||
if ({ RUNCMD "${INSTALLER_BIN}" --enablerepo=epel "${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 ShellCheck from epel repository" | ||
exit 1 | ||
fi | ||
|
||
elif [ "${IS_OS_FEDORA}" -eq 1 ]; then | ||
if [ "${IS_OS_FEDORA}" -eq 1 ]; then | ||
# | ||
# Fedora | ||
# | ||
|
Oops, something went wrong.