From f0c7f5ecc936b44ad4851634ae7ef3e39eb4a40e Mon Sep 17 00:00:00 2001 From: Renato Rego Date: Thu, 1 Aug 2024 17:07:30 -0300 Subject: [PATCH 001/140] 2024.q2.7 --- bundles.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/bundles.yml b/bundles.yml index 1230c1fb8..b05bd1263 100644 --- a/bundles.yml +++ b/bundles.yml @@ -729,6 +729,7 @@ quarterly: 2024.q2.4: 2024.q2.5: 2024.q2.6: + 2024.q2.7: latest: true snapshot: snapshot-master: From a359fe21c1c38d40eda29360e1073dd82afeec2e Mon Sep 17 00:00:00 2001 From: Pedro Malta Date: Thu, 1 Aug 2024 08:48:36 -0300 Subject: [PATCH 002/140] LPD-30119 Add generate_javadocs function to the package release process --- release/_package.sh | 51 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/release/_package.sh b/release/_package.sh index dd6ce0441..bbadd407e 100644 --- a/release/_package.sh +++ b/release/_package.sh @@ -19,6 +19,55 @@ function generate_checksum_files { done } +function generate_javadocs { + if [[ "${_PRODUCT_VERSION}" != 7.3.*-ga* ]] && + [[ "${_PRODUCT_VERSION}" != 7.3.*-u* ]] && + [[ "${_PRODUCT_VERSION}" != 7.4.*-ga* ]] + then + lc_log INFO "Javadocs should not be generated for ${_PRODUCT_VERSION}." + + return "${LIFERAY_COMMON_EXIT_CODE_SKIPPED}" + fi + + lc_log INFO "Generating javadocs for ${_PRODUCT_VERSION}." + + git reset --hard && git clean -dfx + + git fetch --no-tags upstream "refs/tags/${_PRODUCT_VERSION}:refs/tags/${_PRODUCT_VERSION}" + + git checkout "tags/${_PRODUCT_VERSION}" + + local portal_release_edition_private="true" + + if [ "${LIFERAY_RELEASE_PRODUCT_NAME}" == "portal" ] + then + portal_release_edition_private="false" + fi + + local release_info_version="$(echo "${_PRODUCT_VERSION}" | cut -d '-' -f 1)" + + local service_pack_version_suffix="-$(echo "${_PRODUCT_VERSION}" | cut -d '-' -f 2)" + + ant \ + -Ddist.dir="${_BUILD_DIR}/release" \ + -Dliferay.product.name="liferay-${LIFERAY_RELEASE_PRODUCT_NAME}" \ + -Dlp.version="${_PRODUCT_VERSION}" \ + -Dpatch.doc="true" \ + -Dportal.dir="${_PROJECTS_DIR}/liferay-portal-ee" \ + -Dportal.release.edition.private="${portal_release_edition_private}" \ + -Drelease.info.version="${release_info_version}" \ + -Dservice.pack.version.suffix="${service_pack_version_suffix}" \ + -Dtstamp.value="${_BUILD_TIMESTAMP}" \ + -f "${_PROJECTS_DIR}/liferay-release-tool-ee/build-service-pack.xml" patch-doc + + if [ "${?}" -ne 0 ] + then + lc_log ERROR "Unable to generate the javadocs." + + return "${LIFERAY_COMMON_EXIT_CODE_BAD}" + fi +} + function generate_release_properties_file { local tomcat_version=$(grep -Eo "Apache Tomcat Version [0-9]+\.[0-9]+\.[0-9]+" "${_BUNDLES_DIR}/tomcat/RELEASE-NOTES") @@ -164,4 +213,6 @@ function package_release { rm -fr "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-sql" rm -fr "${_BUILD_DIR}/release/liferay-${LIFERAY_RELEASE_PRODUCT_NAME}" + + generate_javadocs } \ No newline at end of file From 9fd0785d3bbfefabf1766e69e4f9f20da49265b0 Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Mon, 5 Aug 2024 11:21:57 -0300 Subject: [PATCH 003/140] LPD-30119 Wordsmith --- release/_package.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/release/_package.sh b/release/_package.sh index bbadd407e..0b3e4b6f6 100644 --- a/release/_package.sh +++ b/release/_package.sh @@ -45,7 +45,6 @@ function generate_javadocs { fi local release_info_version="$(echo "${_PRODUCT_VERSION}" | cut -d '-' -f 1)" - local service_pack_version_suffix="-$(echo "${_PRODUCT_VERSION}" | cut -d '-' -f 2)" ant \ @@ -62,7 +61,7 @@ function generate_javadocs { if [ "${?}" -ne 0 ] then - lc_log ERROR "Unable to generate the javadocs." + lc_log ERROR "Unable to generate javadocs." return "${LIFERAY_COMMON_EXIT_CODE_BAD}" fi From 85dc5c5cf74e08d4fa938143435434d705fe6ff2 Mon Sep 17 00:00:00 2001 From: Pedro Malta Date: Tue, 23 Jul 2024 10:21:06 -0300 Subject: [PATCH 004/140] LPD-31859 Add prepare next release branch function --- release/release_gold.sh | 53 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/release/release_gold.sh b/release/release_gold.sh index 03431c2dc..00b90cd0b 100755 --- a/release/release_gold.sh +++ b/release/release_gold.sh @@ -98,6 +98,8 @@ function main { lc_time_run test_boms + lc_time_run prepare_next_release_branch + #lc_time_run upload_to_docker_hub } @@ -118,6 +120,57 @@ function print_help { exit "${LIFERAY_COMMON_EXIT_CODE_HELP}" } +function prepare_next_release_branch { + local latest_quarterly_product_version="$(yq ".quarterly | to_entries | .[] | select(.value.latest == true) | .key" "${BASE_DIR}/liferay-docker/bundles.yml")" + + if [ "${_PRODUCT_VERSION}" != "${latest_quarterly_product_version}" ] + then + lc_log INFO "The ${_PRODUCT_VERSION} version is not the latest quartely release. Skipping the preparetion of the next release branch." + + return "${LIFERAY_COMMON_EXIT_CODE_SKIPPED}" + fi + + lc_cd "${BASE_DIR}/liferay-portal-ee" + + git fetch upstream + + local base_project_version="$(echo "${_PRODUCT_VERSION}" | cut -d '.' -f 1,2)" + + local base_branch="release-${base_project_version}" + + if (git branch --list "${base_branch}") + then + git checkout "${base_branch}" + else + git checkout -b "${base_branch}" "upstream/${base_branch}" + fi + + git reset --hard "upstream/${base_branch}" + + local next_project_version_suffix="$(echo "${_PRODUCT_VERSION}" | cut -d '.' -f 3)" + + next_project_version_suffix=$((next_project_version_suffix + 1)) + + git checkout -b "${base_branch}.${next_project_version_suffix}" + + sed -e -i "s/${base_project_version^^}.[0-9]\+/${base_project_version^^}.${next_project_version_suffix}/" "${BASE_DIR}/liferay-portal-ee/release.properties" + + git add "${BASE_DIR}/liferay-portal-ee/release.properties" + + git commit -m "Prep next" + + git push upstream "${base_branch}.${next_project_version_suffix}" + + if [ "${?}" -ne 0 ] + then + lc_log ERROR "Unable to update the next release branch." + + return "${LIFERAY_COMMON_EXIT_CODE_BAD}" + else + lc_log INFO "The next release branch was updated successfully." + fi +} + function promote_boms { lc_time_run prepare_poms_for_promotion xanadu From bc25d252d4ffefc1647f37618397f915c6ab9f03 Mon Sep 17 00:00:00 2001 From: Renato Rego Date: Thu, 25 Jul 2024 13:41:19 -0300 Subject: [PATCH 005/140] LPD-31859 Wordsmith --- release/release_gold.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/release_gold.sh b/release/release_gold.sh index 00b90cd0b..c015e682f 100755 --- a/release/release_gold.sh +++ b/release/release_gold.sh @@ -125,7 +125,7 @@ function prepare_next_release_branch { if [ "${_PRODUCT_VERSION}" != "${latest_quarterly_product_version}" ] then - lc_log INFO "The ${_PRODUCT_VERSION} version is not the latest quartely release. Skipping the preparetion of the next release branch." + lc_log INFO "The ${_PRODUCT_VERSION} version is not the latest quartely release. Skipping the preparation of the next release branch." return "${LIFERAY_COMMON_EXIT_CODE_SKIPPED}" fi From 58b461765e5cad113e173dfd445ee7e5f52f2a57 Mon Sep 17 00:00:00 2001 From: Renato Rego Date: Thu, 25 Jul 2024 13:54:50 -0300 Subject: [PATCH 006/140] LPD-31859 Rename --- release/release_gold.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/release/release_gold.sh b/release/release_gold.sh index c015e682f..0686ec278 100755 --- a/release/release_gold.sh +++ b/release/release_gold.sh @@ -134,32 +134,32 @@ function prepare_next_release_branch { git fetch upstream - local base_project_version="$(echo "${_PRODUCT_VERSION}" | cut -d '.' -f 1,2)" + local product_group_version="$(echo "${_PRODUCT_VERSION}" | cut -d '.' -f 1,2)" - local base_branch="release-${base_project_version}" + local quarterly_release_branch="release-${product_group_version}" - if (git branch --list "${base_branch}") + if (git branch --list "${quarterly_release_branch}") then - git checkout "${base_branch}" + git checkout "${quarterly_release_branch}" else - git checkout -b "${base_branch}" "upstream/${base_branch}" + git checkout -b "${quarterly_release_branch}" "upstream/${quarterly_release_branch}" fi - git reset --hard "upstream/${base_branch}" + git reset --hard "upstream/${quarterly_release_branch}" local next_project_version_suffix="$(echo "${_PRODUCT_VERSION}" | cut -d '.' -f 3)" next_project_version_suffix=$((next_project_version_suffix + 1)) - git checkout -b "${base_branch}.${next_project_version_suffix}" + git checkout -b "${quarterly_release_branch}.${next_project_version_suffix}" - sed -e -i "s/${base_project_version^^}.[0-9]\+/${base_project_version^^}.${next_project_version_suffix}/" "${BASE_DIR}/liferay-portal-ee/release.properties" + sed -e -i "s/${product_group_version^^}.[0-9]\+/${product_group_version^^}.${next_project_version_suffix}/" "${BASE_DIR}/liferay-portal-ee/release.properties" git add "${BASE_DIR}/liferay-portal-ee/release.properties" git commit -m "Prep next" - git push upstream "${base_branch}.${next_project_version_suffix}" + git push upstream "${quarterly_release_branch}.${next_project_version_suffix}" if [ "${?}" -ne 0 ] then From b8cf2043cda86774a9ee34355fd571ad6d94a5d0 Mon Sep 17 00:00:00 2001 From: Renato Rego Date: Thu, 25 Jul 2024 14:10:07 -0300 Subject: [PATCH 007/140] LPD-31859 Optimize --- release/release_gold.sh | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/release/release_gold.sh b/release/release_gold.sh index 0686ec278..cc7ccd570 100755 --- a/release/release_gold.sh +++ b/release/release_gold.sh @@ -130,36 +130,29 @@ function prepare_next_release_branch { return "${LIFERAY_COMMON_EXIT_CODE_SKIPPED}" fi - lc_cd "${BASE_DIR}/liferay-portal-ee" - - git fetch upstream - local product_group_version="$(echo "${_PRODUCT_VERSION}" | cut -d '.' -f 1,2)" local quarterly_release_branch="release-${product_group_version}" - if (git branch --list "${quarterly_release_branch}") - then - git checkout "${quarterly_release_branch}" - else - git checkout -b "${quarterly_release_branch}" "upstream/${quarterly_release_branch}" - fi + lc_cd "${BASE_DIR}/liferay-portal-ee" + + git branch --delete "${quarterly_release_branch}" - git reset --hard "upstream/${quarterly_release_branch}" + git fetch --no-tags upstream "${quarterly_release_branch}":"${quarterly_release_branch}" + + git checkout "${quarterly_release_branch}" local next_project_version_suffix="$(echo "${_PRODUCT_VERSION}" | cut -d '.' -f 3)" next_project_version_suffix=$((next_project_version_suffix + 1)) - git checkout -b "${quarterly_release_branch}.${next_project_version_suffix}" - sed -e -i "s/${product_group_version^^}.[0-9]\+/${product_group_version^^}.${next_project_version_suffix}/" "${BASE_DIR}/liferay-portal-ee/release.properties" git add "${BASE_DIR}/liferay-portal-ee/release.properties" git commit -m "Prep next" - git push upstream "${quarterly_release_branch}.${next_project_version_suffix}" + git push upstream "${quarterly_release_branch}" if [ "${?}" -ne 0 ] then From 00e768758397768efe0f09080a6f958a0c6db372 Mon Sep 17 00:00:00 2001 From: Renato Rego Date: Thu, 25 Jul 2024 14:11:14 -0300 Subject: [PATCH 008/140] LPD-31859 Fix regex --- release/release_gold.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/release_gold.sh b/release/release_gold.sh index cc7ccd570..b063085bc 100755 --- a/release/release_gold.sh +++ b/release/release_gold.sh @@ -146,7 +146,7 @@ function prepare_next_release_branch { next_project_version_suffix=$((next_project_version_suffix + 1)) - sed -e -i "s/${product_group_version^^}.[0-9]\+/${product_group_version^^}.${next_project_version_suffix}/" "${BASE_DIR}/liferay-portal-ee/release.properties" + sed -i -e "s/${product_group_version^^}\.[0-9]+/${product_group_version^^}\.${next_project_version_suffix}/" "${BASE_DIR}/liferay-portal-ee/release.properties" git add "${BASE_DIR}/liferay-portal-ee/release.properties" From 4de2d341fda012e810fab760a2f44d5a00196990 Mon Sep 17 00:00:00 2001 From: Pedro Malta Date: Fri, 26 Jul 2024 07:45:19 -0300 Subject: [PATCH 009/140] LPD-31859 Getting the latest quarterly product version from the release.json --- release/release_gold.sh | 62 ++++++++++++++++++++++++++--------------- 1 file changed, 39 insertions(+), 23 deletions(-) diff --git a/release/release_gold.sh b/release/release_gold.sh index b063085bc..4fc9b4da6 100755 --- a/release/release_gold.sh +++ b/release/release_gold.sh @@ -103,25 +103,26 @@ function main { #lc_time_run upload_to_docker_hub } -function print_help { - echo "Usage: LIFERAY_RELEASE_RC_BUILD_TIMESTAMP= LIFERAY_RELEASE_VERSION= ${0}" - echo "" - echo "The script reads the following environment variables:" - echo "" - echo " LIFERAY_RELEASE_GITHUB_PAT (optional): GitHub personal access token used to tag releases" - echo " LIFERAY_RELEASE_NEXUS_REPOSITORY_PASSWORD (optional): Nexus user's password" - echo " LIFERAY_RELEASE_NEXUS_REPOSITORY_USER (optional): Nexus user with the right to upload BOM files" - echo " LIFERAY_RELEASE_PRODUCT_NAME (optional): Set to \"portal\" for CE. The default is \"DXP\"." - echo " LIFERAY_RELEASE_RC_BUILD_TIMESTAMP: Timestamp of the build to publish" - echo " LIFERAY_RELEASE_VERSION: DXP version of the release to publish" - echo "" - echo "Example: LIFERAY_RELEASE_RC_BUILD_TIMESTAMP=1695892964 LIFERAY_RELEASE_VERSION=2023.q3.0 ${0}" +function prepare_next_release_branch { + if [[ "${_PRODUCT_VERSION}" != *q* ]] + then + lc_log INFO Skipping the preparation of the next release branch. - exit "${LIFERAY_COMMON_EXIT_CODE_HELP}" -} + return "${LIFERAY_COMMON_EXIT_CODE_SKIPPED}" + fi -function prepare_next_release_branch { - local latest_quarterly_product_version="$(yq ".quarterly | to_entries | .[] | select(.value.latest == true) | .key" "${BASE_DIR}/liferay-docker/bundles.yml")" + if [ -e "releases.json" ] + then + rm -fr releases.json + fi + + lc_download "https://releases.liferay.com/releases.json" releases.json + + local product_group_version="$(echo "${_PRODUCT_VERSION}" | cut -d '.' -f 1,2)" + + local latest_quarterly_product_version="$(jq -r ".[] | select(.productGroupVersion == \"${product_group_version}\" and .promoted == \"true\") | .targetPlatformVersion" releases.json)" + + rm -fr releases.json if [ "${_PRODUCT_VERSION}" != "${latest_quarterly_product_version}" ] then @@ -130,23 +131,21 @@ function prepare_next_release_branch { return "${LIFERAY_COMMON_EXIT_CODE_SKIPPED}" fi - local product_group_version="$(echo "${_PRODUCT_VERSION}" | cut -d '.' -f 1,2)" - local quarterly_release_branch="release-${product_group_version}" lc_cd "${BASE_DIR}/liferay-portal-ee" - git branch --delete "${quarterly_release_branch}" + git branch --delete "${quarterly_release_branch}" &> /dev/null - git fetch --no-tags upstream "${quarterly_release_branch}":"${quarterly_release_branch}" + git fetch --no-tags upstream "${quarterly_release_branch}":"${quarterly_release_branch}" &> /dev/null - git checkout "${quarterly_release_branch}" + git checkout "${quarterly_release_branch}" &> /dev/null local next_project_version_suffix="$(echo "${_PRODUCT_VERSION}" | cut -d '.' -f 3)" next_project_version_suffix=$((next_project_version_suffix + 1)) - sed -i -e "s/${product_group_version^^}\.[0-9]+/${product_group_version^^}\.${next_project_version_suffix}/" "${BASE_DIR}/liferay-portal-ee/release.properties" + sed -e "s/${product_group_version^^}\.[0-9]*/${product_group_version^^}\.${next_project_version_suffix}/" -i "${BASE_DIR}/liferay-portal-ee/release.properties" git add "${BASE_DIR}/liferay-portal-ee/release.properties" @@ -164,6 +163,23 @@ function prepare_next_release_branch { fi } +function print_help { + echo "Usage: LIFERAY_RELEASE_RC_BUILD_TIMESTAMP= LIFERAY_RELEASE_VERSION= ${0}" + echo "" + echo "The script reads the following environment variables:" + echo "" + echo " LIFERAY_RELEASE_GITHUB_PAT (optional): GitHub personal access token used to tag releases" + echo " LIFERAY_RELEASE_NEXUS_REPOSITORY_PASSWORD (optional): Nexus user's password" + echo " LIFERAY_RELEASE_NEXUS_REPOSITORY_USER (optional): Nexus user with the right to upload BOM files" + echo " LIFERAY_RELEASE_PRODUCT_NAME (optional): Set to \"portal\" for CE. The default is \"DXP\"." + echo " LIFERAY_RELEASE_RC_BUILD_TIMESTAMP: Timestamp of the build to publish" + echo " LIFERAY_RELEASE_VERSION: DXP version of the release to publish" + echo "" + echo "Example: LIFERAY_RELEASE_RC_BUILD_TIMESTAMP=1695892964 LIFERAY_RELEASE_VERSION=2023.q3.0 ${0}" + + exit "${LIFERAY_COMMON_EXIT_CODE_HELP}" +} + function promote_boms { lc_time_run prepare_poms_for_promotion xanadu From dee9e26b5fda3aa06950680e95671b5f684f9966 Mon Sep 17 00:00:00 2001 From: Renato Rego Date: Fri, 2 Aug 2024 16:03:01 -0300 Subject: [PATCH 010/140] LPD-31859 SF --- release/release_gold.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/release/release_gold.sh b/release/release_gold.sh index 4fc9b4da6..7fbec9224 100755 --- a/release/release_gold.sh +++ b/release/release_gold.sh @@ -120,7 +120,10 @@ function prepare_next_release_branch { local product_group_version="$(echo "${_PRODUCT_VERSION}" | cut -d '.' -f 1,2)" - local latest_quarterly_product_version="$(jq -r ".[] | select(.productGroupVersion == \"${product_group_version}\" and .promoted == \"true\") | .targetPlatformVersion" releases.json)" + local latest_quarterly_product_version="$(\ + jq -r ".[] | \ + select(.productGroupVersion == \"${product_group_version}\" and .promoted == \"true\") | \ + .targetPlatformVersion" releases.json)" rm -fr releases.json From 276c3432a2f8ce555b089cedd9f86b6a68b737ca Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Mon, 5 Aug 2024 11:27:45 -0300 Subject: [PATCH 011/140] LPD-31859 SF/Rename --- release/release_gold.sh | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/release/release_gold.sh b/release/release_gold.sh index 7fbec9224..f9f5a2360 100755 --- a/release/release_gold.sh +++ b/release/release_gold.sh @@ -106,15 +106,12 @@ function main { function prepare_next_release_branch { if [[ "${_PRODUCT_VERSION}" != *q* ]] then - lc_log INFO Skipping the preparation of the next release branch. + lc_log INFO "Skipping the preparation of the next release branch." return "${LIFERAY_COMMON_EXIT_CODE_SKIPPED}" fi - if [ -e "releases.json" ] - then - rm -fr releases.json - fi + rm -fr releases.json lc_download "https://releases.liferay.com/releases.json" releases.json @@ -134,15 +131,15 @@ function prepare_next_release_branch { return "${LIFERAY_COMMON_EXIT_CODE_SKIPPED}" fi - local quarterly_release_branch="release-${product_group_version}" - lc_cd "${BASE_DIR}/liferay-portal-ee" - git branch --delete "${quarterly_release_branch}" &> /dev/null + local quarterly_release_branch_name="release-${product_group_version}" + + git branch --delete "${quarterly_release_branch_name}" &> /dev/null - git fetch --no-tags upstream "${quarterly_release_branch}":"${quarterly_release_branch}" &> /dev/null + git fetch --no-tags upstream "${quarterly_release_branch_name}":"${quarterly_release_branch_name}" &> /dev/null - git checkout "${quarterly_release_branch}" &> /dev/null + git checkout "${quarterly_release_branch_name}" &> /dev/null local next_project_version_suffix="$(echo "${_PRODUCT_VERSION}" | cut -d '.' -f 3)" @@ -154,7 +151,7 @@ function prepare_next_release_branch { git commit -m "Prep next" - git push upstream "${quarterly_release_branch}" + git push upstream "${quarterly_release_branch_name}" if [ "${?}" -ne 0 ] then From 6c380b48c251939f0a22aecdc99586f087e2727a Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Mon, 5 Aug 2024 11:28:25 -0300 Subject: [PATCH 012/140] LPD-31859 Wordsmith --- release/release_gold.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/release_gold.sh b/release/release_gold.sh index f9f5a2360..422b7f379 100755 --- a/release/release_gold.sh +++ b/release/release_gold.sh @@ -149,7 +149,7 @@ function prepare_next_release_branch { git add "${BASE_DIR}/liferay-portal-ee/release.properties" - git commit -m "Prep next" + git commit -m "Prepeare ${quarterly_release_branch_name}." git push upstream "${quarterly_release_branch_name}" From b20eb7cecdce1898926bb0966acf5b08eda354f0 Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Mon, 5 Aug 2024 11:29:39 -0300 Subject: [PATCH 013/140] LPD-31859 Wordsmith --- release/release_gold.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release/release_gold.sh b/release/release_gold.sh index 422b7f379..500ac6a66 100755 --- a/release/release_gold.sh +++ b/release/release_gold.sh @@ -155,11 +155,11 @@ function prepare_next_release_branch { if [ "${?}" -ne 0 ] then - lc_log ERROR "Unable to update the next release branch." + lc_log ERROR "Unable to prepare the next release branch." return "${LIFERAY_COMMON_EXIT_CODE_BAD}" else - lc_log INFO "The next release branch was updated successfully." + lc_log INFO "The next release branch was prepared successfully." fi } From 9f103cabcf4ac2f14f4948fe980d510fa8e66088 Mon Sep 17 00:00:00 2001 From: Szantina Szanto Date: Tue, 16 Jul 2024 12:21:43 +0200 Subject: [PATCH 014/140] LPD-31468 Set git links based on LIFERAY_RELEASE_PRODUCT_NAME variable --- release/_bom.sh | 3 +++ release/templates/release.bom.compile.only.pom.tpl | 6 +++--- release/templates/release.bom.pom.tpl | 6 +++--- release/templates/release.bom.third.party.pom.tpl | 6 +++--- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/release/_bom.sh b/release/_bom.sh index d62a3f31e..2ecb24ac4 100644 --- a/release/_bom.sh +++ b/release/_bom.sh @@ -168,6 +168,7 @@ function generate_pom_release_bom { -e "s/__ARTIFACT_ID__/release.${LIFERAY_RELEASE_PRODUCT_NAME}.bom/" \ -e "s/__BUILD_TIMESTAMP__/${_BUILD_TIMESTAMP}/" \ -e "s/__PRODUCT_VERSION__/${_PRODUCT_VERSION}/" \ + -e "s/__LIFERAY_RELEASE_PRODUCT_NAME__/${LIFERAY_RELEASE_PRODUCT_NAME}/" \ -e "w ${pom_file_name}" \ "${_RELEASE_TOOL_DIR}/templates/release.bom.pom.tpl" > /dev/null @@ -229,6 +230,7 @@ function generate_pom_release_bom_compile_only { sed \ -e "s/__ARTIFACT_ID__/release.${LIFERAY_RELEASE_PRODUCT_NAME}.bom.compile.only/" \ -e "s/__BUILD_TIMESTAMP__/${_BUILD_TIMESTAMP}/" \ + -e "s/__LIFERAY_RELEASE_PRODUCT_NAME__/${LIFERAY_RELEASE_PRODUCT_NAME}/" \ -e "s/__PRODUCT_VERSION__/${_PRODUCT_VERSION}/" \ -e "s/__RELEASE_API_DEPENDENCY__/release.${LIFERAY_RELEASE_PRODUCT_NAME}.api/" \ -e "w ${pom_file_name}" \ @@ -262,6 +264,7 @@ function generate_pom_release_bom_third_party { -e "s/__ARTIFACT_ID__/release.${LIFERAY_RELEASE_PRODUCT_NAME}.bom.third.party/" \ -e "s/__BUILD_TIMESTAMP__/${_BUILD_TIMESTAMP}/" \ -e "s/__PRODUCT_VERSION__/${_PRODUCT_VERSION}/" \ + -e "s/__LIFERAY_RELEASE_PRODUCT_NAME__/${LIFERAY_RELEASE_PRODUCT_NAME}/" \ -e "w ${pom_file_name}" \ "${_RELEASE_TOOL_DIR}/templates/release.bom.third.party.pom.tpl" > /dev/null diff --git a/release/templates/release.bom.compile.only.pom.tpl b/release/templates/release.bom.compile.only.pom.tpl index a4a9708fd..b0f7f80ca 100644 --- a/release/templates/release.bom.compile.only.pom.tpl +++ b/release/templates/release.bom.compile.only.pom.tpl @@ -24,10 +24,10 @@ - scm:git:git@github.com:liferay/liferay-dxp.git - scm:git:git@github.com:liferay/liferay-dxp.git + scm:git:git@github.com:liferay/liferay-__LIFERAY_RELEASE_PRODUCT_NAME__.git + scm:git:git@github.com:liferay/liferay-__LIFERAY_RELEASE_PRODUCT_NAME__.git __PRODUCT_VERSION__ - https://github.com/liferay/liferay-dxp + https://github.com/liferay/liferay-__LIFERAY_RELEASE_PRODUCT_NAME__ diff --git a/release/templates/release.bom.pom.tpl b/release/templates/release.bom.pom.tpl index 73d61a8d5..a4f3155fb 100644 --- a/release/templates/release.bom.pom.tpl +++ b/release/templates/release.bom.pom.tpl @@ -24,10 +24,10 @@ - scm:git:git@github.com:liferay/liferay-dxp.git - scm:git:git@github.com:liferay/liferay-dxp.git + scm:git:git@github.com:liferay/liferay-__LIFERAY_RELEASE_PRODUCT_NAME__.git + scm:git:git@github.com:liferay/liferay-__LIFERAY_RELEASE_PRODUCT_NAME__.git __PRODUCT_VERSION__ - https://github.com/liferay/liferay-dxp + https://github.com/liferay/liferay-__LIFERAY_RELEASE_PRODUCT_NAME__ diff --git a/release/templates/release.bom.third.party.pom.tpl b/release/templates/release.bom.third.party.pom.tpl index b18ccb069..e8646982e 100644 --- a/release/templates/release.bom.third.party.pom.tpl +++ b/release/templates/release.bom.third.party.pom.tpl @@ -24,10 +24,10 @@ - scm:git:git@github.com:liferay/liferay-dxp.git - scm:git:git@github.com:liferay/liferay-dxp.git + scm:git:git@github.com:liferay/liferay-__LIFERAY_RELEASE_PRODUCT_NAME__.git + scm:git:git@github.com:liferay/liferay-__LIFERAY_RELEASE_PRODUCT_NAME__.git __PRODUCT_VERSION__ - https://github.com/liferay/liferay-dxp + https://github.com/liferay/liferay-__LIFERAY_RELEASE_PRODUCT_NAME__ \ No newline at end of file From e394ae48d9646cd71ee06262b46497a435220a26 Mon Sep 17 00:00:00 2001 From: Renato Rego Date: Mon, 29 Jul 2024 18:53:24 -0300 Subject: [PATCH 015/140] LPD-31468 Rename --- release/_bom.sh | 6 +++--- release/templates/release.bom.compile.only.pom.tpl | 6 +++--- release/templates/release.bom.pom.tpl | 6 +++--- release/templates/release.bom.third.party.pom.tpl | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/release/_bom.sh b/release/_bom.sh index 2ecb24ac4..ae9cd3eb7 100644 --- a/release/_bom.sh +++ b/release/_bom.sh @@ -167,8 +167,8 @@ function generate_pom_release_bom { sed \ -e "s/__ARTIFACT_ID__/release.${LIFERAY_RELEASE_PRODUCT_NAME}.bom/" \ -e "s/__BUILD_TIMESTAMP__/${_BUILD_TIMESTAMP}/" \ + -e "s/__GITHUB_REPOSITORY__/liferay-${LIFERAY_RELEASE_PRODUCT_NAME}/" \ -e "s/__PRODUCT_VERSION__/${_PRODUCT_VERSION}/" \ - -e "s/__LIFERAY_RELEASE_PRODUCT_NAME__/${LIFERAY_RELEASE_PRODUCT_NAME}/" \ -e "w ${pom_file_name}" \ "${_RELEASE_TOOL_DIR}/templates/release.bom.pom.tpl" > /dev/null @@ -230,7 +230,7 @@ function generate_pom_release_bom_compile_only { sed \ -e "s/__ARTIFACT_ID__/release.${LIFERAY_RELEASE_PRODUCT_NAME}.bom.compile.only/" \ -e "s/__BUILD_TIMESTAMP__/${_BUILD_TIMESTAMP}/" \ - -e "s/__LIFERAY_RELEASE_PRODUCT_NAME__/${LIFERAY_RELEASE_PRODUCT_NAME}/" \ + -e "s/__GITHUB_REPOSITORY__/liferay-${LIFERAY_RELEASE_PRODUCT_NAME}/" \ -e "s/__PRODUCT_VERSION__/${_PRODUCT_VERSION}/" \ -e "s/__RELEASE_API_DEPENDENCY__/release.${LIFERAY_RELEASE_PRODUCT_NAME}.api/" \ -e "w ${pom_file_name}" \ @@ -263,8 +263,8 @@ function generate_pom_release_bom_third_party { sed \ -e "s/__ARTIFACT_ID__/release.${LIFERAY_RELEASE_PRODUCT_NAME}.bom.third.party/" \ -e "s/__BUILD_TIMESTAMP__/${_BUILD_TIMESTAMP}/" \ + -e "s/__GITHUB_REPOSITORY__/liferay-${LIFERAY_RELEASE_PRODUCT_NAME}/" \ -e "s/__PRODUCT_VERSION__/${_PRODUCT_VERSION}/" \ - -e "s/__LIFERAY_RELEASE_PRODUCT_NAME__/${LIFERAY_RELEASE_PRODUCT_NAME}/" \ -e "w ${pom_file_name}" \ "${_RELEASE_TOOL_DIR}/templates/release.bom.third.party.pom.tpl" > /dev/null diff --git a/release/templates/release.bom.compile.only.pom.tpl b/release/templates/release.bom.compile.only.pom.tpl index b0f7f80ca..8f3725e76 100644 --- a/release/templates/release.bom.compile.only.pom.tpl +++ b/release/templates/release.bom.compile.only.pom.tpl @@ -24,10 +24,10 @@ - scm:git:git@github.com:liferay/liferay-__LIFERAY_RELEASE_PRODUCT_NAME__.git - scm:git:git@github.com:liferay/liferay-__LIFERAY_RELEASE_PRODUCT_NAME__.git + scm:git:git@github.com:liferay/__GITHUB_REPOSITORY__.git + scm:git:git@github.com:liferay/__GITHUB_REPOSITORY__.git __PRODUCT_VERSION__ - https://github.com/liferay/liferay-__LIFERAY_RELEASE_PRODUCT_NAME__ + https://github.com/liferay/__GITHUB_REPOSITORY__ diff --git a/release/templates/release.bom.pom.tpl b/release/templates/release.bom.pom.tpl index a4f3155fb..bee2ba4a2 100644 --- a/release/templates/release.bom.pom.tpl +++ b/release/templates/release.bom.pom.tpl @@ -24,10 +24,10 @@ - scm:git:git@github.com:liferay/liferay-__LIFERAY_RELEASE_PRODUCT_NAME__.git - scm:git:git@github.com:liferay/liferay-__LIFERAY_RELEASE_PRODUCT_NAME__.git + scm:git:git@github.com:liferay/__GITHUB_REPOSITORY__.git + scm:git:git@github.com:liferay/__GITHUB_REPOSITORY__.git __PRODUCT_VERSION__ - https://github.com/liferay/liferay-__LIFERAY_RELEASE_PRODUCT_NAME__ + https://github.com/liferay/__GITHUB_REPOSITORY__ diff --git a/release/templates/release.bom.third.party.pom.tpl b/release/templates/release.bom.third.party.pom.tpl index e8646982e..f917859c6 100644 --- a/release/templates/release.bom.third.party.pom.tpl +++ b/release/templates/release.bom.third.party.pom.tpl @@ -24,10 +24,10 @@ - scm:git:git@github.com:liferay/liferay-__LIFERAY_RELEASE_PRODUCT_NAME__.git - scm:git:git@github.com:liferay/liferay-__LIFERAY_RELEASE_PRODUCT_NAME__.git + scm:git:git@github.com:liferay/__GITHUB_REPOSITORY__.git + scm:git:git@github.com:liferay/__GITHUB_REPOSITORY__.git __PRODUCT_VERSION__ - https://github.com/liferay/liferay-__LIFERAY_RELEASE_PRODUCT_NAME__ + https://github.com/liferay/__GITHUB_REPOSITORY__ \ No newline at end of file From e71f4645f0d6a594a0de729bb0da034fd3bdd640 Mon Sep 17 00:00:00 2001 From: Renato Rego Date: Mon, 29 Jul 2024 19:11:46 -0300 Subject: [PATCH 016/140] LPD-31468 Move code to reuse in new tests --- release/_test_common.sh | 15 +++++++++++++++ release/test_releases_json.sh | 15 +-------------- 2 files changed, 16 insertions(+), 14 deletions(-) create mode 100755 release/_test_common.sh diff --git a/release/_test_common.sh b/release/_test_common.sh new file mode 100755 index 000000000..c44523cf9 --- /dev/null +++ b/release/_test_common.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +function assert_equals { + if [ "${1}" = 1 ] || [ "${1}" = true ] + then + echo "${FUNCNAME[1]} SUCCESS" + else + echo "${FUNCNAME[1]} FAILED" + + if [ -n "${2}" ] + then + echo "${2}" + fi + fi +} \ No newline at end of file diff --git a/release/test_releases_json.sh b/release/test_releases_json.sh index 8400d5ef1..ebac31afa 100755 --- a/release/test_releases_json.sh +++ b/release/test_releases_json.sh @@ -2,20 +2,7 @@ source _liferay_common.sh source _releases_json.sh - -function assert_equals { - if [ "${1}" = 1 ] || [ "${1}" = true ] - then - echo "${FUNCNAME[1]} SUCCESS" - else - echo "${FUNCNAME[1]} FAILED" - - if [ -n "${2}" ] - then - echo "${2}" - fi - fi -} +source _test_common.sh function main { set_up From 399a2efe3a8ae995385606c54e2922bcc35a9bab Mon Sep 17 00:00:00 2001 From: Renato Rego Date: Mon, 29 Jul 2024 19:21:30 -0300 Subject: [PATCH 017/140] LPD-31468 Use colors to highlight tests results --- release/_test_common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release/_test_common.sh b/release/_test_common.sh index c44523cf9..b6006bfa4 100755 --- a/release/_test_common.sh +++ b/release/_test_common.sh @@ -3,9 +3,9 @@ function assert_equals { if [ "${1}" = 1 ] || [ "${1}" = true ] then - echo "${FUNCNAME[1]} SUCCESS" + echo -e "${FUNCNAME[1]} \e[1;32mSUCCESS\e[0m" else - echo "${FUNCNAME[1]} FAILED" + echo -e "${FUNCNAME[1]} \e[1;31mFAILED\e[0m" if [ -n "${2}" ] then From 958405aaa421e2682c46b27089e6762b6fd4072e Mon Sep 17 00:00:00 2001 From: Renato Rego Date: Tue, 30 Jul 2024 21:01:46 -0300 Subject: [PATCH 018/140] LPD-31468 Simplify usage of function assert_equals --- release/_test_common.sh | 27 +++++++++++++++++++++------ release/test_releases_json.sh | 4 ++-- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/release/_test_common.sh b/release/_test_common.sh index b6006bfa4..38abef7b0 100755 --- a/release/_test_common.sh +++ b/release/_test_common.sh @@ -1,15 +1,30 @@ #!/bin/bash function assert_equals { - if [ "${1}" = 1 ] || [ "${1}" = true ] + local parameters=() + + for parameter in ${@}; do + parameters+=(${parameter}) + done + + local assertion_result="false" + + for index in ${!parameters[@]}; do + if [ $((index % 2)) -ne 0 ] + then + continue + fi + + if [ "${parameters[${index}]}" == "${parameters[${index} + 1]}" ] + then + assertion_result="true" + fi + done + + if [ "${assertion_result}" == "true" ] then echo -e "${FUNCNAME[1]} \e[1;32mSUCCESS\e[0m" else echo -e "${FUNCNAME[1]} \e[1;31mFAILED\e[0m" - - if [ -n "${2}" ] - then - echo "${2}" - fi fi } \ No newline at end of file diff --git a/release/test_releases_json.sh b/release/test_releases_json.sh index ebac31afa..125bb815b 100755 --- a/release/test_releases_json.sh +++ b/release/test_releases_json.sh @@ -38,7 +38,7 @@ function test_merge_json_snippets { local latest_count="$(grep -c "${latest_url}" releases.json)" - assert_equals $(echo $(( "${earliest_count}" == 1 && "${latest_count}" == 1 ))) + assert_equals "${earliest_count}" 1 "${latest_count}" 1 } function test_promote_product_versions { @@ -50,7 +50,7 @@ function test_promote_product_versions { if [ -n "${last_version}" ] then - assert_equals $(echo "$(jq -r '.[] | .promoted' "${last_version}")") "${last_version} should be promoted." + assert_equals "$(jq -r '.[] | .promoted' "${last_version}")" "true" fi done < "${_RELEASE_ROOT_DIR}/supported-${product_name}-versions.txt" } From 4414d2f77e37d3481da7e9885088a4eb9d2574df Mon Sep 17 00:00:00 2001 From: Renato Rego Date: Tue, 30 Jul 2024 21:03:49 -0300 Subject: [PATCH 019/140] LPD-31468 Add support to files comparison in function assert_equals --- release/_test_common.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/release/_test_common.sh b/release/_test_common.sh index 38abef7b0..ec872d13b 100755 --- a/release/_test_common.sh +++ b/release/_test_common.sh @@ -15,9 +15,20 @@ function assert_equals { continue fi - if [ "${parameters[${index}]}" == "${parameters[${index} + 1]}" ] + if [ -f "${parameters[${index}]}" ] && + [ -f "${parameters[${index} + 1]}" ] then - assertion_result="true" + diff "${parameters[${index}]}" "${parameters[${index} + 1]}" + + if [ "${?}" -eq 0 ] + then + assertion_result="true" + fi + else + if [ "${parameters[${index}]}" == "${parameters[${index} + 1]}" ] + then + assertion_result="true" + fi fi done From a3662ceafde7a3e8794927876018473f58cfe38b Mon Sep 17 00:00:00 2001 From: Renato Rego Date: Tue, 30 Jul 2024 21:42:34 -0300 Subject: [PATCH 020/140] LPD-31468 Add test to cover generation of BOM Compile Only --- .../expected.dxp.release.bom.compile.only.pom | 78 +++++++++++++++++++ ...pected.portal.release.bom.compile.only.pom | 78 +++++++++++++++++++ release/test_bom.sh | 72 +++++++++++++++++ 3 files changed, 228 insertions(+) create mode 100644 release/test-dependencies/expected.dxp.release.bom.compile.only.pom create mode 100644 release/test-dependencies/expected.portal.release.bom.compile.only.pom create mode 100755 release/test_bom.sh diff --git a/release/test-dependencies/expected.dxp.release.bom.compile.only.pom b/release/test-dependencies/expected.dxp.release.bom.compile.only.pom new file mode 100644 index 000000000..09c45c3be --- /dev/null +++ b/release/test-dependencies/expected.dxp.release.bom.compile.only.pom @@ -0,0 +1,78 @@ + + + + 4.0.0 + com.liferay.portal + release.dxp.bom.compile.only + 2024.q2.6-12345 + pom + + + LGPL 2.1 + http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt + + + + + Brian Wing Shun Chan + Liferay, Inc. + http://www.liferay.com + + + + scm:git:git@github.com:liferay/liferay-dxp.git + scm:git:git@github.com:liferay/liferay-dxp.git + 2024.q2.6 + https://github.com/liferay/liferay-dxp + + + + liferay-public-releases + Liferay Public Releases + https://repository-cdn.liferay.com/nexus/content/repositories/liferay-public-releases/ + + + + + + com.liferay.portal + release.dxp.api + 2024.q2.6-12345 + + + javax.ws.rs + javax.ws.rs-api + 2.1 + + + jstl + jstl + 1.2 + + + org.osgi + org.osgi.core + 6.0.0 + + + org.osgi + org.osgi.service.component.annotations + 1.3.0 + + + org.osgi + org.osgi.service.jaxrs + 1.0.0 + + + org.osgi + osgi.cmpn + 6.0.0 + + + + diff --git a/release/test-dependencies/expected.portal.release.bom.compile.only.pom b/release/test-dependencies/expected.portal.release.bom.compile.only.pom new file mode 100644 index 000000000..2ed811e9c --- /dev/null +++ b/release/test-dependencies/expected.portal.release.bom.compile.only.pom @@ -0,0 +1,78 @@ + + + + 4.0.0 + com.liferay.portal + release.portal.bom.compile.only + 7.4.3.120-ga120-12345 + pom + + + LGPL 2.1 + http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt + + + + + Brian Wing Shun Chan + Liferay, Inc. + http://www.liferay.com + + + + scm:git:git@github.com:liferay/liferay-portal.git + scm:git:git@github.com:liferay/liferay-portal.git + 7.4.3.120-ga120 + https://github.com/liferay/liferay-portal + + + + liferay-public-releases + Liferay Public Releases + https://repository-cdn.liferay.com/nexus/content/repositories/liferay-public-releases/ + + + + + + com.liferay.portal + release.portal.api + 7.4.3.120-ga120-12345 + + + javax.ws.rs + javax.ws.rs-api + 2.1 + + + jstl + jstl + 1.2 + + + org.osgi + org.osgi.core + 6.0.0 + + + org.osgi + org.osgi.service.component.annotations + 1.3.0 + + + org.osgi + org.osgi.service.jaxrs + 1.0.0 + + + org.osgi + osgi.cmpn + 6.0.0 + + + + diff --git a/release/test_bom.sh b/release/test_bom.sh new file mode 100755 index 000000000..041844c28 --- /dev/null +++ b/release/test_bom.sh @@ -0,0 +1,72 @@ +#!/bin/bash + +source _bom.sh +source _liferay_common.sh +source _test_common.sh + +function main { + set_up + + test_dxp_generate_pom_release_bom_compile_only + + _PRODUCT_VERSION="7.4.3.120-ga120" + LIFERAY_RELEASE_PRODUCT_NAME="portal" + + test_portal_generate_pom_release_bom_compile_only + + tear_down +} + +function set_up { + export _BUILD_TIMESTAMP=12345 + export _PRODUCT_VERSION="2024.q2.6" + export _RELEASE_ROOT_DIR="${PWD}" + + export _PROJECTS_DIR="${_RELEASE_ROOT_DIR}"/../.. + + export _RELEASE_TOOL_DIR="${_RELEASE_ROOT_DIR}" + + export LIFERAY_RELEASE_PRODUCT_NAME="dxp" + + cd "${_PROJECTS_DIR}"/liferay-portal-ee + + git branch --delete "${_PRODUCT_VERSION}" &> /dev/null + + git fetch --no-tags upstream "${_PRODUCT_VERSION}":"${_PRODUCT_VERSION}" &> /dev/null + + git checkout --quiet "${_PRODUCT_VERSION}" + + cd "${_RELEASE_ROOT_DIR}" +} + +function tear_down { + unset _BUILD_TIMESTAMP + unset _PRODUCT_VERSION + unset _PROJECTS_DIR + unset _RELEASE_ROOT_DIR + unset _RELEASE_TOOL_DIR + + unset LIFERAY_RELEASE_PRODUCT_NAME +} + +function test_dxp_generate_pom_release_bom_compile_only { + generate_pom_release_bom_compile_only + + assert_equals \ + release.${LIFERAY_RELEASE_PRODUCT_NAME}.bom.compile.only-${_PRODUCT_VERSION}-${_BUILD_TIMESTAMP}.pom \ + test-dependencies/expected.dxp.release.bom.compile.only.pom + + rm release.${LIFERAY_RELEASE_PRODUCT_NAME}.bom.compile.only-${_PRODUCT_VERSION}-${_BUILD_TIMESTAMP}.pom +} + +function test_portal_generate_pom_release_bom_compile_only { + generate_pom_release_bom_compile_only + + assert_equals \ + release.${LIFERAY_RELEASE_PRODUCT_NAME}.bom.compile.only-${_PRODUCT_VERSION}-${_BUILD_TIMESTAMP}.pom \ + test-dependencies/expected.portal.release.bom.compile.only.pom + + rm release.${LIFERAY_RELEASE_PRODUCT_NAME}.bom.compile.only-${_PRODUCT_VERSION}-${_BUILD_TIMESTAMP}.pom +} + +main \ No newline at end of file From 81689c06457893522d405b6ef7c225d8a59b4c49 Mon Sep 17 00:00:00 2001 From: Renato Rego Date: Tue, 30 Jul 2024 22:15:23 -0300 Subject: [PATCH 021/140] LPD-31468 Add test to cover generation of BOM Third Party --- .../expected.dxp.release.bom.third.party.pom | 661 ++++++++++++++++++ ...xpected.portal.release.bom.third.party.pom | 661 ++++++++++++++++++ release/test_bom.sh | 28 + 3 files changed, 1350 insertions(+) create mode 100644 release/test-dependencies/expected.dxp.release.bom.third.party.pom create mode 100644 release/test-dependencies/expected.portal.release.bom.third.party.pom diff --git a/release/test-dependencies/expected.dxp.release.bom.third.party.pom b/release/test-dependencies/expected.dxp.release.bom.third.party.pom new file mode 100644 index 000000000..b7ffab227 --- /dev/null +++ b/release/test-dependencies/expected.dxp.release.bom.third.party.pom @@ -0,0 +1,661 @@ + + + + 4.0.0 + com.liferay.portal + release.dxp.bom.third.party + 2024.q2.6-12345 + pom + + + LGPL 2.1 + http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt + + + + + Brian Wing Shun Chan + Liferay, Inc. + http://www.liferay.com + + + + scm:git:git@github.com:liferay/liferay-dxp.git + scm:git:git@github.com:liferay/liferay-dxp.git + 2024.q2.6 + https://github.com/liferay/liferay-dxp + + + + + javax.activation + activation + 1.1 + + + com.liferay.alloy-taglibs + alloy-taglib + 1.1.14 + + + javax.annotation + jsr250-api + 1.0 + + + org.apache.ant + ant-apache-bsf + 1.10.9 + + + org.apache.ant + ant-compress + 1.5 + + + org.ow2.asm + asm-commons + 7.0 + + + org.ow2.asm + asm-tree + 7.0 + + + org.ow2.asm + asm + 7.0 + + + org.aspectj + aspectjrt + 1.9.5 + + + org.aspectj + aspectjweaver + 1.9.5 + + + biz.aQute.bnd + biz.aQute.repository + 5.3.0 + + + net.bytebuddy + byte-buddy-agent + 1.12.10 + + + net.bytebuddy + byte-buddy + 1.12.10 + + + org.apache.tomcat + tomcat-catalina + 9.0.87 + + + com.liferay + com.liferay.ant.get.file.set + 1.0.0 + + + com.liferay + com.liferay.ant.manifest.helper + 1.0.0 + + + com.liferay + com.liferay.ant.secure.property + 1.0.0 + + + com.liferay + com.liferay.jenkins.results.parser + 1.0.1224 + + + com.liferay + com.liferay.poshi.core + 1.0.116 + + + commons-codec + commons-codec + 1.15 + + + org.apache.commons + commons-collections4 + 4.2 + + + org.apache.commons + commons-compress + 1.21 + + + org.apache.commons + commons-lang3 + 3.12.0 + + + net.sf.dtddoc + DTDDoc + 1.1.0 + + + com.liferay + com.wutka.dtd + 1.20 + + + com.liferay + com.dumbster.smtp + 02856255a6cc7f + + + com.google.errorprone + error_prone_ant + 1.0.8 + + + com.liferay + org.freemarker + 2.3.32.LIFERAY-PATCHED-1 + + + com.google.guava + guava + 32.0.1-jre + + + org.hamcrest + hamcrest-core + 1.3 + + + org.hamcrest + hamcrest-library + 1.3 + + + com.liferay + org.hsqldb + 2.7.1.LIFERAY-PATCHED-1 + + + com.liferay + com.java2html + 1.5 + + + org.jacoco + org.jacoco.agent + 0.8.4 + + + org.jacoco + org.jacoco.ant + 0.8.4 + + + org.jacoco + org.jacoco.core + 0.8.4 + + + org.jacoco + org.jacoco.report + 0.8.4 + + + jalopy + jalopy + 1.5rc3 + + + net.sf + jargs + 1.0 + + + org.apache.tomcat + tomcat-jasper + 9.0.87 + + + sun-jaxb + jaxb-api + 2.1.9 + + + net.open-esb.core + jbi_rt + 2.4.3 + + + com.uwyn + jhighlight + 1.0 + + + com.liferay + javax.naming.jndi + 1.2.1 + + + com.jcraft + jsch + 0.1.55 + + + org.skyscreamer + jsonassert + 1.2.3 + + + javax.servlet.jsp + jsp-api + 2.1 + + + javax.servlet.jsp.jstl + javax.servlet.jsp.jstl-api + 1.2.2 + + + org.glassfish.web + javax.servlet.jsp.jstl + 1.2.3 + + + junit + junit + 4.13.1 + + + com.sun.mail + jakarta.mail + 1.6.6 + + + org.mariadb.jdbc + mariadb-java-client + 3.2.0 + + + org.apache.maven + maven-ant-tasks + 2.1.3 + + + org.mockito + mockito-core + 4.5.1 + + + org.mockito + mockito-inline + 4.5.1 + + + com.mysql + mysql-connector-j + 8.3.0 + + + org.objenesis + objenesis + 2.1 + + + org.osgi + org.osgi.annotation.versioning + 1.1.0 + + + org.osgi + osgi.core + 6.0.0 + + + org.osgi + org.osgi.service.cm + 1.6.0 + + + org.osgi + org.osgi.service.component + 1.4.0 + + + org.osgi + org.osgi.service.log + 1.3.0 + + + p6spy + p6spy + 1.3 + + + com.liferay.portletmvc4spring + com.liferay.portletmvc4spring.test + 5.2.1 + + + org.postgresql + postgresql + 42.4.4 + + + com.thoughtworks.qdox + qdox + 1.12.1 + + + org.reflections + reflections + 0.9.12 + + + saxpath + saxpath + 1.0-FCS + + + javaee + sdk-addon-api + 0.2 + + + javax.servlet + javax.servlet-api + 3.1.0 + + + org.slf4j + slf4j-simple + 1.7.10 + + + org.apache.sling + org.apache.sling.commons.osgi + 2.4.0 + + + org.apache.sling + org.apache.sling.testing.osgi-mock.core + 3.1.2 + + + com.sun.mail + smtp + 1.5.4 + + + org.yaml + snakeyaml + 2.0 + + + org.springframework + spring-instrument-tomcat + 4.3.23.RELEASE + + + org.springframework + spring-instrument + 5.3.33 + + + org.springframework + spring-test + 5.3.33 + + + taglibrarydoc + tlddoc + 1.3 + + + org.apache.tomcat + tomcat-api + 9.0.87 + + + org.apache.tomcat + tomcat-coyote + 9.0.87 + + + org.apache.tomcat + tomcat-util-scan + 9.0.87 + + + org.apache.tomcat + tomcat-util + 9.0.87 + + + velocity-tools + velocity-tools + 1.4 + + + com.liferay + org.apache.velocity + 1.6.4.LIFERAY-PATCHED-3 + + + javax.websocket + javax.websocket-api + 1.1 + + + org.xmlresolver + xmlresolver + 0.12.5 + + + com.liferay + org.apache.commons.configuration + 1.10.LIFERAY-PATCHED-2 + + + commons-lang + commons-lang + 2.6 + + + com.liferay + org.apache.commons.logging + 1.2.LIFERAY-PATCHED-2 + + + org.dom4j + dom4j + 2.1.3 + + + com.liferay + org.hibernate.core + 5.6.7.LIFERAY-PATCHED-2 + + + com.zaxxer + HikariCP + 4.0.3 + + + com.sun.istack + istack-commons-runtime + 3.0.7 + + + com.liferay + org.jabsorb + 1.3.2.LIFERAY-PATCHED-2 + + + org.javassist + javassist + 3.29.0-GA + + + javax.xml.bind + jaxb-api + 2.3.0 + + + com.liferay + org.glassfish.jaxb.runtime + 2.3.1.LIFERAY-PATCHED-2 + + + jaxen + jaxen + 1.1.6 + + + javax.xml.ws + jaxws-api + 2.3.0 + + + org.slf4j + jcl-over-slf4j + 1.7.2 + + + org.jodd + jodd-json + 6.0.3 + + + com.liferay + jodd.util + 6.0.1.LIFERAY-PATCHED-2 + + + org.json + json + 20231013 + + + javax.jws + javax.jws-api + 1.1 + + + com.liferay + org.apache.logging.log4j + 2.17.1.LIFERAY-PATCHED-1 + + + com.liferay + org.apache.logging.log4j.core + 2.17.1.LIFERAY-PATCHED-1 + + + org.eclipse.persistence + javax.persistence + 2.2.1 + + + javax.portlet + portlet-api + 3.0.1 + + + org.slf4j + slf4j-api + 1.7.26 + + + javax.xml.soap + javax.xml.soap-api + 1.4.0 + + + org.springframework + spring-aop + 5.3.33 + + + com.liferay + org.springframework.beans + 5.3.33.LIFERAY-PATCHED-1 + + + org.springframework + spring-context + 5.3.33 + + + org.springframework + spring-core + 5.3.33 + + + org.springframework + spring-expression + 5.3.33 + + + org.springframework + spring-jdbc + 5.3.33 + + + com.liferay + org.springframework.orm + 5.3.33.LIFERAY-PATCHED-1 + + + com.liferay + org.springframework.tx + 5.3.33.LIFERAY-PATCHED-1 + + + org.springframework + spring-web + 5.3.34 + + + org.jvnet.staxex + stax-ex + 1.2 + + + javax.transaction + javax.transaction-api + 1.3 + + + org.codehaus.woodstox + wstx-asl + 3.2.8 + + + xerces + xercesImpl + 2.12.2 + + + xml-apis + xml-apis + 1.4.01 + + + + diff --git a/release/test-dependencies/expected.portal.release.bom.third.party.pom b/release/test-dependencies/expected.portal.release.bom.third.party.pom new file mode 100644 index 000000000..c8cd6b5ba --- /dev/null +++ b/release/test-dependencies/expected.portal.release.bom.third.party.pom @@ -0,0 +1,661 @@ + + + + 4.0.0 + com.liferay.portal + release.portal.bom.third.party + 7.4.3.120-ga120-12345 + pom + + + LGPL 2.1 + http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt + + + + + Brian Wing Shun Chan + Liferay, Inc. + http://www.liferay.com + + + + scm:git:git@github.com:liferay/liferay-portal.git + scm:git:git@github.com:liferay/liferay-portal.git + 7.4.3.120-ga120 + https://github.com/liferay/liferay-portal + + + + + javax.activation + activation + 1.1 + + + com.liferay.alloy-taglibs + alloy-taglib + 1.1.14 + + + javax.annotation + jsr250-api + 1.0 + + + org.apache.ant + ant-apache-bsf + 1.10.9 + + + org.apache.ant + ant-compress + 1.5 + + + org.ow2.asm + asm-commons + 7.0 + + + org.ow2.asm + asm-tree + 7.0 + + + org.ow2.asm + asm + 7.0 + + + org.aspectj + aspectjrt + 1.9.5 + + + org.aspectj + aspectjweaver + 1.9.5 + + + biz.aQute.bnd + biz.aQute.repository + 5.3.0 + + + net.bytebuddy + byte-buddy-agent + 1.12.10 + + + net.bytebuddy + byte-buddy + 1.12.10 + + + org.apache.tomcat + tomcat-catalina + 9.0.87 + + + com.liferay + com.liferay.ant.get.file.set + 1.0.0 + + + com.liferay + com.liferay.ant.manifest.helper + 1.0.0 + + + com.liferay + com.liferay.ant.secure.property + 1.0.0 + + + com.liferay + com.liferay.jenkins.results.parser + 1.0.1224 + + + com.liferay + com.liferay.poshi.core + 1.0.116 + + + commons-codec + commons-codec + 1.15 + + + org.apache.commons + commons-collections4 + 4.2 + + + org.apache.commons + commons-compress + 1.21 + + + org.apache.commons + commons-lang3 + 3.12.0 + + + net.sf.dtddoc + DTDDoc + 1.1.0 + + + com.liferay + com.wutka.dtd + 1.20 + + + com.liferay + com.dumbster.smtp + 02856255a6cc7f + + + com.google.errorprone + error_prone_ant + 1.0.8 + + + com.liferay + org.freemarker + 2.3.32.LIFERAY-PATCHED-1 + + + com.google.guava + guava + 32.0.1-jre + + + org.hamcrest + hamcrest-core + 1.3 + + + org.hamcrest + hamcrest-library + 1.3 + + + com.liferay + org.hsqldb + 2.7.1.LIFERAY-PATCHED-1 + + + com.liferay + com.java2html + 1.5 + + + org.jacoco + org.jacoco.agent + 0.8.4 + + + org.jacoco + org.jacoco.ant + 0.8.4 + + + org.jacoco + org.jacoco.core + 0.8.4 + + + org.jacoco + org.jacoco.report + 0.8.4 + + + jalopy + jalopy + 1.5rc3 + + + net.sf + jargs + 1.0 + + + org.apache.tomcat + tomcat-jasper + 9.0.87 + + + sun-jaxb + jaxb-api + 2.1.9 + + + net.open-esb.core + jbi_rt + 2.4.3 + + + com.uwyn + jhighlight + 1.0 + + + com.liferay + javax.naming.jndi + 1.2.1 + + + com.jcraft + jsch + 0.1.55 + + + org.skyscreamer + jsonassert + 1.2.3 + + + javax.servlet.jsp + jsp-api + 2.1 + + + javax.servlet.jsp.jstl + javax.servlet.jsp.jstl-api + 1.2.2 + + + org.glassfish.web + javax.servlet.jsp.jstl + 1.2.3 + + + junit + junit + 4.13.1 + + + com.sun.mail + jakarta.mail + 1.6.6 + + + org.mariadb.jdbc + mariadb-java-client + 3.2.0 + + + org.apache.maven + maven-ant-tasks + 2.1.3 + + + org.mockito + mockito-core + 4.5.1 + + + org.mockito + mockito-inline + 4.5.1 + + + com.mysql + mysql-connector-j + 8.3.0 + + + org.objenesis + objenesis + 2.1 + + + org.osgi + org.osgi.annotation.versioning + 1.1.0 + + + org.osgi + osgi.core + 6.0.0 + + + org.osgi + org.osgi.service.cm + 1.6.0 + + + org.osgi + org.osgi.service.component + 1.4.0 + + + org.osgi + org.osgi.service.log + 1.3.0 + + + p6spy + p6spy + 1.3 + + + com.liferay.portletmvc4spring + com.liferay.portletmvc4spring.test + 5.2.1 + + + org.postgresql + postgresql + 42.4.4 + + + com.thoughtworks.qdox + qdox + 1.12.1 + + + org.reflections + reflections + 0.9.12 + + + saxpath + saxpath + 1.0-FCS + + + javaee + sdk-addon-api + 0.2 + + + javax.servlet + javax.servlet-api + 3.1.0 + + + org.slf4j + slf4j-simple + 1.7.10 + + + org.apache.sling + org.apache.sling.commons.osgi + 2.4.0 + + + org.apache.sling + org.apache.sling.testing.osgi-mock.core + 3.1.2 + + + com.sun.mail + smtp + 1.5.4 + + + org.yaml + snakeyaml + 2.0 + + + org.springframework + spring-instrument-tomcat + 4.3.23.RELEASE + + + org.springframework + spring-instrument + 5.3.33 + + + org.springframework + spring-test + 5.3.33 + + + taglibrarydoc + tlddoc + 1.3 + + + org.apache.tomcat + tomcat-api + 9.0.87 + + + org.apache.tomcat + tomcat-coyote + 9.0.87 + + + org.apache.tomcat + tomcat-util-scan + 9.0.87 + + + org.apache.tomcat + tomcat-util + 9.0.87 + + + velocity-tools + velocity-tools + 1.4 + + + com.liferay + org.apache.velocity + 1.6.4.LIFERAY-PATCHED-3 + + + javax.websocket + javax.websocket-api + 1.1 + + + org.xmlresolver + xmlresolver + 0.12.5 + + + com.liferay + org.apache.commons.configuration + 1.10.LIFERAY-PATCHED-2 + + + commons-lang + commons-lang + 2.6 + + + com.liferay + org.apache.commons.logging + 1.2.LIFERAY-PATCHED-2 + + + org.dom4j + dom4j + 2.1.3 + + + com.liferay + org.hibernate.core + 5.6.7.LIFERAY-PATCHED-2 + + + com.zaxxer + HikariCP + 4.0.3 + + + com.sun.istack + istack-commons-runtime + 3.0.7 + + + com.liferay + org.jabsorb + 1.3.2.LIFERAY-PATCHED-2 + + + org.javassist + javassist + 3.29.0-GA + + + javax.xml.bind + jaxb-api + 2.3.0 + + + com.liferay + org.glassfish.jaxb.runtime + 2.3.1.LIFERAY-PATCHED-2 + + + jaxen + jaxen + 1.1.6 + + + javax.xml.ws + jaxws-api + 2.3.0 + + + org.slf4j + jcl-over-slf4j + 1.7.2 + + + org.jodd + jodd-json + 6.0.3 + + + com.liferay + jodd.util + 6.0.1.LIFERAY-PATCHED-2 + + + org.json + json + 20231013 + + + javax.jws + javax.jws-api + 1.1 + + + com.liferay + org.apache.logging.log4j + 2.17.1.LIFERAY-PATCHED-1 + + + com.liferay + org.apache.logging.log4j.core + 2.17.1.LIFERAY-PATCHED-1 + + + org.eclipse.persistence + javax.persistence + 2.2.1 + + + javax.portlet + portlet-api + 3.0.1 + + + org.slf4j + slf4j-api + 1.7.26 + + + javax.xml.soap + javax.xml.soap-api + 1.4.0 + + + org.springframework + spring-aop + 5.3.33 + + + com.liferay + org.springframework.beans + 5.3.33.LIFERAY-PATCHED-1 + + + org.springframework + spring-context + 5.3.33 + + + org.springframework + spring-core + 5.3.33 + + + org.springframework + spring-expression + 5.3.33 + + + org.springframework + spring-jdbc + 5.3.33 + + + com.liferay + org.springframework.orm + 5.3.33.LIFERAY-PATCHED-1 + + + com.liferay + org.springframework.tx + 5.3.33.LIFERAY-PATCHED-1 + + + org.springframework + spring-web + 5.3.34 + + + org.jvnet.staxex + stax-ex + 1.2 + + + javax.transaction + javax.transaction-api + 1.3 + + + org.codehaus.woodstox + wstx-asl + 3.2.8 + + + xerces + xercesImpl + 2.12.2 + + + xml-apis + xml-apis + 1.4.01 + + + + diff --git a/release/test_bom.sh b/release/test_bom.sh index 041844c28..cdb84860f 100755 --- a/release/test_bom.sh +++ b/release/test_bom.sh @@ -8,11 +8,13 @@ function main { set_up test_dxp_generate_pom_release_bom_compile_only + test_dxp_generate_pom_release_bom_third_party _PRODUCT_VERSION="7.4.3.120-ga120" LIFERAY_RELEASE_PRODUCT_NAME="portal" test_portal_generate_pom_release_bom_compile_only + test_portal_generate_pom_release_bom_third_party tear_down } @@ -49,6 +51,32 @@ function tear_down { unset LIFERAY_RELEASE_PRODUCT_NAME } +function test_dxp_generate_pom_release_bom_third_party { + generate_pom_release_bom_compile_only + + generate_pom_release_bom_third_party + + assert_equals \ + release.${LIFERAY_RELEASE_PRODUCT_NAME}.bom.third.party-${_PRODUCT_VERSION}-${_BUILD_TIMESTAMP}.pom \ + test-dependencies/expected.dxp.release.bom.third.party.pom + + rm release.${LIFERAY_RELEASE_PRODUCT_NAME}.bom.compile.only-${_PRODUCT_VERSION}-${_BUILD_TIMESTAMP}.pom + rm release.${LIFERAY_RELEASE_PRODUCT_NAME}.bom.third.party-${_PRODUCT_VERSION}-${_BUILD_TIMESTAMP}.pom +} + +function test_portal_generate_pom_release_bom_third_party { + generate_pom_release_bom_compile_only + + generate_pom_release_bom_third_party + + assert_equals \ + release.${LIFERAY_RELEASE_PRODUCT_NAME}.bom.third.party-${_PRODUCT_VERSION}-${_BUILD_TIMESTAMP}.pom \ + test-dependencies/expected.portal.release.bom.third.party.pom + + rm release.${LIFERAY_RELEASE_PRODUCT_NAME}.bom.compile.only-${_PRODUCT_VERSION}-${_BUILD_TIMESTAMP}.pom + rm release.${LIFERAY_RELEASE_PRODUCT_NAME}.bom.third.party-${_PRODUCT_VERSION}-${_BUILD_TIMESTAMP}.pom +} + function test_dxp_generate_pom_release_bom_compile_only { generate_pom_release_bom_compile_only From abfd22e52d2c1e6046a5ac2a76dc87f46a28cbf1 Mon Sep 17 00:00:00 2001 From: Renato Rego Date: Tue, 30 Jul 2024 22:32:26 -0300 Subject: [PATCH 022/140] LPD-31468 SF --- release/_test_common.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/release/_test_common.sh b/release/_test_common.sh index ec872d13b..f07a4dd70 100755 --- a/release/_test_common.sh +++ b/release/_test_common.sh @@ -3,13 +3,15 @@ function assert_equals { local parameters=() - for parameter in ${@}; do + for parameter in ${@} + do parameters+=(${parameter}) done local assertion_result="false" - for index in ${!parameters[@]}; do + for index in ${!parameters[@]} + do if [ $((index % 2)) -ne 0 ] then continue From 067f859c0008d0bda0f76b7961c228bd99aa3926 Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Mon, 5 Aug 2024 15:23:54 -0300 Subject: [PATCH 023/140] LPD-31468 Sublime sort --- release/test_bom.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/test_bom.sh b/release/test_bom.sh index cdb84860f..1492bab50 100755 --- a/release/test_bom.sh +++ b/release/test_bom.sh @@ -10,8 +10,8 @@ function main { test_dxp_generate_pom_release_bom_compile_only test_dxp_generate_pom_release_bom_third_party - _PRODUCT_VERSION="7.4.3.120-ga120" LIFERAY_RELEASE_PRODUCT_NAME="portal" + _PRODUCT_VERSION="7.4.3.120-ga120" test_portal_generate_pom_release_bom_compile_only test_portal_generate_pom_release_bom_third_party From f04b1da5131044fce6269cab19e3ded164220449 Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Mon, 5 Aug 2024 15:25:29 -0300 Subject: [PATCH 024/140] LPD-31468 Sublime sort --- release/test_bom.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/release/test_bom.sh b/release/test_bom.sh index 1492bab50..9906daaa7 100755 --- a/release/test_bom.sh +++ b/release/test_bom.sh @@ -20,16 +20,14 @@ function main { } function set_up { + export LIFERAY_RELEASE_PRODUCT_NAME="dxp" export _BUILD_TIMESTAMP=12345 export _PRODUCT_VERSION="2024.q2.6" export _RELEASE_ROOT_DIR="${PWD}" export _PROJECTS_DIR="${_RELEASE_ROOT_DIR}"/../.. - export _RELEASE_TOOL_DIR="${_RELEASE_ROOT_DIR}" - export LIFERAY_RELEASE_PRODUCT_NAME="dxp" - cd "${_PROJECTS_DIR}"/liferay-portal-ee git branch --delete "${_PRODUCT_VERSION}" &> /dev/null @@ -42,13 +40,12 @@ function set_up { } function tear_down { + unset LIFERAY_RELEASE_PRODUCT_NAME unset _BUILD_TIMESTAMP unset _PRODUCT_VERSION unset _PROJECTS_DIR unset _RELEASE_ROOT_DIR unset _RELEASE_TOOL_DIR - - unset LIFERAY_RELEASE_PRODUCT_NAME } function test_dxp_generate_pom_release_bom_third_party { From 9969df2f312bac284f8e2a3e3e0d381a14b416b6 Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Mon, 5 Aug 2024 15:26:10 -0300 Subject: [PATCH 025/140] LPD-31468 Follow our Java pattern --- release/test_bom.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/release/test_bom.sh b/release/test_bom.sh index 9906daaa7..665df0290 100755 --- a/release/test_bom.sh +++ b/release/test_bom.sh @@ -7,14 +7,14 @@ source _test_common.sh function main { set_up - test_dxp_generate_pom_release_bom_compile_only - test_dxp_generate_pom_release_bom_third_party + test_generate_pom_release_bom_compile_only_dxp + test_generate_pom_release_bom_third_party_dxp LIFERAY_RELEASE_PRODUCT_NAME="portal" _PRODUCT_VERSION="7.4.3.120-ga120" - test_portal_generate_pom_release_bom_compile_only - test_portal_generate_pom_release_bom_third_party + test_generate_pom_release_bom_compile_only_portal + test_generate_pom_release_bom_third_party_portal tear_down } @@ -48,7 +48,7 @@ function tear_down { unset _RELEASE_TOOL_DIR } -function test_dxp_generate_pom_release_bom_third_party { +function test_generate_pom_release_bom_third_party_dxp { generate_pom_release_bom_compile_only generate_pom_release_bom_third_party @@ -61,7 +61,7 @@ function test_dxp_generate_pom_release_bom_third_party { rm release.${LIFERAY_RELEASE_PRODUCT_NAME}.bom.third.party-${_PRODUCT_VERSION}-${_BUILD_TIMESTAMP}.pom } -function test_portal_generate_pom_release_bom_third_party { +function test_generate_pom_release_bom_third_party_portal { generate_pom_release_bom_compile_only generate_pom_release_bom_third_party @@ -74,7 +74,7 @@ function test_portal_generate_pom_release_bom_third_party { rm release.${LIFERAY_RELEASE_PRODUCT_NAME}.bom.third.party-${_PRODUCT_VERSION}-${_BUILD_TIMESTAMP}.pom } -function test_dxp_generate_pom_release_bom_compile_only { +function test_generate_pom_release_bom_compile_only_dxp { generate_pom_release_bom_compile_only assert_equals \ @@ -84,7 +84,7 @@ function test_dxp_generate_pom_release_bom_compile_only { rm release.${LIFERAY_RELEASE_PRODUCT_NAME}.bom.compile.only-${_PRODUCT_VERSION}-${_BUILD_TIMESTAMP}.pom } -function test_portal_generate_pom_release_bom_compile_only { +function test_generate_pom_release_bom_compile_only_portal { generate_pom_release_bom_compile_only assert_equals \ From 82948fc4584718b7712d6775a514e765afd8f772 Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Mon, 5 Aug 2024 15:26:32 -0300 Subject: [PATCH 026/140] LPD-31468 Sort --- release/test_bom.sh | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/release/test_bom.sh b/release/test_bom.sh index 665df0290..3add995f5 100755 --- a/release/test_bom.sh +++ b/release/test_bom.sh @@ -48,50 +48,50 @@ function tear_down { unset _RELEASE_TOOL_DIR } -function test_generate_pom_release_bom_third_party_dxp { +function test_generate_pom_release_bom_compile_only_dxp { generate_pom_release_bom_compile_only - generate_pom_release_bom_third_party - assert_equals \ - release.${LIFERAY_RELEASE_PRODUCT_NAME}.bom.third.party-${_PRODUCT_VERSION}-${_BUILD_TIMESTAMP}.pom \ - test-dependencies/expected.dxp.release.bom.third.party.pom + release.${LIFERAY_RELEASE_PRODUCT_NAME}.bom.compile.only-${_PRODUCT_VERSION}-${_BUILD_TIMESTAMP}.pom \ + test-dependencies/expected.dxp.release.bom.compile.only.pom rm release.${LIFERAY_RELEASE_PRODUCT_NAME}.bom.compile.only-${_PRODUCT_VERSION}-${_BUILD_TIMESTAMP}.pom - rm release.${LIFERAY_RELEASE_PRODUCT_NAME}.bom.third.party-${_PRODUCT_VERSION}-${_BUILD_TIMESTAMP}.pom } -function test_generate_pom_release_bom_third_party_portal { +function test_generate_pom_release_bom_compile_only_portal { generate_pom_release_bom_compile_only - generate_pom_release_bom_third_party - assert_equals \ - release.${LIFERAY_RELEASE_PRODUCT_NAME}.bom.third.party-${_PRODUCT_VERSION}-${_BUILD_TIMESTAMP}.pom \ - test-dependencies/expected.portal.release.bom.third.party.pom + release.${LIFERAY_RELEASE_PRODUCT_NAME}.bom.compile.only-${_PRODUCT_VERSION}-${_BUILD_TIMESTAMP}.pom \ + test-dependencies/expected.portal.release.bom.compile.only.pom rm release.${LIFERAY_RELEASE_PRODUCT_NAME}.bom.compile.only-${_PRODUCT_VERSION}-${_BUILD_TIMESTAMP}.pom - rm release.${LIFERAY_RELEASE_PRODUCT_NAME}.bom.third.party-${_PRODUCT_VERSION}-${_BUILD_TIMESTAMP}.pom } -function test_generate_pom_release_bom_compile_only_dxp { +function test_generate_pom_release_bom_third_party_dxp { generate_pom_release_bom_compile_only + generate_pom_release_bom_third_party + assert_equals \ - release.${LIFERAY_RELEASE_PRODUCT_NAME}.bom.compile.only-${_PRODUCT_VERSION}-${_BUILD_TIMESTAMP}.pom \ - test-dependencies/expected.dxp.release.bom.compile.only.pom + release.${LIFERAY_RELEASE_PRODUCT_NAME}.bom.third.party-${_PRODUCT_VERSION}-${_BUILD_TIMESTAMP}.pom \ + test-dependencies/expected.dxp.release.bom.third.party.pom rm release.${LIFERAY_RELEASE_PRODUCT_NAME}.bom.compile.only-${_PRODUCT_VERSION}-${_BUILD_TIMESTAMP}.pom + rm release.${LIFERAY_RELEASE_PRODUCT_NAME}.bom.third.party-${_PRODUCT_VERSION}-${_BUILD_TIMESTAMP}.pom } -function test_generate_pom_release_bom_compile_only_portal { +function test_generate_pom_release_bom_third_party_portal { generate_pom_release_bom_compile_only + generate_pom_release_bom_third_party + assert_equals \ - release.${LIFERAY_RELEASE_PRODUCT_NAME}.bom.compile.only-${_PRODUCT_VERSION}-${_BUILD_TIMESTAMP}.pom \ - test-dependencies/expected.portal.release.bom.compile.only.pom + release.${LIFERAY_RELEASE_PRODUCT_NAME}.bom.third.party-${_PRODUCT_VERSION}-${_BUILD_TIMESTAMP}.pom \ + test-dependencies/expected.portal.release.bom.third.party.pom rm release.${LIFERAY_RELEASE_PRODUCT_NAME}.bom.compile.only-${_PRODUCT_VERSION}-${_BUILD_TIMESTAMP}.pom + rm release.${LIFERAY_RELEASE_PRODUCT_NAME}.bom.third.party-${_PRODUCT_VERSION}-${_BUILD_TIMESTAMP}.pom } main \ No newline at end of file From 1418bc0a04b7c411eadcbd58057e48616bb58391 Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Mon, 5 Aug 2024 15:28:54 -0300 Subject: [PATCH 027/140] LPD-31468 Rename --- release/_test_common.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/release/_test_common.sh b/release/_test_common.sh index f07a4dd70..d7e9dc3b9 100755 --- a/release/_test_common.sh +++ b/release/_test_common.sh @@ -1,33 +1,33 @@ #!/bin/bash function assert_equals { - local parameters=() + local arguments=() - for parameter in ${@} + for argument in ${@} do - parameters+=(${parameter}) + arguments+=(${argument}) done local assertion_result="false" - for index in ${!parameters[@]} + for index in ${!arguments[@]} do if [ $((index % 2)) -ne 0 ] then continue fi - if [ -f "${parameters[${index}]}" ] && - [ -f "${parameters[${index} + 1]}" ] + if [ -f "${arguments[${index}]}" ] && + [ -f "${arguments[${index} + 1]}" ] then - diff "${parameters[${index}]}" "${parameters[${index} + 1]}" + diff "${arguments[${index}]}" "${arguments[${index} + 1]}" if [ "${?}" -eq 0 ] then assertion_result="true" fi else - if [ "${parameters[${index}]}" == "${parameters[${index} + 1]}" ] + if [ "${arguments[${index}]}" == "${arguments[${index} + 1]}" ] then assertion_result="true" fi From 1c3f6d1438b3950449c6ff7539f43595b6c21adb Mon Sep 17 00:00:00 2001 From: Renato Rego Date: Tue, 6 Aug 2024 10:42:31 -0300 Subject: [PATCH 028/140] u125 --- bundles.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/bundles.yml b/bundles.yml index b05bd1263..d033ebcea 100644 --- a/bundles.yml +++ b/bundles.yml @@ -687,6 +687,7 @@ 7.4.13-u122: 7.4.13-u123: 7.4.13-u124: + 7.4.13-u125: 7.4.13.nightly: bundle_url: releases-cdn.liferay.com/dxp/nightly/liferay-dxp-tomcat-7.4.13.nightly.7z quarterly: From fc537c3d906cd4745bccbc784b4c337cd9a22380 Mon Sep 17 00:00:00 2001 From: Renato Rego Date: Tue, 6 Aug 2024 16:09:46 -0300 Subject: [PATCH 029/140] 2024.q2.8 --- bundles.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/bundles.yml b/bundles.yml index d033ebcea..4fcea807d 100644 --- a/bundles.yml +++ b/bundles.yml @@ -731,6 +731,7 @@ quarterly: 2024.q2.5: 2024.q2.6: 2024.q2.7: + 2024.q2.8: latest: true snapshot: snapshot-master: From 643b9819b0d590ad2e1a92155107ffef437944d6 Mon Sep 17 00:00:00 2001 From: Pedro Malta Date: Tue, 6 Aug 2024 10:19:47 -0300 Subject: [PATCH 030/140] LPD-30139 Add the dependencies.jar for 7.3 package releases --- release/_package.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/release/_package.sh b/release/_package.sh index 0b3e4b6f6..d2bfed3da 100644 --- a/release/_package.sh +++ b/release/_package.sh @@ -183,6 +183,28 @@ function package_release { lc_cd "${_BUILD_DIR}/release" + if [[ "${_PRODUCT_VERSION}" == 7.3* ]] + then + if [ -d "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}" ] + then + rm -fr "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}" + fi + + mkdir -p "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}" + + cp "${_PROJECTS_DIR}"/liferay-portal-ee/lib/development/hsql.jar "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}" + + cp "${_PROJECTS_DIR}"/liferay-portal-ee/lib/global/*.jar "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}" + + cp "${_PROJECTS_DIR}"/liferay-portal-ee/portal-kernel/portal-kernel.jar "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}" + + mv "${_PROJECTS_DIR}"/liferay-portal-ee/tools/sdk/dist/com.liferay.registry.api-*.jar "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}/com.liferay.registry.api.jar" + + zip -qr "${_BUILD_DIR}/release/liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}-${_BUILD_TIMESTAMP}.zip" "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}" + + rm -fr "${_BUILD_DIR}/release/liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}" + fi + 7z a "${_BUILD_DIR}/release/liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-tomcat-${_PRODUCT_VERSION}-${_BUILD_TIMESTAMP}.7z" liferay-${LIFERAY_RELEASE_PRODUCT_NAME} echo "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-tomcat-${_PRODUCT_VERSION}-${_BUILD_TIMESTAMP}.7z" > "${_BUILD_DIR}"/release/.lfrrelease-tomcat-bundle From 6c650834592eea0d38b84ecd7144d96f40cf2cdf Mon Sep 17 00:00:00 2001 From: Renato Rego Date: Wed, 7 Aug 2024 10:20:33 -0300 Subject: [PATCH 031/140] LPD-30139 Optimize --- release/_package.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/release/_package.sh b/release/_package.sh index d2bfed3da..960cb35bb 100644 --- a/release/_package.sh +++ b/release/_package.sh @@ -185,10 +185,7 @@ function package_release { if [[ "${_PRODUCT_VERSION}" == 7.3* ]] then - if [ -d "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}" ] - then - rm -fr "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}" - fi + rm -fr "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}" 2> /dev/null mkdir -p "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}" From 37b08756747b9672ab2c5e38c5f2c39f5b4fb309 Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Wed, 7 Aug 2024 11:10:44 -0300 Subject: [PATCH 032/140] LPD-30139 Impossible to print anything with 'rm -fr' right? --- release/_package.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/_package.sh b/release/_package.sh index 960cb35bb..18a93adeb 100644 --- a/release/_package.sh +++ b/release/_package.sh @@ -185,7 +185,7 @@ function package_release { if [[ "${_PRODUCT_VERSION}" == 7.3* ]] then - rm -fr "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}" 2> /dev/null + rm -fr "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}" mkdir -p "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}" From 7bfee20403ab6ef49b7dbda525c6300f3f27f592 Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Wed, 7 Aug 2024 11:11:42 -0300 Subject: [PATCH 033/140] LPD-30139 SF --- release/_package.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/release/_package.sh b/release/_package.sh index 18a93adeb..3dc066a02 100644 --- a/release/_package.sh +++ b/release/_package.sh @@ -190,9 +190,7 @@ function package_release { mkdir -p "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}" cp "${_PROJECTS_DIR}"/liferay-portal-ee/lib/development/hsql.jar "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}" - cp "${_PROJECTS_DIR}"/liferay-portal-ee/lib/global/*.jar "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}" - cp "${_PROJECTS_DIR}"/liferay-portal-ee/portal-kernel/portal-kernel.jar "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}" mv "${_PROJECTS_DIR}"/liferay-portal-ee/tools/sdk/dist/com.liferay.registry.api-*.jar "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}/com.liferay.registry.api.jar" From cffa5432bab5057f03bc934bbd116b0c8930a60a Mon Sep 17 00:00:00 2001 From: Lucas Miranda Date: Wed, 7 Aug 2024 14:33:45 -0300 Subject: [PATCH 034/140] LPD-27597 Fix boms generation when releasing 7.3 --- release/_bom.sh | 49 ++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 40 insertions(+), 9 deletions(-) diff --git a/release/_bom.sh b/release/_bom.sh index ae9cd3eb7..1f8fe7139 100644 --- a/release/_bom.sh +++ b/release/_bom.sh @@ -67,15 +67,46 @@ function generate_api_jars { rm -f "${name}-${version}.jar" done - for portal_jar in portal-impl portal-kernel support-tomcat util-bridges util-java util-slf4j util-taglib - do - _manage_bom_jar "${_BUNDLES_DIR}/tomcat/webapps/ROOT/WEB-INF/shielded-container-lib/${portal_jar}.jar" - done + if [[ "${_PRODUCT_VERSION}" == "7.3."* ]] + then + for portal_jar in portal-kernel support-tomcat + do + _manage_bom_jar "${_BUNDLES_DIR}/tomcat/lib/ext/${portal_jar}.jar" + done - find "${_BUNDLES_DIR}/osgi" "${_BUNDLES_DIR}/tomcat/webapps/ROOT/WEB-INF/shielded-container-lib" -name "com.liferay.*.jar" -type f -print0 | while IFS= read -r -d '' module_jar - do - _manage_bom_jar "${module_jar}" - done + for portal_jar in portal-impl util-bridges util-java util-slf4j util-taglib + do + _manage_bom_jar "${_BUNDLES_DIR}/tomcat/webapps/ROOT/WEB-INF/lib/${portal_jar}.jar" + done + + find "${_BUNDLES_DIR}/osgi" "${_BUNDLES_DIR}/tomcat/lib/ext" "${_BUNDLES_DIR}/tomcat/webapps/ROOT/WEB-INF/lib" -name "com.liferay.*.jar" -type f -print0 | while IFS= read -r -d '' module_jar + do + _manage_bom_jar "${module_jar}" + done + + for artifact in "commons*.jar" "org.apache.commons.*.jar" "poi*.jar" "spring*.jar" + do + find "${_BUNDLES_DIR}/tomcat/webapps/ROOT/WEB-INF/lib" -name "${artifact}" -type f -print0 | while IFS= read -r -d '' module_jar + do + local module_jar_basename=$(basename "${module_jar}") + + if (grep $(echo "${module_jar_basename%.jar}:") "${_PROJECTS_DIR}/liferay-portal-ee/lib/development/dependencies.properties" || grep $(echo "${module_jar_basename%.jar}:") "${_PROJECTS_DIR}/liferay-portal-ee/lib/portal/dependencies.properties") + then + _manage_bom_jar "${module_jar}" + fi + done + done + else + for portal_jar in portal-impl portal-kernel support-tomcat util-bridges util-java util-slf4j util-taglib + do + _manage_bom_jar "${_BUNDLES_DIR}/tomcat/webapps/ROOT/WEB-INF/shielded-container-lib/${portal_jar}.jar" + done + + find "${_BUNDLES_DIR}/osgi" "${_BUNDLES_DIR}/tomcat/webapps/ROOT/WEB-INF/shielded-container-lib" -name "com.liferay.*.jar" -type f -print0 | while IFS= read -r -d '' module_jar + do + _manage_bom_jar "${module_jar}" + done + fi } function generate_api_source_jar { @@ -179,7 +210,7 @@ function generate_pom_release_bom { > /tmp/artifact_urls.txt for artifact_file in $( - find "${_BUNDLES_DIR}/osgi" "${_BUNDLES_DIR}/tomcat/webapps/ROOT/WEB-INF" -name '*.jar' | \ + find "${_BUNDLES_DIR}/osgi" "${_BUNDLES_DIR}/tomcat/lib/ext" "${_BUNDLES_DIR}/tomcat/webapps/ROOT/WEB-INF" -name '*.jar' | \ sed \ -e 's/\.jar$//' \ -e "s@.*/@@" \ From b934d5d2b161eb607d56e540faae6f14501bc172 Mon Sep 17 00:00:00 2001 From: Pedro Malta Date: Thu, 18 Jul 2024 16:07:54 -0300 Subject: [PATCH 035/140] LPD-29676 Add support to GA/Portal versions and add support to internal releases --- release/_publishing.sh | 40 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/release/_publishing.sh b/release/_publishing.sh index fb9c33523..900f0d2bf 100644 --- a/release/_publishing.sh +++ b/release/_publishing.sh @@ -166,17 +166,49 @@ function upload_to_docker_hub { } function _update_bundles_yml { - if (yq eval ".quarterly | has(\"${_PRODUCT_VERSION}\")" "${BASE_DIR}/bundles.yml" | grep -q "true") + local product_version_key="$(echo "${_PRODUCT_VERSION}" | cut -d '-' -f 1)" + + if (yq eval ".quarterly | has(\"${_PRODUCT_VERSION}\")" "${BASE_DIR}/bundles.yml" | grep -q "true") || + (yq eval ".\"${product_version_key}\" | has(\"${_PRODUCT_VERSION}\")" "${BASE_DIR}/bundles.yml" | grep -q "true") then lc_log INFO "The ${_PRODUCT_VERSION} product version was already published." return "${LIFERAY_COMMON_EXIT_CODE_SKIPPED}" fi - local latest_key=$(yq eval ".quarterly | keys | .[-1]" "${BASE_DIR}/bundles.yml") + if [[ "${_PRODUCT_VERSION}" == *q* ]] + then + local latest_key=$(yq eval ".quarterly | keys | .[-1]" "${BASE_DIR}/bundles.yml") + + yq --indent 4 --inplace eval "del(.quarterly.\"${latest_key}\".latest)" "${BASE_DIR}/bundles.yml" + yq --indent 4 --inplace eval ".quarterly.\"${_PRODUCT_VERSION}\".latest = true" "${BASE_DIR}/bundles.yml" + fi + + if [[ "${_PRODUCT_VERSION}" == 7.3.* ]] + then + yq --indent 4 --inplace eval ".\"${product_version_key}\".\"${_PRODUCT_VERSION}\" = {}" "${BASE_DIR}/bundles.yml" + fi + + if [[ "${_PRODUCT_VERSION}" == 7.4.*-u* ]] + then + local nightly_bundle_url=$(yq eval ".\"${product_version_key}\".\"${product_version_key}.nightly\".bundle_url" "${BASE_DIR}/bundles.yml") + + yq --indent 4 --inplace eval "del(.\"${product_version_key}\".\"${product_version_key}.nightly\")" "${BASE_DIR}/bundles.yml" + yq --indent 4 --inplace eval ".\"${product_version_key}\".\"${_PRODUCT_VERSION}\" = {}" "${BASE_DIR}/bundles.yml" + yq --indent 4 --inplace eval ".\"${product_version_key}\".\"${product_version_key}.nightly\".bundle_url = \"${nightly_bundle_url}\"" "${BASE_DIR}/bundles.yml" + fi + + if [[ "${_PRODUCT_VERSION}" == 7.4.*-ga* ]] + then + local ga_bundle_url="releases-cdn.liferay.com/portal/${_PRODUCT_VERSION}/"$(curl -fsSL "https://releases-cdn.liferay.com/portal/${_PRODUCT_VERSION}/.lfrrelease-tomcat-bundle") + + perl -i -0777pe 's/\s+latest: true(?!7.4.13:)//' "${BASE_DIR}/bundles.yml" - yq --indent 4 --inplace eval "del(.quarterly.\"${latest_key}\".latest)" "${BASE_DIR}/bundles.yml" - yq --indent 4 --inplace eval ".quarterly.\"${_PRODUCT_VERSION}\".latest = true" "${BASE_DIR}/bundles.yml" + sed -i "/7.4.13:/i ${product_version_key}:" "${BASE_DIR}/bundles.yml" + + yq --indent 4 --inplace eval ".\"${product_version_key}\".\"${_PRODUCT_VERSION}\".bundle_url = \"${ga_bundle_url}\"" "${BASE_DIR}/bundles.yml" + yq --indent 4 --inplace eval ".\"${product_version_key}\".\"${_PRODUCT_VERSION}\".latest = true" "${BASE_DIR}/bundles.yml" + fi sed -i "s/[[:space:]]{}//g" "${BASE_DIR}/bundles.yml" From 016e616188847e55e7eec759845482ea9afe6b53 Mon Sep 17 00:00:00 2001 From: Renato Rego Date: Thu, 25 Jul 2024 10:41:58 -0300 Subject: [PATCH 036/140] LPD-29676 Do not download bundle from CDN to prevent issues --- build_all_images.sh | 2 +- release/_publishing.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build_all_images.sh b/build_all_images.sh index 528823d43..8a87ceba2 100755 --- a/build_all_images.sh +++ b/build_all_images.sh @@ -67,7 +67,7 @@ function build_bundle_image { if [ -z "${bundle_url}" ] then - bundle_url="releases-cdn.liferay.com/dxp/${version}/"$(curl -fsSL "https://releases-cdn.liferay.com/dxp/${version}/.lfrrelease-tomcat-bundle") + bundle_url="releases.liferay.com/dxp/${version}/"$(curl -fsSL "https://releases.liferay.com/dxp/${version}/.lfrrelease-tomcat-bundle") fi if [ -n "${additional_tags}" ] diff --git a/release/_publishing.sh b/release/_publishing.sh index 900f0d2bf..08acc7b99 100644 --- a/release/_publishing.sh +++ b/release/_publishing.sh @@ -200,7 +200,7 @@ function _update_bundles_yml { if [[ "${_PRODUCT_VERSION}" == 7.4.*-ga* ]] then - local ga_bundle_url="releases-cdn.liferay.com/portal/${_PRODUCT_VERSION}/"$(curl -fsSL "https://releases-cdn.liferay.com/portal/${_PRODUCT_VERSION}/.lfrrelease-tomcat-bundle") + local ga_bundle_url="releases-cdn.liferay.com/portal/${_PRODUCT_VERSION}/"$(curl -fsSL "https://releases.liferay.com/portal/${_PRODUCT_VERSION}/.lfrrelease-tomcat-bundle") perl -i -0777pe 's/\s+latest: true(?!7.4.13:)//' "${BASE_DIR}/bundles.yml" From 6dae613eeabe89ae0c54761fa997927cdff845f2 Mon Sep 17 00:00:00 2001 From: Renato Rego Date: Thu, 8 Aug 2024 09:10:05 -0300 Subject: [PATCH 037/140] LPD-29676 SF --- release/_publishing.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/_publishing.sh b/release/_publishing.sh index 08acc7b99..9321dbafc 100644 --- a/release/_publishing.sh +++ b/release/_publishing.sh @@ -169,7 +169,7 @@ function _update_bundles_yml { local product_version_key="$(echo "${_PRODUCT_VERSION}" | cut -d '-' -f 1)" if (yq eval ".quarterly | has(\"${_PRODUCT_VERSION}\")" "${BASE_DIR}/bundles.yml" | grep -q "true") || - (yq eval ".\"${product_version_key}\" | has(\"${_PRODUCT_VERSION}\")" "${BASE_DIR}/bundles.yml" | grep -q "true") + (yq eval ".\"${product_version_key}\" | has(\"${_PRODUCT_VERSION}\")" "${BASE_DIR}/bundles.yml" | grep -q "true") then lc_log INFO "The ${_PRODUCT_VERSION} product version was already published." From 46768d6c17a8327068c13f4f5f668d4972afea4c Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Thu, 8 Aug 2024 10:42:06 -0300 Subject: [PATCH 038/140] LPD-29676 Sublime sort --- release/_publishing.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release/_publishing.sh b/release/_publishing.sh index 9321dbafc..d6f4e5dfa 100644 --- a/release/_publishing.sh +++ b/release/_publishing.sh @@ -168,8 +168,8 @@ function upload_to_docker_hub { function _update_bundles_yml { local product_version_key="$(echo "${_PRODUCT_VERSION}" | cut -d '-' -f 1)" - if (yq eval ".quarterly | has(\"${_PRODUCT_VERSION}\")" "${BASE_DIR}/bundles.yml" | grep -q "true") || - (yq eval ".\"${product_version_key}\" | has(\"${_PRODUCT_VERSION}\")" "${BASE_DIR}/bundles.yml" | grep -q "true") + if (yq eval ".\"${product_version_key}\" | has(\"${_PRODUCT_VERSION}\")" "${BASE_DIR}/bundles.yml" | grep -q "true") || + (yq eval ".quarterly | has(\"${_PRODUCT_VERSION}\")" "${BASE_DIR}/bundles.yml" | grep -q "true") then lc_log INFO "The ${_PRODUCT_VERSION} product version was already published." From 3c45d541d7f04176c7b7023ba38077b3c6e33cf8 Mon Sep 17 00:00:00 2001 From: Pedro Malta Date: Thu, 8 Aug 2024 09:23:45 -0300 Subject: [PATCH 039/140] LPD-30139 Using 'cp' instead of an 'mv' --- release/_package.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/release/_package.sh b/release/_package.sh index 3dc066a02..c91fefcb4 100644 --- a/release/_package.sh +++ b/release/_package.sh @@ -192,8 +192,7 @@ function package_release { cp "${_PROJECTS_DIR}"/liferay-portal-ee/lib/development/hsql.jar "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}" cp "${_PROJECTS_DIR}"/liferay-portal-ee/lib/global/*.jar "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}" cp "${_PROJECTS_DIR}"/liferay-portal-ee/portal-kernel/portal-kernel.jar "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}" - - mv "${_PROJECTS_DIR}"/liferay-portal-ee/tools/sdk/dist/com.liferay.registry.api-*.jar "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}/com.liferay.registry.api.jar" + cp "${_PROJECTS_DIR}"/liferay-portal-ee/tools/sdk/dist/com.liferay.registry.api-*.jar "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}/com.liferay.registry.api.jar" zip -qr "${_BUILD_DIR}/release/liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}-${_BUILD_TIMESTAMP}.zip" "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}" From a7a20c91909b404447e1e77bcc2d9f61956b4f70 Mon Sep 17 00:00:00 2001 From: Zsolt Balogh Date: Mon, 13 May 2024 16:12:34 +0200 Subject: [PATCH 040/140] DOCKER-249 Ensure that all needed modules are loaded before reporting success --- templates/bundle/Dockerfile | 1 + .../local/bin/monitor_liferay_lifecycle.sh | 52 ++++++++++++++++--- 2 files changed, 47 insertions(+), 6 deletions(-) diff --git a/templates/bundle/Dockerfile b/templates/bundle/Dockerfile index 5a86cc7f7..f7d4b165b 100644 --- a/templates/bundle/Dockerfile +++ b/templates/bundle/Dockerfile @@ -39,6 +39,7 @@ ENV LIFERAY_CONTAINER_STATUS_ENABLED="false" ENV LIFERAY_CONTAINER_STATUS_REQUEST_CONTENT= ENV LIFERAY_CONTAINER_STATUS_REQUEST_TIMEOUT=10 ENV LIFERAY_CONTAINER_STATUS_REQUEST_URL=http://localhost:8080/c/portal/robots +ENV LIFERAY_CONTAINER_STATUS_ACTIVE_MODULES= ENV LIFERAY_DISABLE_TRIAL_LICENSE=false ENV LIFERAY_DOCKER_HOTFIX= ENV LIFERAY_DOCKER_THREAD_DUMP_INTERVAL_FILE=/opt/liferay/data/sre/thread_dump_interval diff --git a/templates/bundle/resources/usr/local/bin/monitor_liferay_lifecycle.sh b/templates/bundle/resources/usr/local/bin/monitor_liferay_lifecycle.sh index f26a9a582..aebca68c1 100755 --- a/templates/bundle/resources/usr/local/bin/monitor_liferay_lifecycle.sh +++ b/templates/bundle/resources/usr/local/bin/monitor_liferay_lifecycle.sh @@ -39,22 +39,28 @@ function kill_service { function main { local curl_max_time=$((LIFERAY_CONTAINER_STATUS_REQUEST_TIMEOUT + 10)) local fail_count=0 + local modules_active=false local started=false + update_container_status liferay-start + + if [ -z "${LIFERAY_CONTAINER_STATUS_ACTIVE_MODULES}" ] + then + modules_active=true + fi + while true do if [ "${started}" != true ] then touch_startup_lock - - update_container_status liferay-start fi local curl_content curl_content=$(curl --connect-timeout "${LIFERAY_CONTAINER_STATUS_REQUEST_TIMEOUT}" --connect-to ":80:localhost:8080" --fail --max-time "${curl_max_time}" --show-error --silent "${LIFERAY_CONTAINER_STATUS_REQUEST_URL}" 2>/dev/null) - local exit_code=$? + local exit_code=${?} if [ ${exit_code} -gt 0 ] then @@ -68,7 +74,7 @@ function main { then curl_content=$(echo "${curl_content}" | grep "${LIFERAY_CONTAINER_STATUS_REQUEST_CONTENT}") - exit_code=$? + exit_code=${?} if [ ${exit_code} -gt 0 ] && [ "${started}" == "true" ] then @@ -84,7 +90,41 @@ function main { started=true - update_container_status live + if [ "${modules_active}" == "true" ] + then + update_container_status live + else + update_container_status waiting-for-modules-to-become-active + fi + fi + + if [ "${modules_active}" == "false" ] && [ "${started}" == "true" ] + then + telnet_content=$( + ( + sleep 1 + echo "ss" + sleep 2 + ) | telnet 127.0.0.1 11311 2>/dev/null + ) + + local active_count=$(echo "${telnet_content}" | grep -E "${LIFERAY_CONTAINER_STATUS_ACTIVE_MODULES}" | grep -c ACTIVE) + + local module_count=$(echo "${telnet_content}" | grep -cE "${LIFERAY_CONTAINER_STATUS_ACTIVE_MODULES}") + + if [ "${module_count}" -eq 0 ] + then + echo "No modules are available yet with the following filter: ${LIFERAY_CONTAINER_STATUS_ACTIVE_MODULES}" + elif [ "${module_count}" -eq "${active_count}" ] + then + update_container_status live + + modules_active=true + else + echo "Modules pending activation:" + + echo "${telnet_content}" | grep -E "${LIFERAY_CONTAINER_STATUS_ACTIVE_MODULES}" | grep -v ACTIVE + fi fi if [ "${LIFERAY_CONTAINER_KILL_ON_FAILURE}" -gt 0 ] && [ ${exit_code} -gt 0 ] && [ "${started}" == "true" ] @@ -97,7 +137,7 @@ function main { fi fi - if [ "${started}" != true ] && [ ${exit_code} -gt 1 ] + if [ "${started}" != "true" ] || [ "${modules_active}" != "true" ] then sleep 3 else From 271affc5c40171406a232eee7d9415530e202b31 Mon Sep 17 00:00:00 2001 From: Renato Rego Date: Thu, 8 Aug 2024 10:00:11 -0300 Subject: [PATCH 041/140] DOCKER-249 Sort --- templates/bundle/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/bundle/Dockerfile b/templates/bundle/Dockerfile index f7d4b165b..70d620ade 100644 --- a/templates/bundle/Dockerfile +++ b/templates/bundle/Dockerfile @@ -35,11 +35,11 @@ ENV JPDA_ADDRESS=0.0.0.0:8000 ENV LIFERAY_CONTAINER_KILL_ON_FAILURE=0 ENV LIFERAY_CONTAINER_STARTUP_LOCK_ENABLED=false ENV LIFERAY_CONTAINER_STARTUP_LOCK_FILE=/opt/liferay/data/liferay-startup-lock +ENV LIFERAY_CONTAINER_STATUS_ACTIVE_MODULES= ENV LIFERAY_CONTAINER_STATUS_ENABLED="false" ENV LIFERAY_CONTAINER_STATUS_REQUEST_CONTENT= ENV LIFERAY_CONTAINER_STATUS_REQUEST_TIMEOUT=10 ENV LIFERAY_CONTAINER_STATUS_REQUEST_URL=http://localhost:8080/c/portal/robots -ENV LIFERAY_CONTAINER_STATUS_ACTIVE_MODULES= ENV LIFERAY_DISABLE_TRIAL_LICENSE=false ENV LIFERAY_DOCKER_HOTFIX= ENV LIFERAY_DOCKER_THREAD_DUMP_INTERVAL_FILE=/opt/liferay/data/sre/thread_dump_interval From 99326c5d45e553abf3b36c992f4a42aa0ec0ec3d Mon Sep 17 00:00:00 2001 From: Renato Rego Date: Thu, 8 Aug 2024 10:01:03 -0300 Subject: [PATCH 042/140] DOCKER-249 SF --- .../bundle/resources/usr/local/bin/monitor_liferay_lifecycle.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/bundle/resources/usr/local/bin/monitor_liferay_lifecycle.sh b/templates/bundle/resources/usr/local/bin/monitor_liferay_lifecycle.sh index aebca68c1..36b42c47f 100755 --- a/templates/bundle/resources/usr/local/bin/monitor_liferay_lifecycle.sh +++ b/templates/bundle/resources/usr/local/bin/monitor_liferay_lifecycle.sh @@ -105,7 +105,7 @@ function main { sleep 1 echo "ss" sleep 2 - ) | telnet 127.0.0.1 11311 2>/dev/null + ) | telnet 127.0.0.1 11311 2> /dev/null ) local active_count=$(echo "${telnet_content}" | grep -E "${LIFERAY_CONTAINER_STATUS_ACTIVE_MODULES}" | grep -c ACTIVE) From c1872171d402d7cbb55acbea1222f3393d25d6b6 Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Thu, 8 Aug 2024 10:47:07 -0300 Subject: [PATCH 043/140] DOCKER-249 Sort --- .../bundle/resources/usr/local/bin/monitor_liferay_lifecycle.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/bundle/resources/usr/local/bin/monitor_liferay_lifecycle.sh b/templates/bundle/resources/usr/local/bin/monitor_liferay_lifecycle.sh index 36b42c47f..819be8eb6 100755 --- a/templates/bundle/resources/usr/local/bin/monitor_liferay_lifecycle.sh +++ b/templates/bundle/resources/usr/local/bin/monitor_liferay_lifecycle.sh @@ -137,7 +137,7 @@ function main { fi fi - if [ "${started}" != "true" ] || [ "${modules_active}" != "true" ] + if [ "${modules_active}" != "true" ] || [ "${started}" != "true" ] then sleep 3 else From 4eff114ee12f51a94949fe8995afa47c3fe3192a Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Thu, 8 Aug 2024 11:23:16 -0300 Subject: [PATCH 044/140] DOCKER-249 local --- .../bundle/resources/usr/local/bin/monitor_liferay_lifecycle.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/bundle/resources/usr/local/bin/monitor_liferay_lifecycle.sh b/templates/bundle/resources/usr/local/bin/monitor_liferay_lifecycle.sh index 819be8eb6..5d1d353ff 100755 --- a/templates/bundle/resources/usr/local/bin/monitor_liferay_lifecycle.sh +++ b/templates/bundle/resources/usr/local/bin/monitor_liferay_lifecycle.sh @@ -100,7 +100,7 @@ function main { if [ "${modules_active}" == "false" ] && [ "${started}" == "true" ] then - telnet_content=$( + local telnet_content=$( ( sleep 1 echo "ss" From 5cfce46d3294a10b5cf592b7201c0f1ce347edd4 Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Thu, 8 Aug 2024 11:23:34 -0300 Subject: [PATCH 045/140] DOCKER-249 SF --- .../bundle/resources/usr/local/bin/monitor_liferay_lifecycle.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/bundle/resources/usr/local/bin/monitor_liferay_lifecycle.sh b/templates/bundle/resources/usr/local/bin/monitor_liferay_lifecycle.sh index 5d1d353ff..8b9eaa3e4 100755 --- a/templates/bundle/resources/usr/local/bin/monitor_liferay_lifecycle.sh +++ b/templates/bundle/resources/usr/local/bin/monitor_liferay_lifecycle.sh @@ -103,7 +103,9 @@ function main { local telnet_content=$( ( sleep 1 + echo "ss" + sleep 2 ) | telnet 127.0.0.1 11311 2> /dev/null ) From 8628596c352954d169cb1d71f9c2968e9fe02f4a Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Thu, 8 Aug 2024 11:23:59 -0300 Subject: [PATCH 046/140] DOCKER-249 Wordsmith --- .../bundle/resources/usr/local/bin/monitor_liferay_lifecycle.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/bundle/resources/usr/local/bin/monitor_liferay_lifecycle.sh b/templates/bundle/resources/usr/local/bin/monitor_liferay_lifecycle.sh index 8b9eaa3e4..45e689bc5 100755 --- a/templates/bundle/resources/usr/local/bin/monitor_liferay_lifecycle.sh +++ b/templates/bundle/resources/usr/local/bin/monitor_liferay_lifecycle.sh @@ -116,7 +116,7 @@ function main { if [ "${module_count}" -eq 0 ] then - echo "No modules are available yet with the following filter: ${LIFERAY_CONTAINER_STATUS_ACTIVE_MODULES}" + echo "No modules are available that match: ${LIFERAY_CONTAINER_STATUS_ACTIVE_MODULES}" elif [ "${module_count}" -eq "${active_count}" ] then update_container_status live From e3a8e25380f1889c6a3ffca5e62d217b54b294eb Mon Sep 17 00:00:00 2001 From: kiwm Date: Fri, 17 May 2024 10:14:05 -0300 Subject: [PATCH 047/140] LRP-4868 Add add_fixed_issues_to_project_version function --- release/_publishing.sh | 79 +++++++++++++++++++++++++++++++++++++++++ release/release_gold.sh | 4 +++ 2 files changed, 83 insertions(+) diff --git a/release/_publishing.sh b/release/_publishing.sh index d6f4e5dfa..d80a922b6 100644 --- a/release/_publishing.sh +++ b/release/_publishing.sh @@ -1,5 +1,84 @@ #!/bin/bash +function add_fixed_issues_to_project_version { + IFS=',' read -r -a fixed_issues_array < "${_BUILD_DIR}/release/release-notes.txt" + + local fixed_issues_array_length="${#fixed_issues_array[@]}" + + local fixed_issues_array_part_length=$((fixed_issues_array_length / 4)) + + for counter in {0..3} + do + local number_of_issues_added=$((counter * fixed_issues_array_part_length)) + + if [ "${counter}" -eq 3 ] + then + fixed_issues_array_part_length=$((fixed_issues_array_length - number_of_issues_added)) + fi + + IFS=',' fixed_issues="${fixed_issues_array[*]:number_of_issues_added:fixed_issues_array_part_length}" + + if (curl \ + "https://patcher.liferay.com/api/jsonws/osb-patcher-portlet.project_versions/updateFixedIssues" \ + --data-raw "fixedIssues=${fixed_issues}&patcherProjectVersionId=${1}" \ + --fail \ + --max-time 10 \ + --output /dev/null \ + --retry 3 \ + --silent \ + --user "${LIFERAY_RELEASE_PATCHER_PORTAL_EMAIL}:${LIFERAY_RELEASE_PATCHER_PORTAL_PASSWORD}") + then + lc_log INFO "Adding fixed issues to the ${_PRODUCT_VERSION} project version." + else + lc_log ERROR "Unable to add the full fixed issues list to the ${_PRODUCT_VERSION} project version." + + return "${LIFERAY_COMMON_EXIT_CODE_BAD}" + fi + done + + lc_log INFO "The full fixed issues list has been added to the ${_PRODUCT_VERSION} project version." +} + +function add_patcher_project_version { + local product_version_label="Quarterly Releases" + + local root_patcher_project_version_name="" + + case "${_PRODUCT_VERSION}" in + 7.4.*) + product_version_label="DXP 7.4" + + root_patcher_project_version_name="7.4.13-ga1" + ;; + 7.3.*) + product_version_label="DXP 7.3" + + root_patcher_project_version_name="fix-pack-base-7310" + ;; + esac + + local add_by_name_response=$(\ + curl \ + "https://patcher.liferay.com/api/jsonws/osb-patcher-portlet.project_versions/addByName" \ + --data-raw "combinedBranch=true&committish=${_PRODUCT_VERSION}&fixedIssues=&name=${_PRODUCT_VERSION}&productVersionLabel=${product_version_label}&repositoryName=liferay-portal-ee&rootPatcherProjectVersionName=${root_patcher_project_version_name}" \ + --fail \ + --max-time 10 \ + --retry 3 \ + --silent \ + --user "${LIFERAY_RELEASE_PATCHER_PORTAL_EMAIL}:${LIFERAY_RELEASE_PATCHER_PORTAL_PASSWORD}") + + if [ $? -eq 0 ] + then + lc_log INFO "Project version ${_PRODUCT_VERSION} added to Patcher Portal. Populating its fixed issues list." + + add_fixed_issues_to_project_version $(echo "${add_by_name_response}" | jq -r '.data.patcherProjectVersionId') + else + lc_log ERROR "Unable to add project version ${_PRODUCT_VERSION} to Patcher Portal." + + return "${LIFERAY_COMMON_EXIT_CODE_BAD}" + fi +} + function check_url { local file_url="${1}" diff --git a/release/release_gold.sh b/release/release_gold.sh index 500ac6a66..d96f0e928 100755 --- a/release/release_gold.sh +++ b/release/release_gold.sh @@ -101,6 +101,8 @@ function main { lc_time_run prepare_next_release_branch #lc_time_run upload_to_docker_hub + + #lc_time_run add_patcher_project_version } function prepare_next_release_branch { @@ -171,6 +173,8 @@ function print_help { echo " LIFERAY_RELEASE_GITHUB_PAT (optional): GitHub personal access token used to tag releases" echo " LIFERAY_RELEASE_NEXUS_REPOSITORY_PASSWORD (optional): Nexus user's password" echo " LIFERAY_RELEASE_NEXUS_REPOSITORY_USER (optional): Nexus user with the right to upload BOM files" + echo " LIFERAY_RELEASE_PATCHER_PORTAL_EMAIL: E-mail for the Release Team Liferay Patcher account" + echo " LIFERAY_RELEASE_PATCHER_PORTAL_PASSWORD: Password for the Release Team Liferay Patcher account" echo " LIFERAY_RELEASE_PRODUCT_NAME (optional): Set to \"portal\" for CE. The default is \"DXP\"." echo " LIFERAY_RELEASE_RC_BUILD_TIMESTAMP: Timestamp of the build to publish" echo " LIFERAY_RELEASE_VERSION: DXP version of the release to publish" From c7de3d1eee8e201de1f568bb7e7adb6a2ce76e1c Mon Sep 17 00:00:00 2001 From: Renato Rego Date: Thu, 11 Jul 2024 14:55:36 -0300 Subject: [PATCH 048/140] LRP-4868 Rename --- release/_publishing.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/release/_publishing.sh b/release/_publishing.sh index d80a922b6..ae2949a86 100644 --- a/release/_publishing.sh +++ b/release/_publishing.sh @@ -9,14 +9,14 @@ function add_fixed_issues_to_project_version { for counter in {0..3} do - local number_of_issues_added=$((counter * fixed_issues_array_part_length)) + local start_index=$((counter * fixed_issues_array_part_length)) if [ "${counter}" -eq 3 ] then - fixed_issues_array_part_length=$((fixed_issues_array_length - number_of_issues_added)) + fixed_issues_array_part_length=$((fixed_issues_array_length - start_index)) fi - IFS=',' fixed_issues="${fixed_issues_array[*]:number_of_issues_added:fixed_issues_array_part_length}" + IFS=',' fixed_issues="${fixed_issues_array[*]:start_index:fixed_issues_array_part_length}" if (curl \ "https://patcher.liferay.com/api/jsonws/osb-patcher-portlet.project_versions/updateFixedIssues" \ From 325604afbae44bfc8099bc65dd6fb703b3aaa723 Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Wed, 17 Jul 2024 10:44:58 +0530 Subject: [PATCH 049/140] LRP-4868 Rename --- release/_publishing.sh | 4 ++-- release/release_gold.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/release/_publishing.sh b/release/_publishing.sh index ae2949a86..a0e79cce3 100644 --- a/release/_publishing.sh +++ b/release/_publishing.sh @@ -26,7 +26,7 @@ function add_fixed_issues_to_project_version { --output /dev/null \ --retry 3 \ --silent \ - --user "${LIFERAY_RELEASE_PATCHER_PORTAL_EMAIL}:${LIFERAY_RELEASE_PATCHER_PORTAL_PASSWORD}") + --user "${LIFERAY_RELEASE_PATCHER_PORTAL_EMAIL_ADDRESS}:${LIFERAY_RELEASE_PATCHER_PORTAL_PASSWORD}") then lc_log INFO "Adding fixed issues to the ${_PRODUCT_VERSION} project version." else @@ -65,7 +65,7 @@ function add_patcher_project_version { --max-time 10 \ --retry 3 \ --silent \ - --user "${LIFERAY_RELEASE_PATCHER_PORTAL_EMAIL}:${LIFERAY_RELEASE_PATCHER_PORTAL_PASSWORD}") + --user "${LIFERAY_RELEASE_PATCHER_PORTAL_EMAIL_ADDRESS}:${LIFERAY_RELEASE_PATCHER_PORTAL_PASSWORD}") if [ $? -eq 0 ] then diff --git a/release/release_gold.sh b/release/release_gold.sh index d96f0e928..1f8a246e0 100755 --- a/release/release_gold.sh +++ b/release/release_gold.sh @@ -173,8 +173,8 @@ function print_help { echo " LIFERAY_RELEASE_GITHUB_PAT (optional): GitHub personal access token used to tag releases" echo " LIFERAY_RELEASE_NEXUS_REPOSITORY_PASSWORD (optional): Nexus user's password" echo " LIFERAY_RELEASE_NEXUS_REPOSITORY_USER (optional): Nexus user with the right to upload BOM files" - echo " LIFERAY_RELEASE_PATCHER_PORTAL_EMAIL: E-mail for the Release Team Liferay Patcher account" - echo " LIFERAY_RELEASE_PATCHER_PORTAL_PASSWORD: Password for the Release Team Liferay Patcher account" + echo " LIFERAY_RELEASE_PATCHER_PORTAL_EMAIL_ADDRESS: Email address to the release team's Liferay Patcher user" + echo " LIFERAY_RELEASE_PATCHER_PORTAL_PASSWORD: Password to the release team's Liferay Patcher user" echo " LIFERAY_RELEASE_PRODUCT_NAME (optional): Set to \"portal\" for CE. The default is \"DXP\"." echo " LIFERAY_RELEASE_RC_BUILD_TIMESTAMP: Timestamp of the build to publish" echo " LIFERAY_RELEASE_VERSION: DXP version of the release to publish" From 408e42227bf701db58e6df878ab1bcf98501adc5 Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Wed, 17 Jul 2024 10:51:21 +0530 Subject: [PATCH 050/140] LRP-4868 SF --- release/_publishing.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/release/_publishing.sh b/release/_publishing.sh index a0e79cce3..cdebfabda 100644 --- a/release/_publishing.sh +++ b/release/_publishing.sh @@ -19,14 +19,14 @@ function add_fixed_issues_to_project_version { IFS=',' fixed_issues="${fixed_issues_array[*]:start_index:fixed_issues_array_part_length}" if (curl \ - "https://patcher.liferay.com/api/jsonws/osb-patcher-portlet.project_versions/updateFixedIssues" \ - --data-raw "fixedIssues=${fixed_issues}&patcherProjectVersionId=${1}" \ - --fail \ - --max-time 10 \ - --output /dev/null \ - --retry 3 \ - --silent \ - --user "${LIFERAY_RELEASE_PATCHER_PORTAL_EMAIL_ADDRESS}:${LIFERAY_RELEASE_PATCHER_PORTAL_PASSWORD}") + "https://patcher.liferay.com/api/jsonws/osb-patcher-portlet.project_versions/updateFixedIssues" \ + --data-raw "fixedIssues=${fixed_issues}&patcherProjectVersionId=${1}" \ + --fail \ + --max-time 10 \ + --output /dev/null \ + --retry 3 \ + --silent \ + --user "${LIFERAY_RELEASE_PATCHER_PORTAL_EMAIL_ADDRESS}:${LIFERAY_RELEASE_PATCHER_PORTAL_PASSWORD}") then lc_log INFO "Adding fixed issues to the ${_PRODUCT_VERSION} project version." else From ddaf4c8ed460acdab2a76cce624f08f3e7438014 Mon Sep 17 00:00:00 2001 From: Pedro Malta Date: Wed, 17 Jul 2024 09:09:05 -0300 Subject: [PATCH 051/140] LRP-4868 Fix naming inconsistencies --- release/_publishing.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/release/_publishing.sh b/release/_publishing.sh index cdebfabda..d2cc18f6b 100644 --- a/release/_publishing.sh +++ b/release/_publishing.sh @@ -28,23 +28,25 @@ function add_fixed_issues_to_project_version { --silent \ --user "${LIFERAY_RELEASE_PATCHER_PORTAL_EMAIL_ADDRESS}:${LIFERAY_RELEASE_PATCHER_PORTAL_PASSWORD}") then - lc_log INFO "Adding fixed issues to the ${_PRODUCT_VERSION} project version." + lc_log INFO "Adding fixed issues to the ${2} project version." else - lc_log ERROR "Unable to add the full fixed issues list to the ${_PRODUCT_VERSION} project version." + lc_log ERROR "Unable to add the full fixed issues list to the ${2} project version." return "${LIFERAY_COMMON_EXIT_CODE_BAD}" fi done - lc_log INFO "The full fixed issues list has been added to the ${_PRODUCT_VERSION} project version." + lc_log INFO "The full fixed issues list has been added to the ${2} project version." } function add_patcher_project_version { local product_version_label="Quarterly Releases" + local project_version="${_PRODUCT_VERSION}" + local root_patcher_project_version_name="" - case "${_PRODUCT_VERSION}" in + case "${project_version}" in 7.4.*) product_version_label="DXP 7.4" @@ -60,7 +62,7 @@ function add_patcher_project_version { local add_by_name_response=$(\ curl \ "https://patcher.liferay.com/api/jsonws/osb-patcher-portlet.project_versions/addByName" \ - --data-raw "combinedBranch=true&committish=${_PRODUCT_VERSION}&fixedIssues=&name=${_PRODUCT_VERSION}&productVersionLabel=${product_version_label}&repositoryName=liferay-portal-ee&rootPatcherProjectVersionName=${root_patcher_project_version_name}" \ + --data-raw "combinedBranch=true&committish=${project_version}&fixedIssues=&name=${project_version}&productVersionLabel=${product_version_label}&repositoryName=liferay-portal-ee&rootPatcherProjectVersionName=${root_patcher_project_version_name}" \ --fail \ --max-time 10 \ --retry 3 \ @@ -69,11 +71,11 @@ function add_patcher_project_version { if [ $? -eq 0 ] then - lc_log INFO "Project version ${_PRODUCT_VERSION} added to Patcher Portal. Populating its fixed issues list." + lc_log INFO "Project version ${project_version} added to Patcher Portal. Populating its fixed issues list." - add_fixed_issues_to_project_version $(echo "${add_by_name_response}" | jq -r '.data.patcherProjectVersionId') + add_fixed_issues_to_project_version $(echo "${add_by_name_response}" | jq -r '.data.patcherProjectVersionId') "${project_version}" else - lc_log ERROR "Unable to add project version ${_PRODUCT_VERSION} to Patcher Portal." + lc_log ERROR "Unable to add project version ${project_version} to Patcher Portal." return "${LIFERAY_COMMON_EXIT_CODE_BAD}" fi From 292540d3b5c49506a06d2e4a8c559e334fb8aae5 Mon Sep 17 00:00:00 2001 From: Pedro Malta Date: Wed, 17 Jul 2024 09:11:11 -0300 Subject: [PATCH 052/140] LRP-4868 Using if instead of case --- release/_publishing.sh | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/release/_publishing.sh b/release/_publishing.sh index d2cc18f6b..3872cb2a2 100644 --- a/release/_publishing.sh +++ b/release/_publishing.sh @@ -46,18 +46,19 @@ function add_patcher_project_version { local root_patcher_project_version_name="" - case "${project_version}" in - 7.4.*) - product_version_label="DXP 7.4" + if [[ "${project_version}" == 7.4.* ]] + then + product_version_label="DXP 7.4" + + root_patcher_project_version_name="7.4.13-ga1" + fi - root_patcher_project_version_name="7.4.13-ga1" - ;; - 7.3.*) + if [[ "${project_version}" == 7.3.* ]] + then product_version_label="DXP 7.3" root_patcher_project_version_name="fix-pack-base-7310" - ;; - esac + fi local add_by_name_response=$(\ curl \ From a25ee03a0a03c803b4e8be6ab6102c145db3842a Mon Sep 17 00:00:00 2001 From: Pedro Malta Date: Tue, 6 Aug 2024 10:41:43 -0300 Subject: [PATCH 053/140] LRP-4868 Using patcher_project_version instead of project_version --- release/_publishing.sh | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/release/_publishing.sh b/release/_publishing.sh index 3872cb2a2..168d55c9d 100644 --- a/release/_publishing.sh +++ b/release/_publishing.sh @@ -1,6 +1,6 @@ #!/bin/bash -function add_fixed_issues_to_project_version { +function add_fixed_issues_to_patcher_project_version { IFS=',' read -r -a fixed_issues_array < "${_BUILD_DIR}/release/release-notes.txt" local fixed_issues_array_length="${#fixed_issues_array[@]}" @@ -40,22 +40,22 @@ function add_fixed_issues_to_project_version { } function add_patcher_project_version { - local product_version_label="Quarterly Releases" + local patcher_product_version_label="Quarterly Releases" - local project_version="${_PRODUCT_VERSION}" + local patcher_project_version="${_PRODUCT_VERSION}" local root_patcher_project_version_name="" - if [[ "${project_version}" == 7.4.* ]] - then - product_version_label="DXP 7.4" + if [[ "${patcher_project_version}" == 7.4.* ]] + then + patcher_product_version_label="DXP 7.4" - root_patcher_project_version_name="7.4.13-ga1" - fi + root_patcher_project_version_name="7.4.13-ga1" + fi - if [[ "${project_version}" == 7.3.* ]] + if [[ "${patcher_project_version}" == 7.3.* ]] then - product_version_label="DXP 7.3" + patcher_product_version_label="DXP 7.3" root_patcher_project_version_name="fix-pack-base-7310" fi @@ -63,7 +63,7 @@ function add_patcher_project_version { local add_by_name_response=$(\ curl \ "https://patcher.liferay.com/api/jsonws/osb-patcher-portlet.project_versions/addByName" \ - --data-raw "combinedBranch=true&committish=${project_version}&fixedIssues=&name=${project_version}&productVersionLabel=${product_version_label}&repositoryName=liferay-portal-ee&rootPatcherProjectVersionName=${root_patcher_project_version_name}" \ + --data-raw "combinedBranch=true&committish=${patcher_project_version}&fixedIssues=&name=${patcher_project_version}&productVersionLabel=${patcher_product_version_label}&repositoryName=liferay-portal-ee&rootPatcherProjectVersionName=${root_patcher_project_version_name}" \ --fail \ --max-time 10 \ --retry 3 \ @@ -72,11 +72,11 @@ function add_patcher_project_version { if [ $? -eq 0 ] then - lc_log INFO "Project version ${project_version} added to Patcher Portal. Populating its fixed issues list." + lc_log INFO "Project version ${patcher_project_version} added to Patcher Portal. Populating its fixed issues list." - add_fixed_issues_to_project_version $(echo "${add_by_name_response}" | jq -r '.data.patcherProjectVersionId') "${project_version}" + add_fixed_issues_to_patcher_project_version $(echo "${add_by_name_response}" | jq -r '.data.patcherProjectVersionId') "${patcher_project_version}" else - lc_log ERROR "Unable to add project version ${project_version} to Patcher Portal." + lc_log ERROR "Unable to add project version ${patcher_project_version} to Patcher Portal." return "${LIFERAY_COMMON_EXIT_CODE_BAD}" fi From fd11afce247660de106194c06bff1bd1cff6e840 Mon Sep 17 00:00:00 2001 From: Renato Rego Date: Thu, 8 Aug 2024 09:26:29 -0300 Subject: [PATCH 054/140] LRP-4868 SF --- release/_publishing.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/release/_publishing.sh b/release/_publishing.sh index 168d55c9d..42064b4b6 100644 --- a/release/_publishing.sh +++ b/release/_publishing.sh @@ -40,10 +40,8 @@ function add_fixed_issues_to_patcher_project_version { } function add_patcher_project_version { - local patcher_product_version_label="Quarterly Releases" - local patcher_project_version="${_PRODUCT_VERSION}" - + local patcher_product_version_label="Quarterly Releases" local root_patcher_project_version_name="" if [[ "${patcher_project_version}" == 7.4.* ]] From b7a40dbfc9bcb12daa406b3ce12d63f4a30be7e4 Mon Sep 17 00:00:00 2001 From: Renato Rego Date: Wed, 7 Aug 2024 10:09:05 -0300 Subject: [PATCH 055/140] LRP-4868 Enable Patcher Project Version creation --- release/release_gold.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release/release_gold.sh b/release/release_gold.sh index 1f8a246e0..ad98a4d0e 100755 --- a/release/release_gold.sh +++ b/release/release_gold.sh @@ -96,13 +96,13 @@ function main { lc_time_run upload_releases_json + lc_time_run add_patcher_project_version + lc_time_run test_boms lc_time_run prepare_next_release_branch #lc_time_run upload_to_docker_hub - - #lc_time_run add_patcher_project_version } function prepare_next_release_branch { From e38a2d03c28aa725336f30e111b979a32f176fa7 Mon Sep 17 00:00:00 2001 From: Renato Rego Date: Thu, 8 Aug 2024 09:32:24 -0300 Subject: [PATCH 056/140] LRP-4868 SF --- release/_publishing.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/_publishing.sh b/release/_publishing.sh index 42064b4b6..6e3fd33ae 100644 --- a/release/_publishing.sh +++ b/release/_publishing.sh @@ -68,7 +68,7 @@ function add_patcher_project_version { --silent \ --user "${LIFERAY_RELEASE_PATCHER_PORTAL_EMAIL_ADDRESS}:${LIFERAY_RELEASE_PATCHER_PORTAL_PASSWORD}") - if [ $? -eq 0 ] + if [ "${?}" -eq 0 ] then lc_log INFO "Project version ${patcher_project_version} added to Patcher Portal. Populating its fixed issues list." From 47ebecea7c0f342e27aab2d17d149a6971b73f08 Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Thu, 8 Aug 2024 11:26:27 -0300 Subject: [PATCH 057/140] LRP-4868 Wordsmith --- release/_publishing.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/release/_publishing.sh b/release/_publishing.sh index 6e3fd33ae..0f37a94cc 100644 --- a/release/_publishing.sh +++ b/release/_publishing.sh @@ -28,15 +28,15 @@ function add_fixed_issues_to_patcher_project_version { --silent \ --user "${LIFERAY_RELEASE_PATCHER_PORTAL_EMAIL_ADDRESS}:${LIFERAY_RELEASE_PATCHER_PORTAL_PASSWORD}") then - lc_log INFO "Adding fixed issues to the ${2} project version." + lc_log INFO "Adding fixed issues to the ${2} Liferay Patcher project version." else - lc_log ERROR "Unable to add the full fixed issues list to the ${2} project version." + lc_log ERROR "Unable to add the full fixed issues list to the ${2} Liferay Patcher project version." return "${LIFERAY_COMMON_EXIT_CODE_BAD}" fi done - lc_log INFO "The full fixed issues list has been added to the ${2} project version." + lc_log INFO "The full fixed issues list has been added to the ${2} Liferay Patcher project version." } function add_patcher_project_version { From 7de806b0b659885ca4fc3dd12f4c0270730c2bde Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Thu, 8 Aug 2024 11:26:33 -0300 Subject: [PATCH 058/140] LRP-4868 Sort --- release/_publishing.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/_publishing.sh b/release/_publishing.sh index 0f37a94cc..7f3a74181 100644 --- a/release/_publishing.sh +++ b/release/_publishing.sh @@ -40,8 +40,8 @@ function add_fixed_issues_to_patcher_project_version { } function add_patcher_project_version { - local patcher_project_version="${_PRODUCT_VERSION}" local patcher_product_version_label="Quarterly Releases" + local patcher_project_version="${_PRODUCT_VERSION}" local root_patcher_project_version_name="" if [[ "${patcher_project_version}" == 7.4.* ]] From 2ab82db3b79a24826cdff12b2907f85de0a49feb Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Thu, 8 Aug 2024 11:26:41 -0300 Subject: [PATCH 059/140] LRP-4868 SF --- release/_publishing.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/release/_publishing.sh b/release/_publishing.sh index 7f3a74181..bf5ce6e5b 100644 --- a/release/_publishing.sh +++ b/release/_publishing.sh @@ -47,14 +47,12 @@ function add_patcher_project_version { if [[ "${patcher_project_version}" == 7.4.* ]] then patcher_product_version_label="DXP 7.4" - root_patcher_project_version_name="7.4.13-ga1" fi if [[ "${patcher_project_version}" == 7.3.* ]] then patcher_product_version_label="DXP 7.3" - root_patcher_project_version_name="fix-pack-base-7310" fi From 0b06b243dad488a151827a876fa3da6be20bdd97 Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Thu, 8 Aug 2024 11:26:56 -0300 Subject: [PATCH 060/140] LRP-4868 Sort --- release/_publishing.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/release/_publishing.sh b/release/_publishing.sh index bf5ce6e5b..7b4d41fc0 100644 --- a/release/_publishing.sh +++ b/release/_publishing.sh @@ -44,16 +44,14 @@ function add_patcher_project_version { local patcher_project_version="${_PRODUCT_VERSION}" local root_patcher_project_version_name="" - if [[ "${patcher_project_version}" == 7.4.* ]] - then - patcher_product_version_label="DXP 7.4" - root_patcher_project_version_name="7.4.13-ga1" - fi - if [[ "${patcher_project_version}" == 7.3.* ]] then patcher_product_version_label="DXP 7.3" root_patcher_project_version_name="fix-pack-base-7310" + elif [[ "${patcher_project_version}" == 7.4.* ]] + then + patcher_product_version_label="DXP 7.4" + root_patcher_project_version_name="7.4.13-ga1" fi local add_by_name_response=$(\ From e2323ad14b1a4f7e13f52fa004b3dc31f0912ee1 Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Thu, 8 Aug 2024 11:27:58 -0300 Subject: [PATCH 061/140] LRP-4868 Wordsmith --- release/_publishing.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release/_publishing.sh b/release/_publishing.sh index 7b4d41fc0..68e8463a1 100644 --- a/release/_publishing.sh +++ b/release/_publishing.sh @@ -66,11 +66,11 @@ function add_patcher_project_version { if [ "${?}" -eq 0 ] then - lc_log INFO "Project version ${patcher_project_version} added to Patcher Portal. Populating its fixed issues list." + lc_log INFO "Added Liferay Patcher project version ${patcher_project_version}." add_fixed_issues_to_patcher_project_version $(echo "${add_by_name_response}" | jq -r '.data.patcherProjectVersionId') "${patcher_project_version}" else - lc_log ERROR "Unable to add project version ${patcher_project_version} to Patcher Portal." + lc_log ERROR "Unable to add Liferay Patcher project version ${patcher_project_version}." return "${LIFERAY_COMMON_EXIT_CODE_BAD}" fi From c252f295a3a26bb4e5f8d0557ccee212e8dad063 Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Thu, 8 Aug 2024 11:29:41 -0300 Subject: [PATCH 062/140] LRP-4868 Wordsmith --- release/_publishing.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/release/_publishing.sh b/release/_publishing.sh index 68e8463a1..f02d8c3bb 100644 --- a/release/_publishing.sh +++ b/release/_publishing.sh @@ -28,15 +28,15 @@ function add_fixed_issues_to_patcher_project_version { --silent \ --user "${LIFERAY_RELEASE_PATCHER_PORTAL_EMAIL_ADDRESS}:${LIFERAY_RELEASE_PATCHER_PORTAL_PASSWORD}") then - lc_log INFO "Adding fixed issues to the ${2} Liferay Patcher project version." + lc_log INFO "Adding fixed issues to Liferay Patcher project version ${2}." else - lc_log ERROR "Unable to add the full fixed issues list to the ${2} Liferay Patcher project version." + lc_log ERROR "Unable to add fixed issues to Liferay Patcher project ${2}." return "${LIFERAY_COMMON_EXIT_CODE_BAD}" fi done - lc_log INFO "The full fixed issues list has been added to the ${2} Liferay Patcher project version." + lc_log INFO "Added fixed issues to Liferay Patcher project ${2}." } function add_patcher_project_version { @@ -70,7 +70,7 @@ function add_patcher_project_version { add_fixed_issues_to_patcher_project_version $(echo "${add_by_name_response}" | jq -r '.data.patcherProjectVersionId') "${patcher_project_version}" else - lc_log ERROR "Unable to add Liferay Patcher project version ${patcher_project_version}." + lc_log ERROR "Unable to add Liferay Patcher project ${patcher_project_version}." return "${LIFERAY_COMMON_EXIT_CODE_BAD}" fi From aa512a6ea6775c246fa11a0f8b32fec8434d64c4 Mon Sep 17 00:00:00 2001 From: Pedro Paccola Date: Mon, 29 Jul 2024 11:48:00 -0300 Subject: [PATCH 063/140] SRE-6066 Fix Spinner's build_service_liferay to work with new branching strategy --- spinner/build.sh | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/spinner/build.sh b/spinner/build.sh index 8407b3044..8ad1b8b62 100755 --- a/spinner/build.sh +++ b/spinner/build.sh @@ -48,8 +48,16 @@ function build_service_liferay { cp ../../orca/templates/liferay/resources/usr/local/liferay/scripts/pre-startup/10_wait_for_dependencies.sh build/liferay/resources/usr/local/liferay/scripts/pre-startup + local hotfix=$(retrieve_descriptor_data "hotfix") + + if [ ! -z "${hotfix}" ]; then + hotfix="RUN \/opt\/liferay\/patching-tool\/patching-tool.sh install ${hotfix}" + fi + + sed -i "s/\[TO-BE-REPLACED-BY-SINGLE-CI\]/${hotfix}/g" "${SPINNER_LIFERAY_LXC_REPOSITORY_DIR}/liferay/Dockerfile.ext" + ( - echo "FROM $(grep -e '^liferay.workspace.docker.image.liferay=' "${SPINNER_LIFERAY_LXC_REPOSITORY_DIR}/liferay/gradle.properties" | cut -d'=' -f2)" + echo "FROM $(retrieve_descriptor_data "liferay-image")" echo "COPY resources/opt/liferay /opt/liferay" echo "COPY resources/usr/local/bin /usr/local/bin" @@ -525,6 +533,21 @@ function print_help { exit "${LIFERAY_COMMON_EXIT_CODE_HELP}" } +function retrieve_descriptor_data { + local file="${SPINNER_LIFERAY_LXC_REPOSITORY_DIR}/automation/environment-descriptors/${LXC_ENVIRONMENT}.json" + + if [ ! -f "${file}" ]; then + echo "" + echo "It was not possible to find the environment-descriptor for ${LXC_ENVIRONMENT}." + + exit "${LIFERAY_COMMON_EXIT_CODE_BAD}" + fi + + value=$(grep -e "\"${1}\":" "${file}" | cut -d'"' -f4) + + echo "${value}" +} + function write { echo "${1}" >> docker-compose.yml } @@ -538,4 +561,4 @@ function write_deploy_section { write " memory: ${1}" } -main "${@}" \ No newline at end of file +main "${@}" From c9dc0526a1db69bd28265caa78175b11c71de06c Mon Sep 17 00:00:00 2001 From: Pedro Paccola Date: Tue, 30 Jul 2024 11:32:23 -0300 Subject: [PATCH 064/140] SRE-6066 Make it backwards compatible --- spinner/build.sh | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/spinner/build.sh b/spinner/build.sh index 8ad1b8b62..b21f9a4ac 100755 --- a/spinner/build.sh +++ b/spinner/build.sh @@ -48,16 +48,31 @@ function build_service_liferay { cp ../../orca/templates/liferay/resources/usr/local/liferay/scripts/pre-startup/10_wait_for_dependencies.sh build/liferay/resources/usr/local/liferay/scripts/pre-startup - local hotfix=$(retrieve_descriptor_data "hotfix") + local branch=$(git -C "${SPINNER_LIFERAY_LXC_REPOSITORY_DIR}" rev-parse --abbrev-ref HEAD) + local liferay_image="" - if [ ! -z "${hotfix}" ]; then - hotfix="RUN \/opt\/liferay\/patching-tool\/patching-tool.sh install ${hotfix}" - fi + if [ "${branch}" = "master" ]; then + echo "Currently checked out to the master branch." + echo "" + + liferay_image=$(retrieve_descriptor_data "liferay-image") - sed -i "s/\[TO-BE-REPLACED-BY-SINGLE-CI\]/${hotfix}/g" "${SPINNER_LIFERAY_LXC_REPOSITORY_DIR}/liferay/Dockerfile.ext" + local hotfix=$(retrieve_descriptor_data "hotfix") + + if [ ! -z "${hotfix}" ]; then + hotfix="RUN \/opt\/liferay\/patching-tool\/patching-tool.sh install ${hotfix}" + fi + + sed -i "s/\[TO-BE-REPLACED-BY-SINGLE-CI\]/${hotfix}/g" "${SPINNER_LIFERAY_LXC_REPOSITORY_DIR}/liferay/Dockerfile.ext" + else + echo "Currently checked out to the ${branch} branch." + echo "" + + liferay_image=$(grep -e '^liferay.workspace.docker.image.liferay=' "${SPINNER_LIFERAY_LXC_REPOSITORY_DIR}/liferay/gradle.properties" | cut -d'=' -f2) + fi ( - echo "FROM $(retrieve_descriptor_data "liferay-image")" + echo "FROM ${liferay_image}" echo "COPY resources/opt/liferay /opt/liferay" echo "COPY resources/usr/local/bin /usr/local/bin" From 75271e2820d41f7eebf2714393e484b54e5b4565 Mon Sep 17 00:00:00 2001 From: Zsolt Balogh Date: Thu, 1 Aug 2024 14:37:28 +0200 Subject: [PATCH 065/140] SRE-6066 SF --- spinner/build.sh | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/spinner/build.sh b/spinner/build.sh index b21f9a4ac..3f742c836 100755 --- a/spinner/build.sh +++ b/spinner/build.sh @@ -48,26 +48,21 @@ function build_service_liferay { cp ../../orca/templates/liferay/resources/usr/local/liferay/scripts/pre-startup/10_wait_for_dependencies.sh build/liferay/resources/usr/local/liferay/scripts/pre-startup - local branch=$(git -C "${SPINNER_LIFERAY_LXC_REPOSITORY_DIR}" rev-parse --abbrev-ref HEAD) local liferay_image="" - if [ "${branch}" = "master" ]; then - echo "Currently checked out to the master branch." - echo "" - + if [ "$(git -C "${SPINNER_LIFERAY_LXC_REPOSITORY_DIR}" rev-parse --abbrev-ref HEAD)" == "master" ] + then liferay_image=$(retrieve_descriptor_data "liferay-image") local hotfix=$(retrieve_descriptor_data "hotfix") - if [ ! -z "${hotfix}" ]; then + if [ ! -z "${hotfix}" ] + then hotfix="RUN \/opt\/liferay\/patching-tool\/patching-tool.sh install ${hotfix}" fi sed -i "s/\[TO-BE-REPLACED-BY-SINGLE-CI\]/${hotfix}/g" "${SPINNER_LIFERAY_LXC_REPOSITORY_DIR}/liferay/Dockerfile.ext" else - echo "Currently checked out to the ${branch} branch." - echo "" - liferay_image=$(grep -e '^liferay.workspace.docker.image.liferay=' "${SPINNER_LIFERAY_LXC_REPOSITORY_DIR}/liferay/gradle.properties" | cut -d'=' -f2) fi @@ -551,8 +546,8 @@ function print_help { function retrieve_descriptor_data { local file="${SPINNER_LIFERAY_LXC_REPOSITORY_DIR}/automation/environment-descriptors/${LXC_ENVIRONMENT}.json" - if [ ! -f "${file}" ]; then - echo "" + if [ ! -f "${file}" ] + then echo "It was not possible to find the environment-descriptor for ${LXC_ENVIRONMENT}." exit "${LIFERAY_COMMON_EXIT_CODE_BAD}" @@ -576,4 +571,4 @@ function write_deploy_section { write " memory: ${1}" } -main "${@}" +main "${@}" \ No newline at end of file From 94e85fc8e8d4114324ebc9bcca7c95dfb8803c95 Mon Sep 17 00:00:00 2001 From: Pedro Paccola Date: Mon, 5 Aug 2024 13:49:18 -0300 Subject: [PATCH 066/140] SRE-6066 Rename retrieve_descriptor_data --- spinner/build.sh | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/spinner/build.sh b/spinner/build.sh index 3f742c836..2da47870b 100755 --- a/spinner/build.sh +++ b/spinner/build.sh @@ -52,9 +52,9 @@ function build_service_liferay { if [ "$(git -C "${SPINNER_LIFERAY_LXC_REPOSITORY_DIR}" rev-parse --abbrev-ref HEAD)" == "master" ] then - liferay_image=$(retrieve_descriptor_data "liferay-image") + liferay_image=$(get_environment_descriptor "liferay-image") - local hotfix=$(retrieve_descriptor_data "hotfix") + local hotfix=$(get_environment_descriptor "hotfix") if [ ! -z "${hotfix}" ] then @@ -427,6 +427,19 @@ function check_usage { mkdir -p "${STACK_DIR}" } +function get_environment_descriptor { + local file="${SPINNER_LIFERAY_LXC_REPOSITORY_DIR}/automation/environment-descriptors/${LXC_ENVIRONMENT}.json" + + if [ ! -f "${file}" ] + then + echo "It was not possible to find the environment-descriptor for ${LXC_ENVIRONMENT}." + + exit "${LIFERAY_COMMON_EXIT_CODE_BAD}" + fi + + echo "$(grep -e "\"${1}\":" "${file}" | cut -d'"' -f4)" +} + function main { check_usage "${@}" @@ -543,21 +556,6 @@ function print_help { exit "${LIFERAY_COMMON_EXIT_CODE_HELP}" } -function retrieve_descriptor_data { - local file="${SPINNER_LIFERAY_LXC_REPOSITORY_DIR}/automation/environment-descriptors/${LXC_ENVIRONMENT}.json" - - if [ ! -f "${file}" ] - then - echo "It was not possible to find the environment-descriptor for ${LXC_ENVIRONMENT}." - - exit "${LIFERAY_COMMON_EXIT_CODE_BAD}" - fi - - value=$(grep -e "\"${1}\":" "${file}" | cut -d'"' -f4) - - echo "${value}" -} - function write { echo "${1}" >> docker-compose.yml } From 67bb164f55bb6f559f1f6d14faef7ce27b717e15 Mon Sep 17 00:00:00 2001 From: Renato Rego Date: Wed, 7 Aug 2024 08:51:05 -0300 Subject: [PATCH 067/140] SRE-6066 SF --- spinner/build.sh | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/spinner/build.sh b/spinner/build.sh index 2da47870b..30eeff7f3 100755 --- a/spinner/build.sh +++ b/spinner/build.sh @@ -48,33 +48,29 @@ function build_service_liferay { cp ../../orca/templates/liferay/resources/usr/local/liferay/scripts/pre-startup/10_wait_for_dependencies.sh build/liferay/resources/usr/local/liferay/scripts/pre-startup - local liferay_image="" - - if [ "$(git -C "${SPINNER_LIFERAY_LXC_REPOSITORY_DIR}" rev-parse --abbrev-ref HEAD)" == "master" ] + if [ "$(git --git-dir "${SPINNER_LIFERAY_LXC_REPOSITORY_DIR}/.git" rev-parse --abbrev-ref HEAD)" == "master" ] then - liferay_image=$(get_environment_descriptor "liferay-image") + echo "FROM $(get_environment_descriptor "liferay-image")" > build/liferay/Dockerfile - local hotfix=$(get_environment_descriptor "hotfix") + local hotfix_environment_descriptor=$(get_environment_descriptor "hotfix") - if [ ! -z "${hotfix}" ] + if [ ! -z "${hotfix_environment_descriptor}" ] then - hotfix="RUN \/opt\/liferay\/patching-tool\/patching-tool.sh install ${hotfix}" + hotfix_environment_descriptor="RUN \/opt\/liferay\/patching-tool\/patching-tool.sh install ${hotfix_environment_descriptor}" fi - sed -i "s/\[TO-BE-REPLACED-BY-SINGLE-CI\]/${hotfix}/g" "${SPINNER_LIFERAY_LXC_REPOSITORY_DIR}/liferay/Dockerfile.ext" + sed -i "s/\[TO-BE-REPLACED-BY-SINGLE-CI\]/${hotfix_environment_descriptor}/g" "${SPINNER_LIFERAY_LXC_REPOSITORY_DIR}/liferay/Dockerfile.ext" else - liferay_image=$(grep -e '^liferay.workspace.docker.image.liferay=' "${SPINNER_LIFERAY_LXC_REPOSITORY_DIR}/liferay/gradle.properties" | cut -d'=' -f2) + echo "FROM $(grep -e '^liferay.workspace.docker.image.liferay=' "${SPINNER_LIFERAY_LXC_REPOSITORY_DIR}/liferay/gradle.properties" | cut -d '=' -f 2)" > build/liferay/Dockerfile fi ( - echo "FROM ${liferay_image}" - echo "COPY resources/opt/liferay /opt/liferay" echo "COPY resources/usr/local/bin /usr/local/bin" echo "COPY resources/usr/local/liferay/scripts /usr/local/liferay/scripts" cat "${SPINNER_LIFERAY_LXC_REPOSITORY_DIR}/liferay/Dockerfile.ext" - ) > build/liferay/Dockerfile + ) >> build/liferay/Dockerfile mkdir -p liferay_mount/files/deploy @@ -428,16 +424,16 @@ function check_usage { } function get_environment_descriptor { - local file="${SPINNER_LIFERAY_LXC_REPOSITORY_DIR}/automation/environment-descriptors/${LXC_ENVIRONMENT}.json" + local environment_descriptor="${SPINNER_LIFERAY_LXC_REPOSITORY_DIR}/automation/environment-descriptors/${LXC_ENVIRONMENT}.json" - if [ ! -f "${file}" ] + if [ ! -e "${environment_descriptor}" ] then - echo "It was not possible to find the environment-descriptor for ${LXC_ENVIRONMENT}." + echo "The ${environment_descriptor} environment-descriptor does not exist." exit "${LIFERAY_COMMON_EXIT_CODE_BAD}" fi - echo "$(grep -e "\"${1}\":" "${file}" | cut -d'"' -f4)" + grep -e "\"${1}\":" "${environment_descriptor}" | cut -d '"' -f 4 } function main { From ab8662f7b9508165f926adebe39d414b68ed5f21 Mon Sep 17 00:00:00 2001 From: Pedro Paccola Date: Thu, 8 Aug 2024 14:53:14 -0300 Subject: [PATCH 068/140] SRE-6066 validate if in master branch on check_usage --- spinner/build.sh | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/spinner/build.sh b/spinner/build.sh index 30eeff7f3..bdc85f542 100755 --- a/spinner/build.sh +++ b/spinner/build.sh @@ -48,18 +48,18 @@ function build_service_liferay { cp ../../orca/templates/liferay/resources/usr/local/liferay/scripts/pre-startup/10_wait_for_dependencies.sh build/liferay/resources/usr/local/liferay/scripts/pre-startup - if [ "$(git --git-dir "${SPINNER_LIFERAY_LXC_REPOSITORY_DIR}/.git" rev-parse --abbrev-ref HEAD)" == "master" ] + if [ -n "${ENVIRONMENT_DESCRIPTOR}" ] then - echo "FROM $(get_environment_descriptor "liferay-image")" > build/liferay/Dockerfile + echo "FROM $(grep -e "\"liferay-image\":" "${ENVIRONMENT_DESCRIPTOR}" | cut -d '"' -f 4)" > build/liferay/Dockerfile - local hotfix_environment_descriptor=$(get_environment_descriptor "hotfix") + local hotfix=$(grep -e "\"hotfix\":" "${ENVIRONMENT_DESCRIPTOR}" | cut -d '"' -f 4) - if [ ! -z "${hotfix_environment_descriptor}" ] + if [ -n "${hotfix}" ] then - hotfix_environment_descriptor="RUN \/opt\/liferay\/patching-tool\/patching-tool.sh install ${hotfix_environment_descriptor}" + hotfix="RUN \/opt\/liferay\/patching-tool\/patching-tool.sh install ${hotfix}" fi - sed -i "s/\[TO-BE-REPLACED-BY-SINGLE-CI\]/${hotfix_environment_descriptor}/g" "${SPINNER_LIFERAY_LXC_REPOSITORY_DIR}/liferay/Dockerfile.ext" + sed -i "s/\[TO-BE-REPLACED-BY-SINGLE-CI\]/${hotfix}/g" "${SPINNER_LIFERAY_LXC_REPOSITORY_DIR}/liferay/Dockerfile.ext" else echo "FROM $(grep -e '^liferay.workspace.docker.image.liferay=' "${SPINNER_LIFERAY_LXC_REPOSITORY_DIR}/liferay/gradle.properties" | cut -d '=' -f 2)" > build/liferay/Dockerfile fi @@ -397,6 +397,18 @@ function check_usage { exit "${LIFERAY_COMMON_EXIT_CODE_BAD}" fi + if [ "$(git --git-dir "${SPINNER_LIFERAY_LXC_REPOSITORY_DIR}/.git" rev-parse --abbrev-ref HEAD)" == "master" ] + then + ENVIRONMENT_DESCRIPTOR="${SPINNER_LIFERAY_LXC_REPOSITORY_DIR}/automation/environment-descriptors/${LXC_ENVIRONMENT}.json" + + if [ ! -e "${ENVIRONMENT_DESCRIPTOR}" ] + then + echo "The ${ENVIRONMENT_DESCRIPTOR} file does not exist." + + exit "${LIFERAY_COMMON_EXIT_CODE_BAD}" + fi + fi + if [[ $(find dxp-activation-key -name "*.xml" | wc -l ) -eq 0 ]] then echo "" @@ -423,19 +435,6 @@ function check_usage { mkdir -p "${STACK_DIR}" } -function get_environment_descriptor { - local environment_descriptor="${SPINNER_LIFERAY_LXC_REPOSITORY_DIR}/automation/environment-descriptors/${LXC_ENVIRONMENT}.json" - - if [ ! -e "${environment_descriptor}" ] - then - echo "The ${environment_descriptor} environment-descriptor does not exist." - - exit "${LIFERAY_COMMON_EXIT_CODE_BAD}" - fi - - grep -e "\"${1}\":" "${environment_descriptor}" | cut -d '"' -f 4 -} - function main { check_usage "${@}" From c80c9633269b03b62a3ee0567d34eaa20a377fcf Mon Sep 17 00:00:00 2001 From: Pedro Malta Date: Thu, 8 Aug 2024 10:00:45 -0300 Subject: [PATCH 069/140] LPD-30133 Generating the client resources zip for the 7.3 package releases --- release/_package.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/release/_package.sh b/release/_package.sh index c91fefcb4..1f661d8d5 100644 --- a/release/_package.sh +++ b/release/_package.sh @@ -185,9 +185,9 @@ function package_release { if [[ "${_PRODUCT_VERSION}" == 7.3* ]] then - rm -fr "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}" + rm -fr "${_BUILD_DIR}/liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}" - mkdir -p "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}" + mkdir -p "${_BUILD_DIR}/liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}" cp "${_PROJECTS_DIR}"/liferay-portal-ee/lib/development/hsql.jar "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}" cp "${_PROJECTS_DIR}"/liferay-portal-ee/lib/global/*.jar "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}" @@ -197,6 +197,17 @@ function package_release { zip -qr "${_BUILD_DIR}/release/liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}-${_BUILD_TIMESTAMP}.zip" "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}" rm -fr "${_BUILD_DIR}/release/liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}" + + rm -fr "${_BUILD_DIR}/release/liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-client-${_PRODUCT_VERSION}" + + mkdir -p "${_BUILD_DIR}/release/liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-client-${_PRODUCT_VERSION}" + + cp "${_PROJECTS_DIR}"/liferay-portal-ee/lib/development/{activation.jar,mail.jar} "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-client-${_PRODUCT_VERSION}" + cp "${_PROJECTS_DIR}"/liferay-portal-ee/lib/portal/{axis.jar,commons-discovery.jar,commons-logging.jar,jaxrpc.jar,portal-client.jar,saaj-api.jar,saaj-impl.jar,wsdl4j.jar} "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-client-${_PRODUCT_VERSION}" + + zip -qr "${_BUILD_DIR}/release/liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-client-${_PRODUCT_VERSION}-${_BUILD_TIMESTAMP}.zip" "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-client-${_PRODUCT_VERSION}" + + rm -fr "${_BUILD_DIR}/release/liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-client-${_PRODUCT_VERSION}" fi 7z a "${_BUILD_DIR}/release/liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-tomcat-${_PRODUCT_VERSION}-${_BUILD_TIMESTAMP}.7z" liferay-${LIFERAY_RELEASE_PRODUCT_NAME} From f1b134491b737f1886b5e1baf0f15d238437305a Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Mon, 12 Aug 2024 16:25:35 -0300 Subject: [PATCH 070/140] LPD-30133 Sort --- release/_package.sh | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/release/_package.sh b/release/_package.sh index 1f661d8d5..0cac5cb03 100644 --- a/release/_package.sh +++ b/release/_package.sh @@ -185,18 +185,10 @@ function package_release { if [[ "${_PRODUCT_VERSION}" == 7.3* ]] then - rm -fr "${_BUILD_DIR}/liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}" - - mkdir -p "${_BUILD_DIR}/liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}" - cp "${_PROJECTS_DIR}"/liferay-portal-ee/lib/development/hsql.jar "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}" - cp "${_PROJECTS_DIR}"/liferay-portal-ee/lib/global/*.jar "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}" - cp "${_PROJECTS_DIR}"/liferay-portal-ee/portal-kernel/portal-kernel.jar "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}" - cp "${_PROJECTS_DIR}"/liferay-portal-ee/tools/sdk/dist/com.liferay.registry.api-*.jar "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}/com.liferay.registry.api.jar" - - zip -qr "${_BUILD_DIR}/release/liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}-${_BUILD_TIMESTAMP}.zip" "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}" - - rm -fr "${_BUILD_DIR}/release/liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}" + # + # Client + # rm -fr "${_BUILD_DIR}/release/liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-client-${_PRODUCT_VERSION}" @@ -208,6 +200,23 @@ function package_release { zip -qr "${_BUILD_DIR}/release/liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-client-${_PRODUCT_VERSION}-${_BUILD_TIMESTAMP}.zip" "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-client-${_PRODUCT_VERSION}" rm -fr "${_BUILD_DIR}/release/liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-client-${_PRODUCT_VERSION}" + + # + # Dependencies + # + + rm -fr "${_BUILD_DIR}/liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}" + + mkdir -p "${_BUILD_DIR}/liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}" + + cp "${_PROJECTS_DIR}"/liferay-portal-ee/lib/development/hsql.jar "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}" + cp "${_PROJECTS_DIR}"/liferay-portal-ee/lib/global/*.jar "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}" + cp "${_PROJECTS_DIR}"/liferay-portal-ee/portal-kernel/portal-kernel.jar "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}" + cp "${_PROJECTS_DIR}"/liferay-portal-ee/tools/sdk/dist/com.liferay.registry.api-*.jar "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}/com.liferay.registry.api.jar" + + zip -qr "${_BUILD_DIR}/release/liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}-${_BUILD_TIMESTAMP}.zip" "liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}" + + rm -fr "${_BUILD_DIR}/release/liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-dependencies-${_PRODUCT_VERSION}" fi 7z a "${_BUILD_DIR}/release/liferay-${LIFERAY_RELEASE_PRODUCT_NAME}-tomcat-${_PRODUCT_VERSION}-${_BUILD_TIMESTAMP}.7z" liferay-${LIFERAY_RELEASE_PRODUCT_NAME} From 6928b1afa32f89b10e1892c52a287a7e965de52e Mon Sep 17 00:00:00 2001 From: Renato Rego Date: Tue, 13 Aug 2024 13:27:08 -0300 Subject: [PATCH 071/140] 2024.q2.9 --- bundles.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/bundles.yml b/bundles.yml index 4fcea807d..11319db09 100644 --- a/bundles.yml +++ b/bundles.yml @@ -732,6 +732,7 @@ quarterly: 2024.q2.6: 2024.q2.7: 2024.q2.8: + 2024.q2.9: latest: true snapshot: snapshot-master: From e789b1ccdef2166779218aef1363d2a32d5d0b62 Mon Sep 17 00:00:00 2001 From: Renato Rego Date: Tue, 13 Aug 2024 13:28:57 -0300 Subject: [PATCH 072/140] 7.0.1 change log --- .releng/docker-image.changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.releng/docker-image.changelog b/.releng/docker-image.changelog index addaf814d..b5d6d0e6b 100644 --- a/.releng/docker-image.changelog +++ b/.releng/docker-image.changelog @@ -1068,3 +1068,10 @@ docker.image.git.id-6.0.0=ca10bd5d0abeae4e45b35a088595fb629b739070 docker.image.change.log-7.0.0=DOCKER-255 DOCKER-252 docker.image.git.id-7.0.0=b0f66de42ec364ab56be96091dbdad37e3d02d11 + +# +# Liferay Docker Image Version 7.0.1 +# + +docker.image.change.log-7.0.1=DOCKER-249 +docker.image.git.id-7.0.1=6928b1afa32f89b10e1892c52a287a7e965de52e From 1d976594f8b8f134e814320f940779b20fc1df5a Mon Sep 17 00:00:00 2001 From: Renato Rego Date: Wed, 14 Aug 2024 08:23:53 -0300 Subject: [PATCH 073/140] DOCKER-256 Make symbolic link target support JDK 21 --- .../resources/usr/local/bin/set_java_version.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/templates/_jdk/resources/usr/local/bin/set_java_version.sh b/templates/_jdk/resources/usr/local/bin/set_java_version.sh index 33da01266..b0eaa05d6 100755 --- a/templates/_jdk/resources/usr/local/bin/set_java_version.sh +++ b/templates/_jdk/resources/usr/local/bin/set_java_version.sh @@ -1,9 +1,19 @@ #!/bin/bash function create_symlink { - if [[ -e /usr/lib/jvm/"${2}"-"${1}" ]] && [[ ! -e /usr/lib/jvm/"${2//-/}" ]] + local target + + if [[ -e /usr/lib/jvm/"${2}"-"${1}" ]] + then + target=/usr/lib/jvm/"${2}"-"${1}" + elif [[ -e /usr/lib/jvm/"${2}"-crac-"${1}" ]] + then + target=/usr/lib/jvm/"${2}"-crac-"${1}" + fi + + if [[ -n "${target}" ]] && [[ ! -e /usr/lib/jvm/"${2//-/}" ]] then - ln -sf /usr/lib/jvm/"${2}"-"${1}" /usr/lib/jvm/"${2//-/}" + ln -sf ${target} /usr/lib/jvm/"${2//-/}" fi } From 9c7045538fee528f2bf50329e75875dea9fb69b5 Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Wed, 14 Aug 2024 08:36:11 -0300 Subject: [PATCH 074/140] DOCKER-256 Rename --- .../_jdk/resources/usr/local/bin/set_java_version.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/templates/_jdk/resources/usr/local/bin/set_java_version.sh b/templates/_jdk/resources/usr/local/bin/set_java_version.sh index b0eaa05d6..2c351937a 100755 --- a/templates/_jdk/resources/usr/local/bin/set_java_version.sh +++ b/templates/_jdk/resources/usr/local/bin/set_java_version.sh @@ -1,19 +1,19 @@ #!/bin/bash function create_symlink { - local target + local target_dir if [[ -e /usr/lib/jvm/"${2}"-"${1}" ]] then - target=/usr/lib/jvm/"${2}"-"${1}" + target_dir=/usr/lib/jvm/"${2}"-"${1}" elif [[ -e /usr/lib/jvm/"${2}"-crac-"${1}" ]] then - target=/usr/lib/jvm/"${2}"-crac-"${1}" + target_dir=/usr/lib/jvm/"${2}"-crac-"${1}" fi - if [[ -n "${target}" ]] && [[ ! -e /usr/lib/jvm/"${2//-/}" ]] + if [[ -n "${target_dir}" ]] && [[ ! -e /usr/lib/jvm/"${2//-/}" ]] then - ln -sf ${target} /usr/lib/jvm/"${2//-/}" + ln -sf ${target_dir} /usr/lib/jvm/"${2//-/}" fi } From 9593e425d466068cef5d0c3271b87d69fdfeebb0 Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Wed, 14 Aug 2024 08:37:41 -0300 Subject: [PATCH 075/140] DOCKER-256 Can you verify that this works --- .../_jdk/resources/usr/local/bin/set_java_version.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/templates/_jdk/resources/usr/local/bin/set_java_version.sh b/templates/_jdk/resources/usr/local/bin/set_java_version.sh index 2c351937a..78ae427a4 100755 --- a/templates/_jdk/resources/usr/local/bin/set_java_version.sh +++ b/templates/_jdk/resources/usr/local/bin/set_java_version.sh @@ -3,24 +3,24 @@ function create_symlink { local target_dir - if [[ -e /usr/lib/jvm/"${2}"-"${1}" ]] + if [ -e "/usr/lib/jvm/${2}-${1}" ] then target_dir=/usr/lib/jvm/"${2}"-"${1}" - elif [[ -e /usr/lib/jvm/"${2}"-crac-"${1}" ]] + elif [ -e "/usr/lib/jvm/${2}-crac-${1}" ] then - target_dir=/usr/lib/jvm/"${2}"-crac-"${1}" + target_dir="/usr/lib/jvm/${2}-crac-${1}" fi - if [[ -n "${target_dir}" ]] && [[ ! -e /usr/lib/jvm/"${2//-/}" ]] + if [ -n "${target_dir}" ] && [ ! -e "/usr/lib/jvm/${2//-/}" ] then - ln -sf ${target_dir} /usr/lib/jvm/"${2//-/}" + ln -sf ${target_dir} "/usr/lib/jvm/${2//-/}" fi } function main { if [ -n "${JAVA_VERSION}" ] then - if [[ ! -e "/usr/lib/jvm/${JAVA_VERSION}" ]] + if [ ! -e "/usr/lib/jvm/${JAVA_VERSION}" ] then local architecture=$(dpkg --print-architecture) local zulu_version=$(echo "${JAVA_VERSION}" | tr -dc '0-9') From e69ac339f5487675cfefe3ffb5ebabd193fd89ef Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Wed, 14 Aug 2024 08:37:44 -0300 Subject: [PATCH 076/140] 7.0.2 change log --- .releng/docker-image.changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.releng/docker-image.changelog b/.releng/docker-image.changelog index b5d6d0e6b..3b31dc77d 100644 --- a/.releng/docker-image.changelog +++ b/.releng/docker-image.changelog @@ -1075,3 +1075,10 @@ docker.image.git.id-7.0.0=b0f66de42ec364ab56be96091dbdad37e3d02d11 docker.image.change.log-7.0.1=DOCKER-249 docker.image.git.id-7.0.1=6928b1afa32f89b10e1892c52a287a7e965de52e + +# +# Liferay Docker Image Version 7.0.2 +# + +docker.image.change.log-7.0.2=DOCKER-256 +docker.image.git.id-7.0.2=9593e425d466068cef5d0c3271b87d69fdfeebb0 From 37ad61dc04b94381e000093d3fc368e0f316a84e Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Wed, 14 Aug 2024 09:15:07 -0300 Subject: [PATCH 077/140] Revert "LPD-29676 Do not download bundle from CDN to prevent issues" This reverts commit 016e616188847e55e7eec759845482ea9afe6b53. --- build_all_images.sh | 2 +- release/_publishing.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build_all_images.sh b/build_all_images.sh index 8a87ceba2..528823d43 100755 --- a/build_all_images.sh +++ b/build_all_images.sh @@ -67,7 +67,7 @@ function build_bundle_image { if [ -z "${bundle_url}" ] then - bundle_url="releases.liferay.com/dxp/${version}/"$(curl -fsSL "https://releases.liferay.com/dxp/${version}/.lfrrelease-tomcat-bundle") + bundle_url="releases-cdn.liferay.com/dxp/${version}/"$(curl -fsSL "https://releases-cdn.liferay.com/dxp/${version}/.lfrrelease-tomcat-bundle") fi if [ -n "${additional_tags}" ] diff --git a/release/_publishing.sh b/release/_publishing.sh index f02d8c3bb..87145fe44 100644 --- a/release/_publishing.sh +++ b/release/_publishing.sh @@ -276,7 +276,7 @@ function _update_bundles_yml { if [[ "${_PRODUCT_VERSION}" == 7.4.*-ga* ]] then - local ga_bundle_url="releases-cdn.liferay.com/portal/${_PRODUCT_VERSION}/"$(curl -fsSL "https://releases.liferay.com/portal/${_PRODUCT_VERSION}/.lfrrelease-tomcat-bundle") + local ga_bundle_url="releases-cdn.liferay.com/portal/${_PRODUCT_VERSION}/"$(curl -fsSL "https://releases-cdn.liferay.com/portal/${_PRODUCT_VERSION}/.lfrrelease-tomcat-bundle") perl -i -0777pe 's/\s+latest: true(?!7.4.13:)//' "${BASE_DIR}/bundles.yml" From c1d026764124fae892d9239c5741a23e76e246e2 Mon Sep 17 00:00:00 2001 From: Lucas Miranda Date: Wed, 14 Aug 2024 10:10:10 -0300 Subject: [PATCH 078/140] LPD-32530 Remove unintended content in bundles folder --- release/_bom.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/release/_bom.sh b/release/_bom.sh index 1f8fe7139..b10e3eb24 100644 --- a/release/_bom.sh +++ b/release/_bom.sh @@ -175,6 +175,9 @@ function generate_distro_jar { lc_cd "${_BUNDLES_DIR}/tomcat/bin" ./catalina.sh stop + + rm -f "${_BUNDLES_DIR}"/osgi/modules/biz.aQute.remote.agent-6.4.0.jar + rm -f "${_BUNDLES_DIR}"/tomcat/logs/* } function generate_pom_release_api { From 15399ce37612b1766513053f224061e5ade2e937 Mon Sep 17 00:00:00 2001 From: Renato Rego Date: Wed, 14 Aug 2024 13:36:37 -0300 Subject: [PATCH 079/140] LPD-32530 SF --- release/_bom.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release/_bom.sh b/release/_bom.sh index b10e3eb24..06c8a0a49 100644 --- a/release/_bom.sh +++ b/release/_bom.sh @@ -176,8 +176,8 @@ function generate_distro_jar { ./catalina.sh stop - rm -f "${_BUNDLES_DIR}"/osgi/modules/biz.aQute.remote.agent-6.4.0.jar - rm -f "${_BUNDLES_DIR}"/tomcat/logs/* + rm -f "${_BUNDLES_DIR}/osgi/modules/biz.aQute.remote.agent-6.4.0.jar" + rm -fr "${_BUNDLES_DIR}"/tomcat/logs/* } function generate_pom_release_api { From e9d90cebfc251bbb6c182bd88feba00a88360a50 Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Wed, 14 Aug 2024 15:34:54 -0300 Subject: [PATCH 080/140] LPD-32530 SF --- release/_bom.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/_bom.sh b/release/_bom.sh index 06c8a0a49..7d3fad605 100644 --- a/release/_bom.sh +++ b/release/_bom.sh @@ -177,7 +177,7 @@ function generate_distro_jar { ./catalina.sh stop rm -f "${_BUNDLES_DIR}/osgi/modules/biz.aQute.remote.agent-6.4.0.jar" - rm -fr "${_BUNDLES_DIR}"/tomcat/logs/* + rm -fr "${_BUNDLES_DIR}/tomcat/logs/*" } function generate_pom_release_api { From 46782131a2375634922cdd11d244756cc35c1f15 Mon Sep 17 00:00:00 2001 From: Lucas Miranda Date: Wed, 14 Aug 2024 17:52:04 -0300 Subject: [PATCH 081/140] LPD-32530 Bash does not delete everything if * is between parentheses --- release/_bom.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/_bom.sh b/release/_bom.sh index 7d3fad605..06c8a0a49 100644 --- a/release/_bom.sh +++ b/release/_bom.sh @@ -177,7 +177,7 @@ function generate_distro_jar { ./catalina.sh stop rm -f "${_BUNDLES_DIR}/osgi/modules/biz.aQute.remote.agent-6.4.0.jar" - rm -fr "${_BUNDLES_DIR}/tomcat/logs/*" + rm -fr "${_BUNDLES_DIR}"/tomcat/logs/* } function generate_pom_release_api { From 8618f42ca361d9fae2ec4967d9e72d62f65d453a Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Thu, 15 Aug 2024 08:16:48 -0300 Subject: [PATCH 082/140] Use development mode for nightly (once a week) to rebuild everything) --- build_nightly.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/build_nightly.sh b/build_nightly.sh index 3709fd4d2..6e1964e15 100755 --- a/build_nightly.sh +++ b/build_nightly.sh @@ -4,11 +4,15 @@ while true do git pull origin master - LIFERAY_DOCKER_IMAGE_FILTER=7.4.13.nightly ./build_all_images.sh --push - if [ $(date +%w) == 0 ] then docker system prune --all --force + + git clean -dfx + + LIFERAY_DOCKER_DEVELOPER_MODE=true LIFERAY_DOCKER_IMAGE_FILTER=7.4.13.nightly ./build_all_images.sh --push + else + LIFERAY_DOCKER_IMAGE_FILTER=7.4.13.nightly ./build_all_images.sh --push fi echo "" From cee896c2cc7a4e23a2011d4ae751c9a17a00a065 Mon Sep 17 00:00:00 2001 From: Pedro Malta Date: Wed, 14 Aug 2024 15:17:34 -0300 Subject: [PATCH 083/140] LRP-4868 Downloading the release-notes.txt instead of using local file --- release/_publishing.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/release/_publishing.sh b/release/_publishing.sh index 87145fe44..c2bdbe506 100644 --- a/release/_publishing.sh +++ b/release/_publishing.sh @@ -1,7 +1,16 @@ #!/bin/bash function add_fixed_issues_to_patcher_project_version { - IFS=',' read -r -a fixed_issues_array < "${_BUILD_DIR}/release/release-notes.txt" + lc_download "https://releases.liferay.com/dxp/${_PRODUCT_VERSION}/release-notes.txt" release-notes.txt + + if [ "${?}" -ne 0 ] + then + lc_log ERROR "Unable to download release-notes.txt." + + return "${LIFERAY_COMMON_EXIT_CODE_BAD}" + fi + + IFS=',' read -r -a fixed_issues_array < "release-notes.txt" local fixed_issues_array_length="${#fixed_issues_array[@]}" @@ -32,11 +41,15 @@ function add_fixed_issues_to_patcher_project_version { else lc_log ERROR "Unable to add fixed issues to Liferay Patcher project ${2}." + rm -f release-notes.txt + return "${LIFERAY_COMMON_EXIT_CODE_BAD}" fi done lc_log INFO "Added fixed issues to Liferay Patcher project ${2}." + + rm -f release-notes.txt } function add_patcher_project_version { From 3a6195ab99f9535d555f5d947cf1eb6e5a289f2d Mon Sep 17 00:00:00 2001 From: Pedro Malta Date: Wed, 14 Aug 2024 15:18:56 -0300 Subject: [PATCH 084/140] LRP-4868 Skipping the add patcher project version step for ga releases --- release/_publishing.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/release/_publishing.sh b/release/_publishing.sh index c2bdbe506..aac5e412d 100644 --- a/release/_publishing.sh +++ b/release/_publishing.sh @@ -53,6 +53,13 @@ function add_fixed_issues_to_patcher_project_version { } function add_patcher_project_version { + if [[ "${_PRODUCT_VERSION}" == *ga* ]] + then + lc_log INFO "Skipping the add patcher project version step for ${_PRODUCT_VERSION}." + + return "${LIFERAY_COMMON_EXIT_CODE_SKIPPED}" + fi + local patcher_product_version_label="Quarterly Releases" local patcher_project_version="${_PRODUCT_VERSION}" local root_patcher_project_version_name="" From fb46da1af1f2947f0f880b8afb31dcfbe2ef9bfb Mon Sep 17 00:00:00 2001 From: Pedro Malta Date: Wed, 14 Aug 2024 15:25:03 -0300 Subject: [PATCH 085/140] LRP-4868 Setting different nomenclature for 7.3 releases --- release/_publishing.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/release/_publishing.sh b/release/_publishing.sh index aac5e412d..71701e71d 100644 --- a/release/_publishing.sh +++ b/release/_publishing.sh @@ -67,6 +67,7 @@ function add_patcher_project_version { if [[ "${patcher_project_version}" == 7.3.* ]] then patcher_product_version_label="DXP 7.3" + patcher_project_version="fix-pack-dxp-$(echo "${_PRODUCT_VERSION}" | cut -d 'u' -f 2)-7310" root_patcher_project_version_name="fix-pack-base-7310" elif [[ "${patcher_project_version}" == 7.4.* ]] then From cf8402d0ce12950b48d2437c6386a5f33d01310d Mon Sep 17 00:00:00 2001 From: Pedro Malta Date: Wed, 14 Aug 2024 15:40:15 -0300 Subject: [PATCH 086/140] LRP-4868 Using the HTTP response code to check if the curl was successful --- release/_publishing.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/_publishing.sh b/release/_publishing.sh index 71701e71d..ab5f09f43 100644 --- a/release/_publishing.sh +++ b/release/_publishing.sh @@ -85,7 +85,7 @@ function add_patcher_project_version { --silent \ --user "${LIFERAY_RELEASE_PATCHER_PORTAL_EMAIL_ADDRESS}:${LIFERAY_RELEASE_PATCHER_PORTAL_PASSWORD}") - if [ "${?}" -eq 0 ] + if [ $(echo "${add_by_name_response}" | jq -r '.status') -eq 200 ] then lc_log INFO "Added Liferay Patcher project version ${patcher_project_version}." From a3f253c5f68b6e8394a690eafec2c779bb650f82 Mon Sep 17 00:00:00 2001 From: Lucas Miranda Date: Fri, 9 Aug 2024 12:54:08 -0300 Subject: [PATCH 087/140] LPD-32745 Add missing TLDs to api-jar --- release/_bom.sh | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/release/_bom.sh b/release/_bom.sh index 06c8a0a49..eaadd2cfb 100644 --- a/release/_bom.sh +++ b/release/_bom.sh @@ -107,6 +107,22 @@ function generate_api_jars { _manage_bom_jar "${module_jar}" done fi + + for file in $(ls api-jar/META-INF --almost-all | grep --extended-regexp --invert-match '^(alloy-util.tld|alloy.tld|c.tld|liferay.tld)$') + do + if [[ "$file" == *.tld ]] + then + rm "api-jar/META-INF/${file}" + fi + done + + _copy_tld "api-jar/META-INF" "liferay-*.tld" "ratings.tld" + + mkdir -p api-jar/META-INF/resources/WEB-INF + + _copy_tld "api-jar/META-INF/resources" "liferay-application-list.tld" "liferay-data-engine.tld" "liferay-ddm.tld" "liferay-export-import-changeset.tld" "liferay-form.tld" "liferay-staging.tld" "liferay-template.tld" "react.tld" "soy.tld" + + _copy_tld "api-jar/META-INF/resources/WEB-INF" "liferay-*.tld" "ratings.tld" "react.tld" "soy.tld" } function generate_api_source_jar { @@ -401,6 +417,31 @@ function _copy_source_package { cp -a "${1}" "${new_dir_name}" } +function _copy_tld { + local directory="$1" + local file_names="" + local tlds=("${@:2}") + + for tld in "${tlds[@]}" + do + if [ -n "${file_names}" ] + then + file_names+=" -o " + fi + + file_names+="-name \"${tld}\"" + done + + for file in $(eval find "${_PROJECTS_DIR}" \ + "${file_names}" -type f | \ + awk -F "/" '{print $NF, $0}' | \ + sort -k 1,1 -u | \ + awk '{print $2}') + do + cp "${file}" "${directory}" + done +} + function _manage_bom_jar { lc_log DEBUG "Processing ${1} for api jar." From 7299bdaa4b1e888a9767c578408a963f0766b1ee Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Thu, 15 Aug 2024 15:14:42 -0300 Subject: [PATCH 088/140] LPD-32745 As used --- release/_bom.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/release/_bom.sh b/release/_bom.sh index eaadd2cfb..faa08d046 100644 --- a/release/_bom.sh +++ b/release/_bom.sh @@ -117,11 +117,10 @@ function generate_api_jars { done _copy_tld "api-jar/META-INF" "liferay-*.tld" "ratings.tld" + _copy_tld "api-jar/META-INF/resources" "liferay-application-list.tld" "liferay-data-engine.tld" "liferay-ddm.tld" "liferay-export-import-changeset.tld" "liferay-form.tld" "liferay-staging.tld" "liferay-template.tld" "react.tld" "soy.tld" mkdir -p api-jar/META-INF/resources/WEB-INF - _copy_tld "api-jar/META-INF/resources" "liferay-application-list.tld" "liferay-data-engine.tld" "liferay-ddm.tld" "liferay-export-import-changeset.tld" "liferay-form.tld" "liferay-staging.tld" "liferay-template.tld" "react.tld" "soy.tld" - _copy_tld "api-jar/META-INF/resources/WEB-INF" "liferay-*.tld" "ratings.tld" "react.tld" "soy.tld" } From 8d8ff0c4baa72583bed18d7c668dfece34c2e745 Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Thu, 15 Aug 2024 15:15:40 -0300 Subject: [PATCH 089/140] LPD-32745 SF --- release/_bom.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release/_bom.sh b/release/_bom.sh index faa08d046..06813c8ab 100644 --- a/release/_bom.sh +++ b/release/_bom.sh @@ -417,8 +417,8 @@ function _copy_source_package { } function _copy_tld { - local directory="$1" local file_names="" + local tlds=("${@:2}") for tld in "${tlds[@]}" @@ -437,7 +437,7 @@ function _copy_tld { sort -k 1,1 -u | \ awk '{print $2}') do - cp "${file}" "${directory}" + cp "${file}" "${1}" done } From cedb6afa977699f54272f4d70cbbc0db4cbeab82 Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Thu, 15 Aug 2024 15:16:52 -0300 Subject: [PATCH 090/140] LPD-32745 SF --- release/_bom.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/release/_bom.sh b/release/_bom.sh index 06813c8ab..610f3c5af 100644 --- a/release/_bom.sh +++ b/release/_bom.sh @@ -417,25 +417,25 @@ function _copy_source_package { } function _copy_tld { - local file_names="" + local arguments="" local tlds=("${@:2}") for tld in "${tlds[@]}" do - if [ -n "${file_names}" ] + if [ -n "${arguments}" ] then - file_names+=" -o " + arguments+=" -o " fi - file_names+="-name \"${tld}\"" + arguments+="-name \"${tld}\"" done for file in $(eval find "${_PROJECTS_DIR}" \ - "${file_names}" -type f | \ - awk -F "/" '{print $NF, $0}' | \ - sort -k 1,1 -u | \ - awk '{print $2}') + "${arguments}" -type f | \ + awk -F "/" '{print $NF, $0}' | \ + sort -k 1,1 -u | \ + awk '{print $2}') do cp "${file}" "${1}" done From eb48a490fe5eedc78457c0246996a8ba5afb316e Mon Sep 17 00:00:00 2001 From: Lucas Miranda Date: Fri, 16 Aug 2024 08:08:07 -0300 Subject: [PATCH 091/140] LPD-32745 Create resources folder to copy files to it afterwards --- release/_bom.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/release/_bom.sh b/release/_bom.sh index 610f3c5af..606d05013 100644 --- a/release/_bom.sh +++ b/release/_bom.sh @@ -117,6 +117,9 @@ function generate_api_jars { done _copy_tld "api-jar/META-INF" "liferay-*.tld" "ratings.tld" + + mkdir -p api-jar/META-INF/resources + _copy_tld "api-jar/META-INF/resources" "liferay-application-list.tld" "liferay-data-engine.tld" "liferay-ddm.tld" "liferay-export-import-changeset.tld" "liferay-form.tld" "liferay-staging.tld" "liferay-template.tld" "react.tld" "soy.tld" mkdir -p api-jar/META-INF/resources/WEB-INF From 303af1144e8c7c1ef95923f5f4c4c25a1227563d Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Fri, 16 Aug 2024 08:55:53 -0300 Subject: [PATCH 092/140] LPD-32745 SF --- release/_bom.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/_bom.sh b/release/_bom.sh index 606d05013..d82c95b04 100644 --- a/release/_bom.sh +++ b/release/_bom.sh @@ -122,7 +122,7 @@ function generate_api_jars { _copy_tld "api-jar/META-INF/resources" "liferay-application-list.tld" "liferay-data-engine.tld" "liferay-ddm.tld" "liferay-export-import-changeset.tld" "liferay-form.tld" "liferay-staging.tld" "liferay-template.tld" "react.tld" "soy.tld" - mkdir -p api-jar/META-INF/resources/WEB-INF + mkdir api-jar/META-INF/resources/WEB-INF _copy_tld "api-jar/META-INF/resources/WEB-INF" "liferay-*.tld" "ratings.tld" "react.tld" "soy.tld" } From 54b70fbb305b9da8520aa1fea41e086559f8f673 Mon Sep 17 00:00:00 2001 From: Wagner Santana Date: Fri, 16 Aug 2024 14:23:52 -0300 Subject: [PATCH 093/140] DOCKER-257 - curl --fail docker preventing container from getting live --- .../resources/usr/local/bin/monitor_liferay_lifecycle.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/bundle/resources/usr/local/bin/monitor_liferay_lifecycle.sh b/templates/bundle/resources/usr/local/bin/monitor_liferay_lifecycle.sh index 45e689bc5..e9ed43137 100755 --- a/templates/bundle/resources/usr/local/bin/monitor_liferay_lifecycle.sh +++ b/templates/bundle/resources/usr/local/bin/monitor_liferay_lifecycle.sh @@ -58,7 +58,7 @@ function main { local curl_content - curl_content=$(curl --connect-timeout "${LIFERAY_CONTAINER_STATUS_REQUEST_TIMEOUT}" --connect-to ":80:localhost:8080" --fail --max-time "${curl_max_time}" --show-error --silent "${LIFERAY_CONTAINER_STATUS_REQUEST_URL}" 2>/dev/null) + curl_content=$(curl --connect-timeout "${LIFERAY_CONTAINER_STATUS_REQUEST_TIMEOUT}" --connect-to ":80:localhost:8080" --max-time "${curl_max_time}" --show-error --silent "${LIFERAY_CONTAINER_STATUS_REQUEST_URL}" 2>/dev/null) local exit_code=${?} @@ -162,4 +162,4 @@ function touch_startup_lock { fi } -main \ No newline at end of file +main From f90bf478c9bda90a5727e27f3a90f34a701e405f Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Fri, 16 Aug 2024 20:48:12 -0300 Subject: [PATCH 094/140] DOCKER-257 Remove EOL --- .../bundle/resources/usr/local/bin/monitor_liferay_lifecycle.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/bundle/resources/usr/local/bin/monitor_liferay_lifecycle.sh b/templates/bundle/resources/usr/local/bin/monitor_liferay_lifecycle.sh index e9ed43137..54bcdae0e 100755 --- a/templates/bundle/resources/usr/local/bin/monitor_liferay_lifecycle.sh +++ b/templates/bundle/resources/usr/local/bin/monitor_liferay_lifecycle.sh @@ -162,4 +162,4 @@ function touch_startup_lock { fi } -main +main \ No newline at end of file From d74ff743ef59664c9ade7a878be0d42975bd6875 Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Fri, 16 Aug 2024 20:48:28 -0300 Subject: [PATCH 095/140] 7.0.3 change log --- .releng/docker-image.changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.releng/docker-image.changelog b/.releng/docker-image.changelog index 3b31dc77d..73ad42bb8 100644 --- a/.releng/docker-image.changelog +++ b/.releng/docker-image.changelog @@ -1082,3 +1082,10 @@ docker.image.git.id-7.0.1=6928b1afa32f89b10e1892c52a287a7e965de52e docker.image.change.log-7.0.2=DOCKER-256 docker.image.git.id-7.0.2=9593e425d466068cef5d0c3271b87d69fdfeebb0 + +# +# Liferay Docker Image Version 7.0.3 +# + +docker.image.change.log-7.0.3=DOCKER-257 +docker.image.git.id-7.0.3=f90bf478c9bda90a5727e27f3a90f34a701e405f From fec116ed4ee56b03b8791f603d139f6018247d81 Mon Sep 17 00:00:00 2001 From: Wagner Santana Date: Mon, 19 Aug 2024 15:10:29 -0300 Subject: [PATCH 096/140] DOCKER-258 - Revert DOCKER-257 --- .../bundle/resources/usr/local/bin/monitor_liferay_lifecycle.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/bundle/resources/usr/local/bin/monitor_liferay_lifecycle.sh b/templates/bundle/resources/usr/local/bin/monitor_liferay_lifecycle.sh index 54bcdae0e..45e689bc5 100755 --- a/templates/bundle/resources/usr/local/bin/monitor_liferay_lifecycle.sh +++ b/templates/bundle/resources/usr/local/bin/monitor_liferay_lifecycle.sh @@ -58,7 +58,7 @@ function main { local curl_content - curl_content=$(curl --connect-timeout "${LIFERAY_CONTAINER_STATUS_REQUEST_TIMEOUT}" --connect-to ":80:localhost:8080" --max-time "${curl_max_time}" --show-error --silent "${LIFERAY_CONTAINER_STATUS_REQUEST_URL}" 2>/dev/null) + curl_content=$(curl --connect-timeout "${LIFERAY_CONTAINER_STATUS_REQUEST_TIMEOUT}" --connect-to ":80:localhost:8080" --fail --max-time "${curl_max_time}" --show-error --silent "${LIFERAY_CONTAINER_STATUS_REQUEST_URL}" 2>/dev/null) local exit_code=${?} From 07076f7a9a01856d60e2f4c1133fb3e3ffbe9a0c Mon Sep 17 00:00:00 2001 From: Renato Rego Date: Thu, 25 Jul 2024 16:13:54 -0300 Subject: [PATCH 097/140] LPD-32411 Publish distro BOM .pom file when publishing a new release --- release/_promotion.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/_promotion.sh b/release/_promotion.sh index 5293f3a4d..2dba2d74b 100644 --- a/release/_promotion.sh +++ b/release/_promotion.sh @@ -34,7 +34,7 @@ function prepare_poms_for_promotion { local nexus_repository_name="${1}" local nexus_repository_url="https://repository.liferay.com/nexus/service/local/repositories" - for pom_name in "release.${LIFERAY_RELEASE_PRODUCT_NAME}.api" "release.${LIFERAY_RELEASE_PRODUCT_NAME}.bom" "release.${LIFERAY_RELEASE_PRODUCT_NAME}.bom.compile.only" "release.${LIFERAY_RELEASE_PRODUCT_NAME}.bom.third.party" + for pom_name in "release.${LIFERAY_RELEASE_PRODUCT_NAME}.api" "release.${LIFERAY_RELEASE_PRODUCT_NAME}.bom" "release.${LIFERAY_RELEASE_PRODUCT_NAME}.bom.compile.only" "release.${LIFERAY_RELEASE_PRODUCT_NAME}.bom.third.party" "release.${LIFERAY_RELEASE_PRODUCT_NAME}.distro" do _download_bom_file "${nexus_repository_url}/${nexus_repository_name}/content/com/liferay/portal/${pom_name}/${_ARTIFACT_RC_VERSION}/${pom_name}-${_ARTIFACT_RC_VERSION}.pom" "${_PROMOTION_DIR}/${pom_name}-${_PRODUCT_VERSION}.pom" done From 3e62a6663f3e6d57e6aca676f61befe5dd0041d4 Mon Sep 17 00:00:00 2001 From: Renato Rego Date: Thu, 25 Jul 2024 16:43:19 -0300 Subject: [PATCH 098/140] LPD-32411 Publish distro BOM .jar file when publishing a new release --- release/_promotion.sh | 4 +++- release/release_gold.sh | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/release/_promotion.sh b/release/_promotion.sh index 2dba2d74b..5037b013f 100644 --- a/release/_promotion.sh +++ b/release/_promotion.sh @@ -1,6 +1,6 @@ #!/bin/bash -function prepare_api_jars_for_promotion { +function prepare_jars_for_promotion { trap 'return ${LIFERAY_COMMON_EXIT_CODE_BAD}' ERR if [ -z "${LIFERAY_RELEASE_NEXUS_REPOSITORY_PASSWORD}" ] || [ -z "${LIFERAY_RELEASE_NEXUS_REPOSITORY_USER}" ] @@ -19,6 +19,8 @@ function prepare_api_jars_for_promotion { _download_bom_file "${nexus_repository_url}/${nexus_repository_name}/content/com/liferay/portal/release.${LIFERAY_RELEASE_PRODUCT_NAME}.api/${_ARTIFACT_RC_VERSION}/${jar_rc_name}" "${_PROMOTION_DIR}/${jar_release_name}" done + + _download_bom_file "${nexus_repository_url}/${nexus_repository_name}/content/com/liferay/portal/release.${LIFERAY_RELEASE_PRODUCT_NAME}.distro/${_ARTIFACT_RC_VERSION}/release.${LIFERAY_RELEASE_PRODUCT_NAME}.distro-${_ARTIFACT_RC_VERSION}.jar" "${_PROMOTION_DIR}/release.${LIFERAY_RELEASE_PRODUCT_NAME}.distro-${_PRODUCT_VERSION}.jar" } function prepare_poms_for_promotion { diff --git a/release/release_gold.sh b/release/release_gold.sh index ad98a4d0e..6e1e6b9ab 100755 --- a/release/release_gold.sh +++ b/release/release_gold.sh @@ -187,7 +187,7 @@ function print_help { function promote_boms { lc_time_run prepare_poms_for_promotion xanadu - lc_time_run prepare_api_jars_for_promotion xanadu + lc_time_run prepare_jars_for_promotion xanadu lc_time_run upload_boms liferay-public-releases } From 13a06621d0fe70365ea555675f4b34819380492d Mon Sep 17 00:00:00 2001 From: Lucas Miranda Date: Thu, 22 Aug 2024 08:08:19 -0300 Subject: [PATCH 099/140] LPD-32411 Add test to cover promotion of distro BOMs --- release/test_promotion.sh | 58 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100755 release/test_promotion.sh diff --git a/release/test_promotion.sh b/release/test_promotion.sh new file mode 100755 index 000000000..a1667a87f --- /dev/null +++ b/release/test_promotion.sh @@ -0,0 +1,58 @@ +#!/bin/bash + +source _liferay_common.sh +source _promotion.sh +source _test_common.sh + +function main { + set_up + + prepare_jars_for_promotion xanadu + prepare_poms_for_promotion xanadu + + test_prepare_resources_for_promotion + + tear_down +} + +function set_up { + export LIFERAY_COMMON_EXIT_CODE_BAD=1 + export LIFERAY_RELEASE_PRODUCT_NAME="dxp" + export LIFERAY_RELEASE_RC_BUILD_TIMESTAMP="1721635298" + export LIFERAY_RELEASE_VERSION="2024.q2.6" + + export _PRODUCT_VERSION="${LIFERAY_RELEASE_VERSION}" + + export _ARTIFACT_RC_VERSION="${_PRODUCT_VERSION}-${LIFERAY_RELEASE_RC_BUILD_TIMESTAMP}" + + export _RELEASE_ROOT_DIR="${PWD}" + + export _PROMOTION_DIR="${_RELEASE_ROOT_DIR}/release-data/promotion/files" + + mkdir -p "${_PROMOTION_DIR}" + + lc_cd "${_PROMOTION_DIR}" +} + +function tear_down { + lc_cd .. + + rm -fr "${_PROMOTION_DIR}" + + unset LIFERAY_COMMON_EXIT_CODE_BAD + unset LIFERAY_RELEASE_PRODUCT_NAME + unset LIFERAY_RELEASE_RC_BUILD_TIMESTAMP + unset LIFERAY_RELEASE_VERSION + unset _ARTIFACT_RC_VERSION + unset _PRODUCT_VERSION + unset _PROMOTION_DIR + unset _RELEASE_ROOT_DIR +} + +function test_prepare_resources_for_promotion { + assert_equals \ + "$(find "${_PROMOTION_DIR}" -name "release.dxp.distro-${LIFERAY_RELEASE_VERSION}.jar" | grep -c /)" 1 \ + "$(find "${_PROMOTION_DIR}" -name "release.dxp.distro-${LIFERAY_RELEASE_VERSION}.pom" | grep -c /)" 1 +} + +main \ No newline at end of file From 64f5d390cd4ce92b6c35badc0229650472dc154c Mon Sep 17 00:00:00 2001 From: Pedro Malta Date: Mon, 19 Aug 2024 16:20:12 -0300 Subject: [PATCH 100/140] LPD-32410 Fixing issue where the previous release should not keep the promoted == true --- release/_releases_json.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/release/_releases_json.sh b/release/_releases_json.sh index 297027f85..2948a706f 100644 --- a/release/_releases_json.sh +++ b/release/_releases_json.sh @@ -58,9 +58,20 @@ function _process_new_product { lc_log INFO "The version ${_PRODUCT_VERSION} is already in releases.json." return "${LIFERAY_COMMON_EXIT_CODE_SKIPPED}" - else - _process_product_version "${LIFERAY_RELEASE_PRODUCT_NAME}" "${_PRODUCT_VERSION}" fi + + local product_group_version="$(echo "${_PRODUCT_VERSION}" | cut -d '.' -f 1,2)" + + jq "map( + if .productGroupVersion == \"${product_group_version}\" and .product == \"${LIFERAY_RELEASE_PRODUCT_NAME}\" + then + .promoted = \"false\" + else + . + end + )" "${releases_json}" > temp_file.json && mv temp_file.json "${releases_json}" + + _process_product_version "${LIFERAY_RELEASE_PRODUCT_NAME}" "${_PRODUCT_VERSION}" } function _process_product { From 385ef4ed8dc9cebb7248ed2efd654718ee4d2e9e Mon Sep 17 00:00:00 2001 From: Pedro Malta Date: Mon, 19 Aug 2024 16:25:43 -0300 Subject: [PATCH 101/140] LPD-32410 Adding test for process_new_product --- release/test_releases_json.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/release/test_releases_json.sh b/release/test_releases_json.sh index 125bb815b..255f20924 100755 --- a/release/test_releases_json.sh +++ b/release/test_releases_json.sh @@ -8,12 +8,16 @@ function main { set_up test_merge_json_snippets dxp + test_process_new_product test_promote_product_versions dxp tear_down } function set_up { + export LIFERAY_RELEASE_PRODUCT_NAME="dxp" + export _PRODUCT_VERSION="2024.q1.9999" + export _PROMOTION_DIR="${PWD}" export _RELEASE_ROOT_DIR="${PWD}" _process_product dxp &> /dev/null @@ -21,9 +25,14 @@ function set_up { _promote_product_versions dxp &> /dev/null _merge_json_snippets &> /dev/null + + _process_new_product &> /dev/null } function tear_down { + unset LIFERAY_RELEASE_PRODUCT_NAME + unset _PRODUCT_VERSION + unset _PROMOTION_DIR unset _RELEASE_ROOT_DIR rm ./*.json @@ -41,6 +50,14 @@ function test_merge_json_snippets { assert_equals "${earliest_count}" 1 "${latest_count}" 1 } +function test_process_new_product { + local actual_number_of_promoted_versions=$(jq "map(select(.promoted == \"true\")) | length" 0000-00-00-releases.json) + local expected_promoted_versions_dxp=$(grep -c '' "${_RELEASE_ROOT_DIR}/supported-dxp-versions.txt") + local expected_promoted_versions_portal=$(grep -c '' "${_RELEASE_ROOT_DIR}/supported-portal-versions.txt") + + assert_equals "${actual_number_of_promoted_versions}" $((expected_promoted_versions_dxp + expected_promoted_versions_portal - 1)) +} + function test_promote_product_versions { local product_name=${1} From 64382c9efd9da2fcd7dc2634d22e4dfe6eb9f2a1 Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Thu, 22 Aug 2024 11:02:55 -0300 Subject: [PATCH 102/140] LPD-32410 Sort --- release/_releases_json.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/_releases_json.sh b/release/_releases_json.sh index 2948a706f..f425e720b 100644 --- a/release/_releases_json.sh +++ b/release/_releases_json.sh @@ -63,7 +63,7 @@ function _process_new_product { local product_group_version="$(echo "${_PRODUCT_VERSION}" | cut -d '.' -f 1,2)" jq "map( - if .productGroupVersion == \"${product_group_version}\" and .product == \"${LIFERAY_RELEASE_PRODUCT_NAME}\" + if .product == \"${LIFERAY_RELEASE_PRODUCT_NAME}\" and .productGroupVersion == \"${product_group_version}\" then .promoted = \"false\" else From 09dfe8292e29423a18eac8ce0142c590c51d8a85 Mon Sep 17 00:00:00 2001 From: Lucas Miranda Date: Mon, 19 Aug 2024 15:05:33 -0300 Subject: [PATCH 103/140] LPD-24539 Move invoke_github_api to _github.sh --- release/_github.sh | 45 +++++++++++++++++++++++++++++++++++++++++ release/release_gold.sh | 34 ++++--------------------------- 2 files changed, 49 insertions(+), 30 deletions(-) create mode 100644 release/_github.sh diff --git a/release/_github.sh b/release/_github.sh new file mode 100644 index 000000000..ff7e2289a --- /dev/null +++ b/release/_github.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +source _liferay_common.sh + +function invoke_github_api_delete { + _invoke_github_api "${1}" "${2}" "DELETE" + + echo $? +} + +function invoke_github_api_post { + _invoke_github_api "${1}" "${2}" "POST" + + echo $? +} + +function _invoke_github_api { + if [ -z "${LIFERAY_RELEASE_REPOSITORY_OWNER}" ] + then + LIFERAY_RELEASE_REPOSITORY_OWNER=liferay + fi + + local curl_response=$(\ + curl \ + "https://api.github.com/repos/${LIFERAY_RELEASE_REPOSITORY_OWNER}/${1}" \ + --data "${2}" \ + --fail \ + --header "Accept: application/vnd.github+json" \ + --header "Authorization: Bearer ${LIFERAY_RELEASE_GITHUB_PAT}" \ + --header "X-GitHub-Api-Version: 2022-11-28" \ + --include \ + --max-time 10 \ + --request "${3}" \ + --retry 3 \ + --silent) + + if ! [[ $(echo "${curl_response}" | awk '/^HTTP/{print $2}') =~ ^2 ]] + then + echo "Unable to inkove GitHub API." + + return "${LIFERAY_COMMON_EXIT_CODE_SKIPPED}" + fi + + return "${LIFERAY_COMMON_EXIT_CODE_OK}" +} \ No newline at end of file diff --git a/release/release_gold.sh b/release/release_gold.sh index 6e1e6b9ab..be7e551d1 100755 --- a/release/release_gold.sh +++ b/release/release_gold.sh @@ -1,5 +1,6 @@ #!/bin/bash +source _github.sh source _liferay_common.sh source _product_info_json.sh source _promotion.sh @@ -47,30 +48,6 @@ function check_usage { LIFERAY_COMMON_LOG_DIR="${_PROMOTION_DIR%/*}" } -function invoke_github_api { - local curl_response=$(\ - curl \ - "https://api.github.com/repos/liferay/${1}" \ - --data "${2}" \ - --fail \ - --header "Accept: application/vnd.github+json" \ - --header "Authorization: Bearer ${LIFERAY_RELEASE_GITHUB_PAT}" \ - --header "X-GitHub-Api-Version: 2022-11-28" \ - --include \ - --max-time 10 \ - --request POST \ - --retry 3 \ - --silent) - - if [ $(echo "${curl_response}" | awk '/^HTTP/{print $2}') -ne 201 ] - then - lc_log ERROR "Unable to invoke GitHub API:" - lc_log ERROR "${curl_response}" - - return "${LIFERAY_COMMON_EXIT_CODE_SKIPPED}" - fi -} - function main { check_usage @@ -177,6 +154,7 @@ function print_help { echo " LIFERAY_RELEASE_PATCHER_PORTAL_PASSWORD: Password to the release team's Liferay Patcher user" echo " LIFERAY_RELEASE_PRODUCT_NAME (optional): Set to \"portal\" for CE. The default is \"DXP\"." echo " LIFERAY_RELEASE_RC_BUILD_TIMESTAMP: Timestamp of the build to publish" + echo " LIFERAY_RELEASE_REPOSITORY_OWNER (optional): Set to \"EnterpriseReleaseHU\" for development. The default is \"liferay\"." echo " LIFERAY_RELEASE_VERSION: DXP version of the release to publish" echo "" echo "Example: LIFERAY_RELEASE_RC_BUILD_TIMESTAMP=1695892964 LIFERAY_RELEASE_VERSION=2023.q3.0 ${0}" @@ -247,9 +225,7 @@ function tag_release { END ) - invoke_github_api "${repository}/git/tags" "${tag_data}" - - if [ $? -eq "${LIFERAY_COMMON_EXIT_CODE_SKIPPED}" ] + if [ $(invoke_github_api_post "${repository}/git/tags" "${tag_data}") -eq "${LIFERAY_COMMON_EXIT_CODE_SKIPPED}" ] then return "${LIFERAY_COMMON_EXIT_CODE_SKIPPED}" fi @@ -264,9 +240,7 @@ function tag_release { END ) - invoke_github_api "${repository}/git/refs" "${ref_data}" - - if [ $? -eq "${LIFERAY_COMMON_EXIT_CODE_SKIPPED}" ] + if [ $(invoke_github_api_post "${repository}/git/refs" "${ref_data}") -eq "${LIFERAY_COMMON_EXIT_CODE_SKIPPED}" ] then return "${LIFERAY_COMMON_EXIT_CODE_SKIPPED}" fi From df2eddc22995751272324876917856d18e8bc243 Mon Sep 17 00:00:00 2001 From: Lucas Miranda Date: Wed, 21 Aug 2024 18:08:13 -0300 Subject: [PATCH 104/140] LPD-24539 Create test for GitHub tag creation --- release/test_release_gold.sh | 55 ++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100755 release/test_release_gold.sh diff --git a/release/test_release_gold.sh b/release/test_release_gold.sh new file mode 100755 index 000000000..e4b09ef40 --- /dev/null +++ b/release/test_release_gold.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +source _github.sh +source _test_common.sh + +function main { + set_up + + test_invoke_github_api_post + + tear_down +} + +function set_up { + export LIFERAY_COMMON_EXIT_CODE_OK=0 + export LIFERAY_COMMON_EXIT_CODE_SKIPPED=4 + export LIFERAY_RELEASE_REPOSITORY_OWNER="natocesarrego" + export LIFERAY_RELEASE_VERSION="test-tag" +} + +function tear_down { + invoke_github_api_delete "liferay-portal-ee/git/refs/tags/${LIFERAY_RELEASE_VERSION}" + + unset LIFERAY_COMMON_EXIT_CODE_OK + unset LIFERAY_COMMON_EXIT_CODE_SKIPPED + unset LIFERAY_RELEASE_REPOSITORY_OWNER + unset LIFERAY_RELEASE_VERSION +} + +function test_invoke_github_api_post { + local ref_data=$( + cat <<- END + { + "message": "", + "ref": "refs/tags/${LIFERAY_RELEASE_VERSION}", + "sha": "d4e20d5ccbd8dd3ca5d9a9e03f80e293256b5560" + } + END + ) + + local tag_data=$( + cat <<- END + { + "message": "", + "object": "d4e20d5ccbd8dd3ca5d9a9e03f80e293256b5560", + "tag": "${LIFERAY_RELEASE_VERSION}", + "type": "commit" + } + END + ) + + assert_equals $(invoke_github_api_post "liferay-portal-ee/git/tags" "${tag_data}") "${LIFERAY_COMMON_EXIT_CODE_OK}" $(invoke_github_api_post "liferay-portal-ee/git/refs" "${ref_data}") "${LIFERAY_COMMON_EXIT_CODE_OK}" +} + +main \ No newline at end of file From e20d637194867ca2a43eea0216beccefe96948d6 Mon Sep 17 00:00:00 2001 From: Lucas Miranda Date: Wed, 21 Aug 2024 18:08:41 -0300 Subject: [PATCH 105/140] LPD-24539 Add script to run all tests --- release/run_tests.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 release/run_tests.sh diff --git a/release/run_tests.sh b/release/run_tests.sh new file mode 100755 index 000000000..de32c3e46 --- /dev/null +++ b/release/run_tests.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +function main { + tests_result=$(find . -name "test_*.sh" -type f -exec ./{} \;) + + echo "${tests_result}" + + if [[ "${tests_result}" == *"FAILED"* ]] + then + exit 1 + fi +} + +main \ No newline at end of file From 32096fb16c0bd9a5c2895a56075afcf4c7c7a518 Mon Sep 17 00:00:00 2001 From: Lucas Miranda Date: Wed, 21 Aug 2024 18:09:35 -0300 Subject: [PATCH 106/140] LPD-24539 Create a GitHub Action to run tests related to release scripts --- .github/workflows/release.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..da909f5c6 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,19 @@ +jobs: + release: + env: + LIFERAY_RELEASE_GITHUB_PAT: ${{ secrets.LIFERAY_RELEASE_GITHUB_PAT }} + if: (github.repository == 'natocesarrego/liferay-docker') + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Execute run_tests.sh + run: | + cd release + + ./run_tests.sh + shell: bash +name: Release +on: + pull_request: + types: [opened, reopened] \ No newline at end of file From d63bbfe0a393aa751e560feb731fe760b95287a6 Mon Sep 17 00:00:00 2001 From: Lucas Miranda Date: Wed, 21 Aug 2024 18:10:04 -0300 Subject: [PATCH 107/140] LPD-24539 Cover the possibility of a fail assertion among success assertions --- release/_test_common.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/release/_test_common.sh b/release/_test_common.sh index d7e9dc3b9..9ff53ee18 100755 --- a/release/_test_common.sh +++ b/release/_test_common.sh @@ -25,11 +25,19 @@ function assert_equals { if [ "${?}" -eq 0 ] then assertion_result="true" + else + assertion_result="false" + + break fi else if [ "${arguments[${index}]}" == "${arguments[${index} + 1]}" ] then assertion_result="true" + else + assertion_result="false" + + break fi fi done From 6724d39020b351f727d5b59dc4459ec247135101 Mon Sep 17 00:00:00 2001 From: Lucas Miranda Date: Wed, 21 Aug 2024 18:10:19 -0300 Subject: [PATCH 108/140] LPD-24539 Skip the test if liferay-portal-ee does not exist --- release/test_bom.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/release/test_bom.sh b/release/test_bom.sh index 3add995f5..efc3c0569 100755 --- a/release/test_bom.sh +++ b/release/test_bom.sh @@ -7,6 +7,11 @@ source _test_common.sh function main { set_up + if [ $? -eq "${LIFERAY_COMMON_EXIT_CODE_SKIPPED}" ] + then + return "${LIFERAY_COMMON_EXIT_CODE_SKIPPED}" + fi + test_generate_pom_release_bom_compile_only_dxp test_generate_pom_release_bom_third_party_dxp @@ -28,6 +33,13 @@ function set_up { export _PROJECTS_DIR="${_RELEASE_ROOT_DIR}"/../.. export _RELEASE_TOOL_DIR="${_RELEASE_ROOT_DIR}" + if [ ! -d "${_PROJECTS_DIR}/liferay-portal-ee" ] + then + echo "liferay-portal-ee does not exist." + + return "${LIFERAY_COMMON_EXIT_CODE_SKIPPED}" + fi + cd "${_PROJECTS_DIR}"/liferay-portal-ee git branch --delete "${_PRODUCT_VERSION}" &> /dev/null From 11864475cb31e0fe2dff0b14640157b33e27b5b6 Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Thu, 22 Aug 2024 11:05:39 -0300 Subject: [PATCH 109/140] LPD-24539 Wordsmith --- release/test_bom.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/test_bom.sh b/release/test_bom.sh index efc3c0569..dba01098e 100755 --- a/release/test_bom.sh +++ b/release/test_bom.sh @@ -35,7 +35,7 @@ function set_up { if [ ! -d "${_PROJECTS_DIR}/liferay-portal-ee" ] then - echo "liferay-portal-ee does not exist." + echo "The directory ${_PROJECTS_DIR}/liferay-portal-ee does not exist." return "${LIFERAY_COMMON_EXIT_CODE_SKIPPED}" fi From 2c767df6bbe32489b25b68ae6ffbbef09bdf9085 Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Thu, 22 Aug 2024 11:06:22 -0300 Subject: [PATCH 110/140] LPD-24539 Add local --- release/run_tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/run_tests.sh b/release/run_tests.sh index de32c3e46..b5844bc61 100755 --- a/release/run_tests.sh +++ b/release/run_tests.sh @@ -1,7 +1,7 @@ #!/bin/bash function main { - tests_result=$(find . -name "test_*.sh" -type f -exec ./{} \;) + local tests_result=$(find . -name "test_*.sh" -type f -exec ./{} \;) echo "${tests_result}" From 4cbb1b039fec90b34fb7b182e7452d01f9883f45 Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Thu, 22 Aug 2024 11:07:47 -0300 Subject: [PATCH 111/140] LPD-24539 Rename --- release/run_tests.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/release/run_tests.sh b/release/run_tests.sh index b5844bc61..4c44963c4 100755 --- a/release/run_tests.sh +++ b/release/run_tests.sh @@ -1,11 +1,11 @@ #!/bin/bash function main { - local tests_result=$(find . -name "test_*.sh" -type f -exec ./{} \;) + local tests_results=$(find . -name "test_*.sh" -type f -exec ./{} \;) - echo "${tests_result}" + echo "${tests_results}" - if [[ "${tests_result}" == *"FAILED"* ]] + if [[ "${tests_results}" == *"FAILED"* ]] then exit 1 fi From 4db964182c3510b2918d456a3ba4aeb06a3b97d2 Mon Sep 17 00:00:00 2001 From: Renato Rego Date: Fri, 23 Aug 2024 14:02:40 -0300 Subject: [PATCH 112/140] 2024.q2.10 --- bundles.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/bundles.yml b/bundles.yml index 11319db09..f85438033 100644 --- a/bundles.yml +++ b/bundles.yml @@ -733,6 +733,7 @@ quarterly: 2024.q2.7: 2024.q2.8: 2024.q2.9: + 2024.q2.10: latest: true snapshot: snapshot-master: From f31542650d49126279c905502f534b6b6cb6f751 Mon Sep 17 00:00:00 2001 From: Renato Rego Date: Fri, 23 Aug 2024 14:04:33 -0300 Subject: [PATCH 113/140] 7.0.4 change log --- .releng/docker-image.changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.releng/docker-image.changelog b/.releng/docker-image.changelog index 73ad42bb8..0a5306336 100644 --- a/.releng/docker-image.changelog +++ b/.releng/docker-image.changelog @@ -1089,3 +1089,10 @@ docker.image.git.id-7.0.2=9593e425d466068cef5d0c3271b87d69fdfeebb0 docker.image.change.log-7.0.3=DOCKER-257 docker.image.git.id-7.0.3=f90bf478c9bda90a5727e27f3a90f34a701e405f + +# +# Liferay Docker Image Version 7.0.4 +# + +docker.image.change.log-7.0.4=DOCKER-258 +docker.image.git.id-7.0.4=4db964182c3510b2918d456a3ba4aeb06a3b97d2 From 181faadf4ad819e3a8c7001e3963e3b48052b27c Mon Sep 17 00:00:00 2001 From: Pedro Malta Date: Fri, 23 Aug 2024 14:04:42 -0300 Subject: [PATCH 114/140] LPD-31859 Not using the cached file --- release/release_gold.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/release_gold.sh b/release/release_gold.sh index be7e551d1..908d877ae 100755 --- a/release/release_gold.sh +++ b/release/release_gold.sh @@ -92,7 +92,7 @@ function prepare_next_release_branch { rm -fr releases.json - lc_download "https://releases.liferay.com/releases.json" releases.json + LIFERAY_COMMON_DOWNLOAD_SKIP_CACHE="true" lc_download "https://releases.liferay.com/releases.json" releases.json local product_group_version="$(echo "${_PRODUCT_VERSION}" | cut -d '.' -f 1,2)" From c01229f18c8109308336e0f5497dd3ddc05d39fc Mon Sep 17 00:00:00 2001 From: Renato Rego Date: Fri, 23 Aug 2024 14:43:09 -0300 Subject: [PATCH 115/140] LPD-31859 Fix typo --- release/release_gold.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/release_gold.sh b/release/release_gold.sh index 908d877ae..562e449f7 100755 --- a/release/release_gold.sh +++ b/release/release_gold.sh @@ -128,7 +128,7 @@ function prepare_next_release_branch { git add "${BASE_DIR}/liferay-portal-ee/release.properties" - git commit -m "Prepeare ${quarterly_release_branch_name}." + git commit -m "Prepare ${quarterly_release_branch_name}." git push upstream "${quarterly_release_branch_name}" From a62cba06bf29363b02ecbae27a3e3485b9a11182 Mon Sep 17 00:00:00 2001 From: Pedro Malta Date: Wed, 21 Aug 2024 09:46:44 -0300 Subject: [PATCH 116/140] LPD-34371 Fixing the target platform version on release.properties for ga releases --- release/_package.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/release/_package.sh b/release/_package.sh index 0cac5cb03..3896598bb 100644 --- a/release/_package.sh +++ b/release/_package.sh @@ -91,7 +91,6 @@ function generate_release_properties_file { elif [ "${LIFERAY_RELEASE_PRODUCT_NAME}" == "portal" ] then product_version="Portal ${product_version}" - target_platform_version=$(echo "${target_platform_version}" | sed -r 's/-ga[0-9]+//') fi product_version="${product_version/-/ }" From 1631544e102a220c83571897c6c6bf8f3e10799f Mon Sep 17 00:00:00 2001 From: Pedro Malta Date: Thu, 22 Aug 2024 10:00:28 -0300 Subject: [PATCH 117/140] LPD-34371 Adding test for generate_release_properties_file --- release/test_releases_properties.sh | 55 +++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100755 release/test_releases_properties.sh diff --git a/release/test_releases_properties.sh b/release/test_releases_properties.sh new file mode 100755 index 000000000..a8c61584e --- /dev/null +++ b/release/test_releases_properties.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +source _liferay_common.sh +source _package.sh +source _test_common.sh + +function main { + set_up + + test_generate_release_properties_file_portal + + LIFERAY_RELEASE_PRODUCT_NAME="dxp" + _PRODUCT_VERSION="7.4.13-u36" + + test_generate_release_properties_file_dxp + + tear_down +} + +function set_up { + export LIFERAY_RELEASE_PRODUCT_NAME="portal" + export _BUNDLES_DIR="${PWD}" + export _PRODUCT_VERSION="7.4.3.120-ga120" + + mkdir -p "${_BUNDLES_DIR}/tomcat" + + echo "Apache Tomcat Version 9.9.99" > "${_BUNDLES_DIR}/tomcat/RELEASE-NOTES" +} + +function tear_down { + unset LIFERAY_RELEASE_PRODUCT_NAME + unset _BUNDLES_DIR + unset _PRODUCT_VERSION + + rm -f release.properties + rm -fr tomcat +} + +function test_generate_release_properties_file_portal { + generate_release_properties_file &>/dev/null + + assert_equals \ + "$(grep 'target.platform.version' release.properties | cut -d '=' -f 2)" \ + "${_PRODUCT_VERSION}" +} + +function test_generate_release_properties_file_dxp { + generate_release_properties_file &>/dev/null + + assert_equals \ + "$(grep 'target.platform.version' release.properties | cut -d '=' -f 2)" \ + "${_PRODUCT_VERSION/-/.}" +} + +main \ No newline at end of file From eab6f9a42a6e4cd767d1dee85d7ba8cb8f3045df Mon Sep 17 00:00:00 2001 From: Renato Rego Date: Tue, 27 Aug 2024 09:54:35 -0300 Subject: [PATCH 118/140] u126 --- bundles.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/bundles.yml b/bundles.yml index f85438033..d80152996 100644 --- a/bundles.yml +++ b/bundles.yml @@ -688,6 +688,7 @@ 7.4.13-u123: 7.4.13-u124: 7.4.13-u125: + 7.4.13-u126: 7.4.13.nightly: bundle_url: releases-cdn.liferay.com/dxp/nightly/liferay-dxp-tomcat-7.4.13.nightly.7z quarterly: From 9e8551889c4933d83b20ad85cbbd00ceded0f42d Mon Sep 17 00:00:00 2001 From: Renato Rego Date: Wed, 28 Aug 2024 16:32:49 -0300 Subject: [PATCH 119/140] 2024.q2.11 --- bundles.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/bundles.yml b/bundles.yml index d80152996..d4bfecd6b 100644 --- a/bundles.yml +++ b/bundles.yml @@ -735,6 +735,7 @@ quarterly: 2024.q2.8: 2024.q2.9: 2024.q2.10: + 2024.q2.11: latest: true snapshot: snapshot-master: From ea4a61aebcbe12f4e7dd9cd1381995ae8eedfe1b Mon Sep 17 00:00:00 2001 From: Pedro Malta Date: Thu, 29 Aug 2024 16:02:25 -0300 Subject: [PATCH 120/140] LPD-32410 Skip cache for download file --- release/_releases_json.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/_releases_json.sh b/release/_releases_json.sh index f425e720b..5328581df 100644 --- a/release/_releases_json.sh +++ b/release/_releases_json.sh @@ -50,7 +50,7 @@ function _process_new_product { then lc_log INFO "Downloading https://releases.liferay.com/releases.json to ${releases_json}." - lc_download https://releases.liferay.com/releases.json "${releases_json}" + LIFERAY_COMMON_DOWNLOAD_SKIP_CACHE="true" lc_download https://releases.liferay.com/releases.json "${releases_json}" fi if (grep "${_PRODUCT_VERSION}" "${releases_json}") From bc8470c30831b199bae2f3f89cc9637b33f92c56 Mon Sep 17 00:00:00 2001 From: Lucas Miranda Date: Fri, 30 Aug 2024 08:04:21 -0300 Subject: [PATCH 121/140] LPD-32530 Clean logs folder --- release/_bom.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/release/_bom.sh b/release/_bom.sh index d82c95b04..27e12fc69 100644 --- a/release/_bom.sh +++ b/release/_bom.sh @@ -194,6 +194,7 @@ function generate_distro_jar { ./catalina.sh stop + rm -fr "${_BUNDLES_DIR}"/logs/* rm -f "${_BUNDLES_DIR}/osgi/modules/biz.aQute.remote.agent-6.4.0.jar" rm -fr "${_BUNDLES_DIR}"/tomcat/logs/* } From c3f176e524365763e8ae84da656ba5009d61c94c Mon Sep 17 00:00:00 2001 From: Lucas Miranda Date: Tue, 27 Aug 2024 16:21:16 -0300 Subject: [PATCH 122/140] LPD-31467 Validate the type of artifact before trying to download it --- release/_bom.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/release/_bom.sh b/release/_bom.sh index 27e12fc69..789f4325c 100644 --- a/release/_bom.sh +++ b/release/_bom.sh @@ -50,13 +50,16 @@ function generate_api_jars { local name=$(echo "${artifact}" | sed -e "s/.*:\(.*\):.*/\\1/") local version=${artifact##*:} - lc_log INFO "Downloading and unzipping https://repository-cdn.liferay.com/nexus/content/groups/public/${group_path}/${name}/${version}/${name}-${version}-sources.jar." + if (! echo "${artifact}" | grep -q "com.liferay.alloy-taglibs:alloy-taglib:") + then + lc_log INFO "Downloading and unzipping https://repository-cdn.liferay.com/nexus/content/groups/public/${group_path}/${name}/${version}/${name}-${version}-sources.jar." - lc_download "https://repository-cdn.liferay.com/nexus/content/groups/public/${group_path}/${name}/${version}/${name}-${version}-sources.jar" "${name}-${version}-sources.jar" + lc_download "https://repository-cdn.liferay.com/nexus/content/groups/public/${group_path}/${name}/${version}/${name}-${version}-sources.jar" "${name}-${version}-sources.jar" - unzip -d api-sources-jar -o -q "${name}-${version}-sources.jar" + unzip -d api-sources-jar -o -q "${name}-${version}-sources.jar" - rm -f "${name}-${version}-sources.jar" + rm -f "${name}-${version}-sources.jar" + fi lc_log INFO "Downloading and unzipping https://repository-cdn.liferay.com/nexus/content/groups/public/${group_path}/${name}/${version}/${name}-${version}.jar." From d2b7823767abdd5bc1b21aa7dbed5b65c5e6aa77 Mon Sep 17 00:00:00 2001 From: Lucas Miranda Date: Tue, 27 Aug 2024 16:22:22 -0300 Subject: [PATCH 123/140] LPD-31467 Check if folder exists --- release/_bom.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/release/_bom.sh b/release/_bom.sh index 789f4325c..a918e15ac 100644 --- a/release/_bom.sh +++ b/release/_bom.sh @@ -160,6 +160,11 @@ function generate_api_source_jar { local package_dir=$(dirname "${packageinfo_file}") + if [ ! -d "${package_dir}" ] + then + continue + fi + lc_log DEBUG "Copying ${package_dir} because it has a packageinfo." _copy_source_package "${package_dir}" From 00c09967b4f25cd97dc4072d7d148ddeaab983d1 Mon Sep 17 00:00:00 2001 From: Lucas Miranda Date: Tue, 27 Aug 2024 16:23:07 -0300 Subject: [PATCH 124/140] LPD-31467 Remove duplication --- release/_bom.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/release/_bom.sh b/release/_bom.sh index a918e15ac..bdf11b6c2 100644 --- a/release/_bom.sh +++ b/release/_bom.sh @@ -28,7 +28,6 @@ function generate_api_jars { for artifact in ${enforce_version_artifacts} do if (! echo "${artifact}" | grep -q "com.fasterxml") && - (! echo "${artifact}" | grep -q "com.liferay.alloy-taglibs:alloy-taglib:") && (! echo "${artifact}" | grep -q "com.liferay.alloy-taglibs:alloy-taglib:") && (! echo "${artifact}" | grep -q "com.liferay.portletmvc4spring:com.liferay.portletmvc4spring.test:") && (! echo "${artifact}" | grep -q "com.liferay:biz.aQute.bnd.annotation:") && From f893056b00fc4829342656b589b96ecd659e267a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raymond=20Aug=C3=A9?= Date: Fri, 30 Aug 2024 14:24:54 -0400 Subject: [PATCH 125/140] DOCKER-259 Batch image script fails when payload size is too big --- .../usr/local/bin/liferay_batch_entrypoint.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/templates/batch/resources/usr/local/bin/liferay_batch_entrypoint.sh b/templates/batch/resources/usr/local/bin/liferay_batch_entrypoint.sh index 5a3a642d7..ade3cf9ba 100755 --- a/templates/batch/resources/usr/local/bin/liferay_batch_entrypoint.sh +++ b/templates/batch/resources/usr/local/bin/liferay_batch_entrypoint.sh @@ -109,6 +109,8 @@ function main { fi fi + local items_file="/tmp/items" + find /opt/liferay/batch -type f -name "*.batch-engine-data.json" -print0 2> /dev/null | LC_ALL=C sort -z | while IFS= read -r -d "" file_name do @@ -140,9 +142,9 @@ function main { echo "HREF: ${href}" - local items=$(jq -r ".items" ${file_name}) + jq -r ".items" ${file_name} > ${items_file} - echo "Items: ${items}" + echo "Items: $(<${items_file})" local parameters=$(jq -r '.configuration.parameters | [map_values(. | @uri) | to_entries[] | .key + "=" + .value] | join("&")' ${file_name} 2>/dev/null) @@ -159,7 +161,7 @@ function main { -H "Authorization: Bearer ${oauth2_access_token}" \ -H "Content-Type: application/json" \ -X POST \ - -d "${items}" \ + -d @${items_file} \ -s \ ${curl_options} \ "${lxc_dxp_server_protocol}://${lxc_dxp_main_domain}${href}${parameters}" \ @@ -172,6 +174,8 @@ function main { then echo "Received invalid POST response." + rm ${items_file} + exit 1 fi @@ -196,6 +200,8 @@ function main { echo "Execute Status: ${status}" done + rm ${items_file} + if [ "${status}" == "FAILED" ] then exit 1 From 56232c5444c9df9259b09bbfb9971d85145f3736 Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Fri, 30 Aug 2024 15:43:13 -0300 Subject: [PATCH 126/140] DOCKER-259 Rename and hard code it --- .../usr/local/bin/liferay_batch_entrypoint.sh | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/templates/batch/resources/usr/local/bin/liferay_batch_entrypoint.sh b/templates/batch/resources/usr/local/bin/liferay_batch_entrypoint.sh index ade3cf9ba..ac1f1e921 100755 --- a/templates/batch/resources/usr/local/bin/liferay_batch_entrypoint.sh +++ b/templates/batch/resources/usr/local/bin/liferay_batch_entrypoint.sh @@ -109,8 +109,6 @@ function main { fi fi - local items_file="/tmp/items" - find /opt/liferay/batch -type f -name "*.batch-engine-data.json" -print0 2> /dev/null | LC_ALL=C sort -z | while IFS= read -r -d "" file_name do @@ -142,9 +140,9 @@ function main { echo "HREF: ${href}" - jq -r ".items" ${file_name} > ${items_file} + jq -r ".items" ${file_name} > /tmp/liferay_batch_entrypoint.items.json - echo "Items: $(<${items_file})" + echo "Items: $(/dev/null) @@ -161,7 +159,7 @@ function main { -H "Authorization: Bearer ${oauth2_access_token}" \ -H "Content-Type: application/json" \ -X POST \ - -d @${items_file} \ + -d @/tmp/liferay_batch_entrypoint.items.json \ -s \ ${curl_options} \ "${lxc_dxp_server_protocol}://${lxc_dxp_main_domain}${href}${parameters}" \ @@ -174,7 +172,7 @@ function main { then echo "Received invalid POST response." - rm ${items_file} + rm /tmp/liferay_batch_entrypoint.items.json exit 1 fi @@ -200,7 +198,7 @@ function main { echo "Execute Status: ${status}" done - rm ${items_file} + rm /tmp/liferay_batch_entrypoint.items.json if [ "${status}" == "FAILED" ] then From 63755af8921c278d3e9108bff2b81127bfa6b833 Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Fri, 30 Aug 2024 15:43:22 -0300 Subject: [PATCH 127/140] 7.0.5 change log --- .releng/docker-image.changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.releng/docker-image.changelog b/.releng/docker-image.changelog index 0a5306336..d8ccc5461 100644 --- a/.releng/docker-image.changelog +++ b/.releng/docker-image.changelog @@ -1096,3 +1096,10 @@ docker.image.git.id-7.0.3=f90bf478c9bda90a5727e27f3a90f34a701e405f docker.image.change.log-7.0.4=DOCKER-258 docker.image.git.id-7.0.4=4db964182c3510b2918d456a3ba4aeb06a3b97d2 + +# +# Liferay Docker Image Version 7.0.5 +# + +docker.image.change.log-7.0.5=DOCKER-259 +docker.image.git.id-7.0.5=56232c5444c9df9259b09bbfb9971d85145f3736 From 1e43ca0591993a513ccb7dd8ef1c8e51d09b693c Mon Sep 17 00:00:00 2001 From: Pedro Malta Date: Tue, 27 Aug 2024 08:58:28 -0300 Subject: [PATCH 128/140] LPD-34563 Fix issue that prevented the script from entering the if condition --- release/_publishing.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/_publishing.sh b/release/_publishing.sh index ab5f09f43..81bfb75da 100644 --- a/release/_publishing.sh +++ b/release/_publishing.sh @@ -212,7 +212,7 @@ function upload_hotfix { scp "${_BUILD_DIR}/${_HOTFIX_FILE_NAME}" root@lrdcom-vm-1:"/www/releases.liferay.com/dxp/hotfix/${_PRODUCT_VERSION}/" - if (gsutils ls "gs://liferay-releases-hotfix/${_PRODUCT_VERSION}" | grep -q "${_HOTFIX_FILE_NAME}") + if (gsutil ls "gs://liferay-releases-hotfix/${_PRODUCT_VERSION}" | grep "${_HOTFIX_FILE_NAME}") then lc_log ERROR "Skipping the upload of ${_HOTFIX_FILE_NAME} to GCP because it already exists." From faf21c01350b7e298cfcce716a9fbc1f22f9f610 Mon Sep 17 00:00:00 2001 From: Pedro Malta Date: Tue, 27 Aug 2024 10:37:09 -0300 Subject: [PATCH 129/140] LPD-34563 Add the releases content to GCP --- release/release_gold.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/release/release_gold.sh b/release/release_gold.sh index 562e449f7..91bbd1525 100755 --- a/release/release_gold.sh +++ b/release/release_gold.sh @@ -53,6 +53,8 @@ function main { check_supported_versions + init_gcs + lc_time_run promote_packages lc_time_run tag_release @@ -147,6 +149,7 @@ function print_help { echo "" echo "The script reads the following environment variables:" echo "" + echo " LIFERAY_RELEASE_GCS_TOKEN (optional): *.json file containing the token to authenticate with Google Cloud Storage" echo " LIFERAY_RELEASE_GITHUB_PAT (optional): GitHub personal access token used to tag releases" echo " LIFERAY_RELEASE_NEXUS_REPOSITORY_PASSWORD (optional): Nexus user's password" echo " LIFERAY_RELEASE_NEXUS_REPOSITORY_USER (optional): Nexus user with the right to upload BOM files" @@ -179,6 +182,15 @@ function promote_packages { fi ssh root@lrdcom-vm-1 cp -a "/www/releases.liferay.com/${LIFERAY_RELEASE_PRODUCT_NAME}/release-candidates/${_ARTIFACT_RC_VERSION}" "/www/releases.liferay.com/${LIFERAY_RELEASE_PRODUCT_NAME}/${_PRODUCT_VERSION}" + + if (gsutil ls "gs://liferay-releases/${LIFERAY_RELEASE_PRODUCT_NAME}" | grep "${_PRODUCT_VERSION}") + then + lc_log ERROR "Skipping the upload of ${_PRODUCT_VERSION} to GCP because it already exists." + + return "${LIFERAY_COMMON_EXIT_CODE_SKIPPED}" + fi + + gsutil cp -r "/www/releases.liferay.com/${LIFERAY_RELEASE_PRODUCT_NAME}/release-candidates/${_ARTIFACT_RC_VERSION}" "gs://liferay-releases/${LIFERAY_RELEASE_PRODUCT_NAME}/${_PRODUCT_VERSION}" } function tag_release { From a9bafa4456494c2b1fee58adbdb839d1dc1f3937 Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Fri, 30 Aug 2024 15:46:28 -0300 Subject: [PATCH 130/140] LPD-34563 More an info --- release/release_gold.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release/release_gold.sh b/release/release_gold.sh index 91bbd1525..ac164851d 100755 --- a/release/release_gold.sh +++ b/release/release_gold.sh @@ -176,7 +176,7 @@ function promote_boms { function promote_packages { if (ssh root@lrdcom-vm-1 ls -d "/www/releases.liferay.com/${LIFERAY_RELEASE_PRODUCT_NAME}/${_PRODUCT_VERSION}" | grep -q "${_PRODUCT_VERSION}" &>/dev/null) then - lc_log ERROR "Release was already published." + lc_log INFO "Release was already published." return "${LIFERAY_COMMON_EXIT_CODE_SKIPPED}" fi @@ -185,7 +185,7 @@ function promote_packages { if (gsutil ls "gs://liferay-releases/${LIFERAY_RELEASE_PRODUCT_NAME}" | grep "${_PRODUCT_VERSION}") then - lc_log ERROR "Skipping the upload of ${_PRODUCT_VERSION} to GCP because it already exists." + lc_log INFO "Skipping the upload of ${_PRODUCT_VERSION} to GCP because it already exists." return "${LIFERAY_COMMON_EXIT_CODE_SKIPPED}" fi From 875c79db51710c8ae488f266587662c4bac52004 Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Fri, 30 Aug 2024 15:49:42 -0300 Subject: [PATCH 131/140] Bump nightlies to 4 hours for now --- build_nightly.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_nightly.sh b/build_nightly.sh index 6e1964e15..e516bfb58 100755 --- a/build_nightly.sh +++ b/build_nightly.sh @@ -19,5 +19,5 @@ do echo `date` echo "" - sleep 1d + sleep 4h done \ No newline at end of file From ddced01986e324a4fb98686ecb3ad675d62973df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20D=C3=ADaz?= Date: Fri, 23 Aug 2024 10:15:50 +0200 Subject: [PATCH 132/140] SRE-6161 The 10_after_import.sql script should also delete the Analytics Cloud configuration --- spinner/build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/spinner/build.sh b/spinner/build.sh index bdc85f542..9c2faf0c4 100755 --- a/spinner/build.sh +++ b/spinner/build.sh @@ -490,6 +490,7 @@ function prepare_database_import { ( echo "USE lportal;" echo "" + echo "DELETE FROM Configuration_ WHERE configurationId LIKE 'com.liferay.analytics.settings.configuration.AnalyticsConfiguration%';" echo "DELETE FROM Configuration_ WHERE configurationId LIKE 'com.liferay.portal.security.ldap.%';" echo "DELETE FROM Configuration_ WHERE configurationId LIKE 'com.liferay.portal.security.sso.openid.%';" echo "DELETE FROM Configuration_ WHERE configurationId LIKE 'com.liferay.saml.%';" From 1ad02dbb42c3f92f70fd7a1c53d27d07b799e108 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20D=C3=ADaz?= Date: Fri, 23 Aug 2024 12:09:56 +0200 Subject: [PATCH 133/140] SRE-6161 Delete the MFA settings in the same way it is done in the MODL script https://github.com/liferay/liferay-lxc/blob/8272ce1583802703248359a2018b87c8d149386e/liferay/configs/common/scripts/05-modl-sql-scripts.sh#L75 --- spinner/build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/spinner/build.sh b/spinner/build.sh index 9c2faf0c4..58aa16d8a 100755 --- a/spinner/build.sh +++ b/spinner/build.sh @@ -494,6 +494,7 @@ function prepare_database_import { echo "DELETE FROM Configuration_ WHERE configurationId LIKE 'com.liferay.portal.security.ldap.%';" echo "DELETE FROM Configuration_ WHERE configurationId LIKE 'com.liferay.portal.security.sso.openid.%';" echo "DELETE FROM Configuration_ WHERE configurationId LIKE 'com.liferay.saml.%';" + echo "DELETE FROM Configuration_ WHERE configurationId LIKE '%com.liferay.multi.factor.authentication%';" echo "" echo "UPDATE VirtualHost SET hostname=concat(hostname, \".local\");" From 76762eca9ae1e83ed7e95aab5238b6c386def4f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20D=C3=ADaz?= Date: Fri, 23 Aug 2024 14:54:12 +0200 Subject: [PATCH 134/140] SRE-6161 As of 2024.Q2, 'Configuration_' is no longer a control table, so 10_after_import.sql must delete data from all DB partitions --- spinner/build.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spinner/build.sh b/spinner/build.sh index 58aa16d8a..874ccd0b2 100755 --- a/spinner/build.sh +++ b/spinner/build.sh @@ -502,6 +502,12 @@ function prepare_database_import { do echo "USE ${schema};" echo "" + echo "DELETE FROM Configuration_ WHERE configurationId LIKE 'com.liferay.analytics.settings.configuration.AnalyticsConfiguration%';" + echo "DELETE FROM Configuration_ WHERE configurationId LIKE 'com.liferay.portal.security.ldap.%';" + echo "DELETE FROM Configuration_ WHERE configurationId LIKE 'com.liferay.portal.security.sso.openid.%';" + echo "DELETE FROM Configuration_ WHERE configurationId LIKE 'com.liferay.saml.%';" + echo "DELETE FROM Configuration_ WHERE configurationId LIKE '%com.liferay.multi.factor.authentication%';" + echo "" echo "TRUNCATE TABLE OpenIdConnectSession;" echo "TRUNCATE TABLE SamlIdpSpConnection;" echo "TRUNCATE TABLE SamlIdpSpSession;" From a1c936ea60b6dcf9888dc7005b4bf642333b447a Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Wed, 4 Sep 2024 13:51:53 -0300 Subject: [PATCH 135/140] SRE-6161 Sort --- spinner/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spinner/build.sh b/spinner/build.sh index 874ccd0b2..8e1fffb3b 100755 --- a/spinner/build.sh +++ b/spinner/build.sh @@ -490,11 +490,11 @@ function prepare_database_import { ( echo "USE lportal;" echo "" + echo "DELETE FROM Configuration_ WHERE configurationId LIKE '%com.liferay.multi.factor.authentication%';" echo "DELETE FROM Configuration_ WHERE configurationId LIKE 'com.liferay.analytics.settings.configuration.AnalyticsConfiguration%';" echo "DELETE FROM Configuration_ WHERE configurationId LIKE 'com.liferay.portal.security.ldap.%';" echo "DELETE FROM Configuration_ WHERE configurationId LIKE 'com.liferay.portal.security.sso.openid.%';" echo "DELETE FROM Configuration_ WHERE configurationId LIKE 'com.liferay.saml.%';" - echo "DELETE FROM Configuration_ WHERE configurationId LIKE '%com.liferay.multi.factor.authentication%';" echo "" echo "UPDATE VirtualHost SET hostname=concat(hostname, \".local\");" @@ -502,11 +502,11 @@ function prepare_database_import { do echo "USE ${schema};" echo "" + echo "DELETE FROM Configuration_ WHERE configurationId LIKE '%com.liferay.multi.factor.authentication%';" echo "DELETE FROM Configuration_ WHERE configurationId LIKE 'com.liferay.analytics.settings.configuration.AnalyticsConfiguration%';" echo "DELETE FROM Configuration_ WHERE configurationId LIKE 'com.liferay.portal.security.ldap.%';" echo "DELETE FROM Configuration_ WHERE configurationId LIKE 'com.liferay.portal.security.sso.openid.%';" echo "DELETE FROM Configuration_ WHERE configurationId LIKE 'com.liferay.saml.%';" - echo "DELETE FROM Configuration_ WHERE configurationId LIKE '%com.liferay.multi.factor.authentication%';" echo "" echo "TRUNCATE TABLE OpenIdConnectSession;" echo "TRUNCATE TABLE SamlIdpSpConnection;" From 0f115f7cf1bac61352cd47471f1094db7e75996b Mon Sep 17 00:00:00 2001 From: Renato Rego Date: Thu, 5 Sep 2024 11:23:56 -0300 Subject: [PATCH 136/140] 2024.q2.12 --- bundles.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/bundles.yml b/bundles.yml index d4bfecd6b..1c4c81da6 100644 --- a/bundles.yml +++ b/bundles.yml @@ -736,6 +736,7 @@ quarterly: 2024.q2.9: 2024.q2.10: 2024.q2.11: + 2024.q2.12: latest: true snapshot: snapshot-master: From 0e379910a5a8808d27ebb08e988eb63bab3a21cf Mon Sep 17 00:00:00 2001 From: Pedro Malta Date: Wed, 4 Sep 2024 16:11:02 -0300 Subject: [PATCH 137/140] LRP-4868 Making the curls errors more meaningful --- release/_publishing.sh | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/release/_publishing.sh b/release/_publishing.sh index 81bfb75da..a8a6f163e 100644 --- a/release/_publishing.sh +++ b/release/_publishing.sh @@ -27,19 +27,20 @@ function add_fixed_issues_to_patcher_project_version { IFS=',' fixed_issues="${fixed_issues_array[*]:start_index:fixed_issues_array_part_length}" - if (curl \ + local update_fixed_issues_response=$(curl \ "https://patcher.liferay.com/api/jsonws/osb-patcher-portlet.project_versions/updateFixedIssues" \ --data-raw "fixedIssues=${fixed_issues}&patcherProjectVersionId=${1}" \ - --fail \ --max-time 10 \ - --output /dev/null \ --retry 3 \ - --silent \ --user "${LIFERAY_RELEASE_PATCHER_PORTAL_EMAIL_ADDRESS}:${LIFERAY_RELEASE_PATCHER_PORTAL_PASSWORD}") + + if [ $(echo "${update_fixed_issues_response}" | jq -r '.status') -eq 200 ] then lc_log INFO "Adding fixed issues to Liferay Patcher project version ${2}." else - lc_log ERROR "Unable to add fixed issues to Liferay Patcher project ${2}." + lc_log ERROR "Unable to add fixed issues to Liferay Patcher project ${2}:" + + lc_log ERROR "${update_fixed_issues_response}" rm -f release-notes.txt @@ -79,10 +80,8 @@ function add_patcher_project_version { curl \ "https://patcher.liferay.com/api/jsonws/osb-patcher-portlet.project_versions/addByName" \ --data-raw "combinedBranch=true&committish=${patcher_project_version}&fixedIssues=&name=${patcher_project_version}&productVersionLabel=${patcher_product_version_label}&repositoryName=liferay-portal-ee&rootPatcherProjectVersionName=${root_patcher_project_version_name}" \ - --fail \ --max-time 10 \ --retry 3 \ - --silent \ --user "${LIFERAY_RELEASE_PATCHER_PORTAL_EMAIL_ADDRESS}:${LIFERAY_RELEASE_PATCHER_PORTAL_PASSWORD}") if [ $(echo "${add_by_name_response}" | jq -r '.status') -eq 200 ] @@ -91,7 +90,9 @@ function add_patcher_project_version { add_fixed_issues_to_patcher_project_version $(echo "${add_by_name_response}" | jq -r '.data.patcherProjectVersionId') "${patcher_project_version}" else - lc_log ERROR "Unable to add Liferay Patcher project ${patcher_project_version}." + lc_log ERROR "Unable to add Liferay Patcher project ${patcher_project_version}:" + + lc_log ERROR "${add_by_name_response}" return "${LIFERAY_COMMON_EXIT_CODE_BAD}" fi @@ -102,13 +103,10 @@ function check_url { if (curl \ "${file_url}" \ - --fail \ --head \ --max-time 300 \ - --output /dev/null \ --retry 3 \ --retry-delay 10 \ - --silent \ --user "${LIFERAY_RELEASE_NEXUS_REPOSITORY_USER}:${LIFERAY_RELEASE_NEXUS_REPOSITORY_PASSWORD}") then lc_log DEBUG "File is available at ${file_url}." From 9d5adcc5ae96a87abacdd00af5bca5184fa850f3 Mon Sep 17 00:00:00 2001 From: Pedro Malta Date: Fri, 6 Sep 2024 09:32:13 -0300 Subject: [PATCH 138/140] LRP-4868 Changing the execution order of the release_gold --- release/release_gold.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release/release_gold.sh b/release/release_gold.sh index ac164851d..da9427f47 100755 --- a/release/release_gold.sh +++ b/release/release_gold.sh @@ -75,13 +75,13 @@ function main { lc_time_run upload_releases_json - lc_time_run add_patcher_project_version - lc_time_run test_boms lc_time_run prepare_next_release_branch #lc_time_run upload_to_docker_hub + + lc_time_run add_patcher_project_version } function prepare_next_release_branch { From fc7c9d797ef6eca8304637ffc9e0891b6ae2fbf7 Mon Sep 17 00:00:00 2001 From: Brian Chan Date: Mon, 9 Sep 2024 14:24:51 -0700 Subject: [PATCH 139/140] LRP-4868 SF --- release/_publishing.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/release/_publishing.sh b/release/_publishing.sh index a8a6f163e..008a54acd 100644 --- a/release/_publishing.sh +++ b/release/_publishing.sh @@ -28,11 +28,11 @@ function add_fixed_issues_to_patcher_project_version { IFS=',' fixed_issues="${fixed_issues_array[*]:start_index:fixed_issues_array_part_length}" local update_fixed_issues_response=$(curl \ - "https://patcher.liferay.com/api/jsonws/osb-patcher-portlet.project_versions/updateFixedIssues" \ - --data-raw "fixedIssues=${fixed_issues}&patcherProjectVersionId=${1}" \ - --max-time 10 \ - --retry 3 \ - --user "${LIFERAY_RELEASE_PATCHER_PORTAL_EMAIL_ADDRESS}:${LIFERAY_RELEASE_PATCHER_PORTAL_PASSWORD}") + "https://patcher.liferay.com/api/jsonws/osb-patcher-portlet.project_versions/updateFixedIssues" \ + --data-raw "fixedIssues=${fixed_issues}&patcherProjectVersionId=${1}" \ + --max-time 10 \ + --retry 3 \ + --user "${LIFERAY_RELEASE_PATCHER_PORTAL_EMAIL_ADDRESS}:${LIFERAY_RELEASE_PATCHER_PORTAL_PASSWORD}") if [ $(echo "${update_fixed_issues_response}" | jq -r '.status') -eq 200 ] then From bf0fcdd6fe9d9dae7b43bb1a47f97f12fb887a94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Tak=C3=A1cs?= Date: Tue, 10 Sep 2024 17:27:29 +0200 Subject: [PATCH 140/140] SRE-6187 Migrate Spinner to liferay-lxc repository --- spinner/.gitignore | 5 - spinner/README.md | 4 +- spinner/build.sh | 575 ---------------------------- spinner/clean.sh | 31 -- spinner/dxp-activation-key/.gitkeep | 0 spinner/test.sh | 53 --- 6 files changed, 1 insertion(+), 667 deletions(-) delete mode 100644 spinner/.gitignore delete mode 100755 spinner/build.sh delete mode 100755 spinner/clean.sh delete mode 100644 spinner/dxp-activation-key/.gitkeep delete mode 100755 spinner/test.sh diff --git a/spinner/.gitignore b/spinner/.gitignore deleted file mode 100644 index b31a40b5e..000000000 --- a/spinner/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -dxp-activation-key/* - -!dxp-activation-key/.gitkeep -env-* -test_log \ No newline at end of file diff --git a/spinner/README.md b/spinner/README.md index 5421fc7a3..6e0b1b76c 100644 --- a/spinner/README.md +++ b/spinner/README.md @@ -1,5 +1,3 @@ # Spinner -Run ```build.sh -h``` for help on how to spin up an LXC environment as a local stack. - -Run ```clean.sh``` to delete local stacks. \ No newline at end of file +**Migrated over to [liferay-lxc](https://github.com/liferay/liferay-lxc/tree/master/spinner) repository.** \ No newline at end of file diff --git a/spinner/build.sh b/spinner/build.sh deleted file mode 100755 index 8e1fffb3b..000000000 --- a/spinner/build.sh +++ /dev/null @@ -1,575 +0,0 @@ -#!/bin/bash - -source ../_liferay_common.sh - -function build_service_antivirus { - write " antivirus:" - - write_deploy_section 4G - - local antivirus_image=$(grep "\"image\": " "${SPINNER_LIFERAY_LXC_REPOSITORY_DIR}"/antivirus/LCP.json | sed -e "s/.*image\": \""// | sed -e "s/\",$//") - - write " image: ${antivirus_image}" - - write " ports:" - write " - \"${ANTIVIRUS_PORT}:3310\"" -} - -function build_service_database { - write " database:" - write " command: mysqld --character-set-filesystem=utf8mb4 --character-set-server=utf8mb4 --collation-server=utf8mb4_general_ci --default-authentication-plugin=mysql_native_password --max_allowed_packet=256M --tls-version=''" - - write_deploy_section 1G - - write " environment:" - write " - MYSQL_DATABASE=lportal" - write " - MYSQL_PASSWORD=password" - write " - MYSQL_ROOT_HOST=%" - write " - MYSQL_ROOT_PASSWORD=password" - write " - MYSQL_USER=dxpcloud" - write " image: mysql:8.0.32" - write " ports:" - write " - ${CONTAINER_PORT_IP}${DATABASE_PORT}:3306" - write " volumes:" - write " - ./database_import:/docker-entrypoint-initdb.d" - write " - mysql-db:/var/lib/mysql" -} - -function build_service_liferay { - mkdir -p build/liferay/resources/opt/liferay - - cp ../../orca/templates/liferay/resources/opt/liferay/cluster-link-tcp.xml build/liferay/resources/opt/liferay - - mkdir -p build/liferay/resources/usr/local/bin - - cp ../../orca/templates/liferay/resources/usr/local/bin/remove_lock_on_startup.sh build/liferay/resources/usr/local/bin - - mkdir -p build/liferay/resources/usr/local/liferay/scripts/pre-startup - - cp ../../orca/templates/liferay/resources/usr/local/liferay/scripts/pre-startup/10_wait_for_dependencies.sh build/liferay/resources/usr/local/liferay/scripts/pre-startup - - if [ -n "${ENVIRONMENT_DESCRIPTOR}" ] - then - echo "FROM $(grep -e "\"liferay-image\":" "${ENVIRONMENT_DESCRIPTOR}" | cut -d '"' -f 4)" > build/liferay/Dockerfile - - local hotfix=$(grep -e "\"hotfix\":" "${ENVIRONMENT_DESCRIPTOR}" | cut -d '"' -f 4) - - if [ -n "${hotfix}" ] - then - hotfix="RUN \/opt\/liferay\/patching-tool\/patching-tool.sh install ${hotfix}" - fi - - sed -i "s/\[TO-BE-REPLACED-BY-SINGLE-CI\]/${hotfix}/g" "${SPINNER_LIFERAY_LXC_REPOSITORY_DIR}/liferay/Dockerfile.ext" - else - echo "FROM $(grep -e '^liferay.workspace.docker.image.liferay=' "${SPINNER_LIFERAY_LXC_REPOSITORY_DIR}/liferay/gradle.properties" | cut -d '=' -f 2)" > build/liferay/Dockerfile - fi - - ( - echo "COPY resources/opt/liferay /opt/liferay" - echo "COPY resources/usr/local/bin /usr/local/bin" - echo "COPY resources/usr/local/liferay/scripts /usr/local/liferay/scripts" - - cat "${SPINNER_LIFERAY_LXC_REPOSITORY_DIR}/liferay/Dockerfile.ext" - ) >> build/liferay/Dockerfile - - mkdir -p liferay_mount/files/deploy - - cp -r ../dxp-activation-key/*.xml liferay_mount/files/deploy - - cp -r "${SPINNER_LIFERAY_LXC_REPOSITORY_DIR}"/liferay/configs/common/* liferay_mount/files - cp -r "${SPINNER_LIFERAY_LXC_REPOSITORY_DIR}"/liferay/configs/"${LXC_ENVIRONMENT}"/* liferay_mount/files - - echo "Deleting the following files from the DXP configuration so it can run locally:" - echo "" - - for file in \ - osgi/configs/com.liferay.portal.k8s.agent.configuration.PortalK8sAgentConfiguration.config \ - osgi/configs/com.liferay.portal.search.elasticsearch7.configuration.ElasticsearchConfiguration.config \ - osgi/configs/com.liferay.portal.security.content.security.policy.internal.configuration.ContentSecurityPolicyConfiguration.config \ - osgi/configs/com.liferay.portal.security.sso.openid.connect.configuration.OpenIdConnectConfiguration.config \ - osgi/configs/com.liferay.portal.security.sso.openid.connect.internal.configuration.OpenIdConnectProviderConfiguration_liferayokta.config \ - tomcat/webapps/ROOT/WEB-INF/classes/META-INF/portal-log4j-ext.xml - do - rm -f "liferay_mount/files/${file}" - - echo " ${file}" - done - - echo "" - - mkdir -p liferay_mount/files/patching - mkdir -p liferay_mount/files/scripts - - mv liferay_mount/files/patching liferay_mount - mv liferay_mount/files/scripts liferay_mount - - ( - echo "active=B\"true\"" - echo "maxUsers=I\"0\"" - echo "mx=\"spinner-test.com\"" - echo "siteInitializerKey=\"\"" - echo "virtualHostname=\"spinner-test.com\"" - ) >> "liferay_mount/files/osgi/configs/com.liferay.portal.instances.internal.configuration.PortalInstancesConfiguration~spinner-test.com.config" - - for index in $(seq 1 "${NUMBER_OF_LIFERAY_NODES}") - do - local port_last_digit=$((index - 1)) - - write " liferay-${index}:" - write " build: ./build/liferay" - - write_deploy_section 6G - - write " environment:" - write " - LCP_LIFERAY_UPGRADE_ENABLED=\${LCP_LIFERAY_UPGRADE_ENABLED:-}" - write " - LCP_SECRET_DATABASE_HOST=database" - write " - LCP_SECRET_DATABASE_PASSWORD=password" - write " - LCP_SECRET_DATABASE_USER=root" - write " - LIFERAY_CLUSTER_PERIOD_LINK_PERIOD_AUTODETECT_PERIOD_ADDRESS=" - write " - LIFERAY_CLUSTER_PERIOD_LINK_PERIOD_CHANNEL_PERIOD_LOGIC_PERIOD_NAME_PERIOD_CONTROL=control-channel-liferay-${index}" - write " - LIFERAY_CLUSTER_PERIOD_LINK_PERIOD_CHANNEL_PERIOD_LOGIC_PERIOD_NAME_PERIOD_TRANSPORT_PERIOD_NUMBER0=transport-channel-logic-${index}" - write " - LIFERAY_CLUSTER_PERIOD_LINK_PERIOD_CHANNEL_PERIOD_PROPERTIES_PERIOD_CONTROL=/opt/liferay/cluster-link-tcp.xml" - write " - LIFERAY_CLUSTER_PERIOD_LINK_PERIOD_CHANNEL_PERIOD_PROPERTIES_PERIOD_TRANSPORT_PERIOD__NUMBER0_=/opt/liferay/cluster-link-tcp.xml" - write " - LIFERAY_CLUSTER_PERIOD_LINK_PERIOD_ENABLED=true" - write " - LIFERAY_CONFIGURATION_PERIOD_OVERRIDE_PERIOD_COM_PERIOD_LIFERAY_PERIOD_PORTAL_PERIOD_SEARCH_PERIOD_ELASTICSEARCH_NUMBER7__PERIOD_CONFIGURATION_PERIOD__UPPERCASEE_LASTICSEARCH_UPPERCASEC_ONFIGURATION_UNDERLINE_CLUSTER_UPPERCASEN_AME=\"liferay_cluster\"" - write " - LIFERAY_CONFIGURATION_PERIOD_OVERRIDE_PERIOD_COM_PERIOD_LIFERAY_PERIOD_PORTAL_PERIOD_SEARCH_PERIOD_ELASTICSEARCH_NUMBER7__PERIOD_CONFIGURATION_PERIOD__UPPERCASEE_LASTICSEARCH_UPPERCASEC_ONFIGURATION_UNDERLINE_NETWORK_UPPERCASEH_OST_UPPERCASEA_DDRESSES=\"search:9200\"" - write " - LIFERAY_CONFIGURATION_PERIOD_OVERRIDE_PERIOD_COM_PERIOD_LIFERAY_PERIOD_PORTAL_PERIOD_SEARCH_PERIOD_ELASTICSEARCH_NUMBER7__PERIOD_CONFIGURATION_PERIOD__UPPERCASEE_LASTICSEARCH_UPPERCASEC_ONFIGURATION_UNDERLINE_OPERATION_UPPERCASEM_ODE=\"REMOTE\"" - write " - LIFERAY_CONFIGURATION_PERIOD_OVERRIDE_PERIOD_COM_PERIOD_LIFERAY_PERIOD_PORTAL_PERIOD_SEARCH_PERIOD_ELASTICSEARCH_NUMBER7__PERIOD_CONFIGURATION_PERIOD__UPPERCASEE_LASTICSEARCH_UPPERCASEC_ONFIGURATION_UNDERLINE_PRODUCTION_UPPERCASEM_ODE_UPPERCASEE_NABLED=B\"true\"" - write " - LIFERAY_DISABLE_TRIAL_LICENSE=true" - write " - LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_DRIVER_UPPERCASEC_LASS_UPPERCASEN_AME=org.mariadb.jdbc.Driver" - write " - LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_PASSWORD=password" - write " - LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_URL=jdbc:mysql://database/lportal?characterEncoding=UTF-8&dontTrackOpenResources=true&holdResultsOpenOverStatementClose=true&passwordCharacterEncoding=UTF-8&permitMysqlScheme&serverTimezone=GMT&useFastDateParsing=false&useUnicode=true" - write " - LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_USERNAME=root" - write " - LIFERAY_JPDA_ENABLED=true" - write " - LIFERAY_UPGRADE_ENABLED=false" - write " - LIFERAY_USERS_PERIOD_REMINDER_PERIOD_QUERIES_PERIOD_ENABLED=false" - write " - LIFERAY_VIRTUAL_PERIOD_HOSTS_PERIOD_VALID_PERIOD_HOSTS=*" - write " - LIFERAY_WEB_PERIOD_SERVER_PERIOD_PROTOCOL=http" - write " - LIFERAY_WORKSPACE_ENVIRONMENT=${LXC_ENVIRONMENT}" - write " - LOCAL_STACK=true" - write " - ORCA_LIFERAY_SEARCH_ADDRESSES=search:9200" - write " extra_hosts:" - write " - host.docker.internal:host-gateway" - write " hostname: liferay-${index}" - write " ports:" - write " - ${CONTAINER_PORT_IP}1800${port_last_digit}:8000" - write " - ${CONTAINER_PORT_IP}1808${port_last_digit}:8080" - write " volumes:" - write " - liferay-document-library:/opt/liferay/data" - write " - ./liferay_mount:/mnt/liferay" - done -} - -function build_service_search { - mkdir -p build/search - - grep -v "^FROM" ../../orca/templates/search/Dockerfile | sed -e "s/#FROM/FROM/" > build/search/Dockerfile - - write " search:" - write " build: ./build/search" - - write_deploy_section 2G - - write " environment:" - write " - discovery.type=single-node" - write " - xpack.ml.enabled=false" - write " - xpack.monitoring.enabled=false" - write " - xpack.security.enabled=false" - write " - xpack.sql.enabled=false" - write " - xpack.watcher.enabled=false" -} - -function build_service_web_server { - - # - # Copy from the web server Docker image - # - - local web_server_dir="${SPINNER_LIFERAY_LXC_REPOSITORY_DIR}"/webserver - - local web_server_image=$(head -n 1 "${web_server_dir}"/Dockerfile) - - web_server_image=${web_server_image##* } - - docker pull --quiet "${web_server_image}" >/dev/null - - local web_server_container=$(docker create "${web_server_image}") - - mkdir -p build/web-server/resources/usr/local/etc/haproxy - - docker cp "${web_server_container}":/usr/local/etc/haproxy/haproxy.cfg build/web-server/resources/usr/local/etc/haproxy/haproxy.cfg - - sed -i build/web-server/resources/usr/local/etc/haproxy/haproxy.cfg -e "s/server-template.*/balance roundrobin\n\toption httpchk\n\tserver s1 liferay-1:8080 check/" - - docker rm "${web_server_container}" >/dev/null - - # - # Copy from the OWASP Docker image - # - - if [ -n "${MOD_SECURITY_ENABLED}" ] - then - docker pull --quiet owasp/modsecurity-crs:nginx >/dev/null - - local owasp_container=$(docker create owasp/modsecurity-crs:nginx) - - mkdir -p build/web-server/resources/etc/nginx/modsec - - docker cp "${owasp_container}":/etc/modsecurity.d/owasp-crs/crs-setup.conf build/web-server/resources/etc/nginx/modsec - docker cp "${owasp_container}":/etc/modsecurity.d/owasp-crs/rules build/web-server/resources/etc/nginx/modsec - - docker rm "${owasp_container}" >/dev/null - - echo "Include /etc/nginx/modsec/rules/*.conf" > build/web-server/resources/etc/nginx/modsec/owasp-crs-rules.conf - fi - - # - # Copy from liferay-lxc - # - - mkdir -p web-server_mount/configs - - cp -a "${web_server_dir}"/configs/* web-server_mount/configs - - sed -i web-server_mount/configs/common/nginx.conf -e "s/access_log.*/access_log off;/" - - echo "Deleting the following files from the web server configuration so it can run locally:" - echo "" - - for file in \ - blocks.d/oauth2_proxy_pass.conf \ - blocks.d/oauth2_proxy_protection.conf \ - http.conf.d/admin.conf \ - scripts/01-whitelist_github_ips.sh - do - rm -f "web-server_mount/configs/common/${file}" - - echo " ${file}" - done - - echo "" - - ( - head -n 1 "${web_server_dir}"/Dockerfile - - echo "" - echo "COPY resources/usr/local /usr/local" - echo "" - echo "ENV ERROR_LOG_LEVEL=warn" - echo "ENV LCP_PROJECT_ENVIRONMENT=local" - echo "ENV LCP_WEBSERVER_GLOBAL_TIMEOUT=1h" - echo "ENV LCP_WEBSERVER_PROXY_MAX_TEMP_FILE_SIZE=0" - - if [ -n "${MOD_SECURITY_ENABLED}" ] - then - echo "ENV LCP_WEBSERVER_MODSECURITY=On" - echo "ENV NGINX_MODSECURITY_MODE=on" - else - echo "ENV NGINX_MODSECURITY_MODE=off" - fi - - echo "ENV PROXY_ADDRESS=127.0.0.1:81" - - ) > build/web-server/Dockerfile - - write " web-server:" - write " build: ./build/web-server" - - write_deploy_section 1G - - write " ports:" - write " - ${CONTAINER_PORT_IP}${WEB_SERVER_PORT}:80" - write " volumes:" - write " - ./web-server_mount:/lcp-container" -} - -function build_services { - lc_cd "${STACK_DIR}" - - write "services:" - - build_service_antivirus - build_service_database - build_service_liferay - build_service_search - build_service_web_server - - write "volumes:" - write " liferay-document-library:" - write " mysql-db:" -} - -function check_usage { - lc_check_utils docker - - ANTIVIRUS_PORT=3310 - CONTAINER_PORT_IP=127.0.0.1: - DATABASE_IMPORT= - DATABASE_PORT=13306 - LXC_ENVIRONMENT= - NUMBER_OF_LIFERAY_NODES=2 - WEB_SERVER_PORT=80 - - while [ "${1}" != "" ] - do - case ${1} in - -d) - shift - - DATABASE_IMPORT=$(realpath "${1}") - - ;; - -h) - print_help - - ;; - -l) - CONTAINER_PORT_IP="" - - ;; - -m) - MOD_SECURITY_ENABLED=true - - ;; - -n) - shift - - NUMBER_OF_LIFERAY_NODES=${1} - - ;; - -o) - shift - - STACK_NAME=env-${1} - - ;; - -r) - ANTIVIRUS_PORT=$((RANDOM % 100 + 3300)) - DATABASE_PORT=$((RANDOM % 100 + 13300)) - WEB_SERVER_PORT=$((RANDOM % 100 + 80)) - - echo "Antivirus port: ${ANTIVIRUS_PORT}" - echo "Database port: ${DATABASE_PORT}" - echo "Web server port: ${WEB_SERVER_PORT}" - - ;; - -s) - shift - - DATABASE_SKIP_TABLE=${1} - - ;; - *) - LXC_ENVIRONMENT=${1} - - ;; - esac - - shift - done - - if [ ! -n "${LXC_ENVIRONMENT}" ] - then - LXC_ENVIRONMENT=x1e4prd - - echo "Using LXC environment \"x1e4prd\" because the LXC environment was not set." - echo "" - fi - - lc_cd "$(dirname "$0")" - - if [ ! -n "${SPINNER_LIFERAY_LXC_REPOSITORY_DIR}" ] - then - SPINNER_LIFERAY_LXC_REPOSITORY_DIR=$(pwd)"/../../liferay-lxc" - fi - - if [ ! -e "${SPINNER_LIFERAY_LXC_REPOSITORY_DIR}" ] - then - echo "The ${SPINNER_LIFERAY_LXC_REPOSITORY_DIR} directory does not exist. Clone the liferay-lxc repository to this directory or set the environment variable \"SPINNER_LIFERAY_LXC_REPOSITORY_DIR\" to point to an existing clone." - - exit "${LIFERAY_COMMON_EXIT_CODE_BAD}" - fi - - if [ ! -e "${SPINNER_LIFERAY_LXC_REPOSITORY_DIR}/liferay/configs/${LXC_ENVIRONMENT}" ] - then - echo "The ${SPINNER_LIFERAY_LXC_REPOSITORY_DIR}/liferay/configs/${LXC_ENVIRONMENT} directory does not exist." - - exit "${LIFERAY_COMMON_EXIT_CODE_BAD}" - fi - - if [ "$(git --git-dir "${SPINNER_LIFERAY_LXC_REPOSITORY_DIR}/.git" rev-parse --abbrev-ref HEAD)" == "master" ] - then - ENVIRONMENT_DESCRIPTOR="${SPINNER_LIFERAY_LXC_REPOSITORY_DIR}/automation/environment-descriptors/${LXC_ENVIRONMENT}.json" - - if [ ! -e "${ENVIRONMENT_DESCRIPTOR}" ] - then - echo "The ${ENVIRONMENT_DESCRIPTOR} file does not exist." - - exit "${LIFERAY_COMMON_EXIT_CODE_BAD}" - fi - fi - - if [[ $(find dxp-activation-key -name "*.xml" | wc -l ) -eq 0 ]] - then - echo "" - echo "Copy a valid DXP license to the dxp-activation-key directory before running this script." - - exit "${LIFERAY_COMMON_EXIT_CODE_BAD}" - fi - - if [ ! -n "${STACK_NAME}" ] - then - STACK_NAME="env-${LXC_ENVIRONMENT}-"$(date +%s) - fi - - STACK_DIR=$(pwd)/${STACK_NAME} - - if [ -e "${STACK_DIR}" ] - then - echo "" - echo "The directory ${STACK_DIR} already exists." - - exit "${LIFERAY_COMMON_EXIT_CODE_BAD}" - fi - - mkdir -p "${STACK_DIR}" -} - -function main { - check_usage "${@}" - - ( - build_services - - prepare_database_import - - print_docker_compose_usage - ) | tee -a "${STACK_DIR}/README.txt" -} - -function prepare_database_import { - mkdir -p database_import - - if [ ! -n "${DATABASE_IMPORT}" ] - then - return - fi - - echo "" - echo "Preparing to import ${DATABASE_IMPORT}." - - lc_cd "${STACK_DIR}"/database_import - - cp "${DATABASE_IMPORT}" . - - if [ $(find . -type f -name "*.gz" | wc -l) -gt 0 ] - then - echo "" - echo "Extracting the database import file." - - gzip -d $(find . -type f -name "*.gz") - fi - - mv $(find . -type f) 01_database.sql - - if [ -n "${DATABASE_SKIP_TABLE}" ] - then - echo "" - echo "Removing ${DATABASE_SKIP_TABLE} from the database import." - - grep -v "^INSERT INTO .${DATABASE_SKIP_TABLE}. VALUES (" < 01_database.sql > 01_database_removed.sql - - rm 01_database.sql - - mv 01_database_removed.sql 01_database.sql - fi - - echo "" - echo "Adding 10_after_import.sql to make changes to the database. Review them before starting the container." - - ( - echo "USE lportal;" - echo "" - echo "DELETE FROM Configuration_ WHERE configurationId LIKE '%com.liferay.multi.factor.authentication%';" - echo "DELETE FROM Configuration_ WHERE configurationId LIKE 'com.liferay.analytics.settings.configuration.AnalyticsConfiguration%';" - echo "DELETE FROM Configuration_ WHERE configurationId LIKE 'com.liferay.portal.security.ldap.%';" - echo "DELETE FROM Configuration_ WHERE configurationId LIKE 'com.liferay.portal.security.sso.openid.%';" - echo "DELETE FROM Configuration_ WHERE configurationId LIKE 'com.liferay.saml.%';" - echo "" - echo "UPDATE VirtualHost SET hostname=concat(hostname, \".local\");" - - grep "^CREATE DATABASE" 01_database.sql | sed -e 's/.*`\(.*\)`.*/\1/' | while IFS= read -r schema - do - echo "USE ${schema};" - echo "" - echo "DELETE FROM Configuration_ WHERE configurationId LIKE '%com.liferay.multi.factor.authentication%';" - echo "DELETE FROM Configuration_ WHERE configurationId LIKE 'com.liferay.analytics.settings.configuration.AnalyticsConfiguration%';" - echo "DELETE FROM Configuration_ WHERE configurationId LIKE 'com.liferay.portal.security.ldap.%';" - echo "DELETE FROM Configuration_ WHERE configurationId LIKE 'com.liferay.portal.security.sso.openid.%';" - echo "DELETE FROM Configuration_ WHERE configurationId LIKE 'com.liferay.saml.%';" - echo "" - echo "TRUNCATE TABLE OpenIdConnectSession;" - echo "TRUNCATE TABLE SamlIdpSpConnection;" - echo "TRUNCATE TABLE SamlIdpSpSession;" - echo "TRUNCATE TABLE SamlIdpSsoSession;" - echo "TRUNCATE TABLE SamlPeerBinding;" - echo "TRUNCATE TABLE SamlSpAuthRequest;" - echo "TRUNCATE TABLE SamlSpIdpConnection;" - echo "TRUNCATE TABLE SamlSpMessage;" - echo "TRUNCATE TABLE SamlSpSession;" - echo "" - echo "UPDATE User_ set password_ ='liferaydevsecops', passwordEncrypted=0;" - done - ) > 10_after_import.sql -} - -function print_docker_compose_usage { - echo "The stack configuration is ready to use. It is available in the ${STACK_NAME} directory. Use the following commands to start all services:" - echo "" - echo " cd ${STACK_NAME}" - echo "" - echo " $(lc_docker_compose) up -d antivirus database search web-server" - echo "" - echo " $(lc_docker_compose) up liferay-1" - echo "" - echo "Use the following command to start the second Liferay node to test clustering:" - echo "" - echo " $(lc_docker_compose) up liferay-2" - echo "" - echo "See https://liferay.atlassian.net/l/cp/SD571mFA for more information on how to debug." -} - -function print_help { - echo "Usage: ${0} -d " - echo "" - echo "The script can be configured with the following arguments:" - echo "" - echo " -d (optional): Set the database import file (raw or with a .gz suffix). Virtual hosts will be suffixed with .local (e.g. abc.liferay.com becomes abc.liferay.com.local)." - echo " -l (optional): Exported ports listen on all network interfaces" - echo " -m (optional): Enable mod_security on the web server with the rules from OWASP Top 10" - echo " -n (optional): Number of Liferay nodes" - echo " -o (optional): Set directory name where the stack configuration will be created. It will be prefixed with \"env-\"." - echo " -r (optional): Randomize the antivirus, MySQL, and web server ports opened on localhost to enable multiple servers at the same time" - echo " -s (optional): Skip the specified table name in the database import" - echo "" - echo "The default LXC environment is \"x1e4prd\"." - echo "" - echo "Example: ${0} x1e4prd -d sql.gz -o test" - - exit "${LIFERAY_COMMON_EXIT_CODE_HELP}" -} - -function write { - echo "${1}" >> docker-compose.yml -} - -function write_deploy_section { - write " deploy:" - write " resources:" - write " limits:" - write " memory: ${1}" - write " reservations:" - write " memory: ${1}" -} - -main "${@}" \ No newline at end of file diff --git a/spinner/clean.sh b/spinner/clean.sh deleted file mode 100755 index 19cde1a77..000000000 --- a/spinner/clean.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -source ../_liferay_common.sh - -function clean_up { - echo "Cleaning up ${1}." - - lc_cd "${1}" - - $(lc_docker_compose) down --rmi local --volumes - - rm -fr "${1}" -} - -function main { - if [[ $(find . -name "env-*" -type d | wc -l) -eq 0 ]] - then - echo "There are no stack directories to clean." - - exit "${LIFERAY_COMMON_EXIT_CODE_BAD}" - fi - - LIFERAY_COMMON_LOG_DIR="/tmp/spinner-clean.${$}" - - for stack_dir in "$(pwd)"/env-* - do - lc_time_run clean_up "${stack_dir}" - done -} - -main \ No newline at end of file diff --git a/spinner/dxp-activation-key/.gitkeep b/spinner/dxp-activation-key/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/spinner/test.sh b/spinner/test.sh deleted file mode 100755 index 0dd09aa79..000000000 --- a/spinner/test.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash - -source ../_liferay_common.sh - -set -o pipefail - -function build { - ./build.sh -} - -function clean { - ./clean.sh - - rm -fr "${LIFERAY_COMMON_LOG_DIR}" -} - -function main { - LIFERAY_COMMON_LOG_DIR=test_log - - lc_time_run clean - - lc_time_run build - - lc_cd env-* - - lc_time_run up - - lc_time_run wait_for_startup - - lc_cd .. - - lc_time_run clean -} - -function up { - $(lc_docker_compose) up -d antivirus database liferay-1 search web-server -} - -function wait_for_startup { - for count in {1..1000} - do - if (curl --fail --max-time 3 http://localhost | grep -q "Liferay Digital Experience Platform") - then - return 0 - fi - - sleep 1 - done - - return 1 -} - -main "${@}" \ No newline at end of file