Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

DOCKER-35 #55

Closed
wants to merge 50 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
ab5242d
DOCKER-20 Updating Patching Tool to 3.0.24
zsoltbalogh Jun 7, 2021
fe3c5bf
1.6.1 change log
brianchandotcom Jun 7, 2021
c535ce9
SRE-159 Add 7.1.10-dxp-24
balcsida Jun 10, 2021
7bd123c
7.4 GA2
brianchandotcom Jun 14, 2021
f90e352
Update 7.4 version numbers
brianchandotcom Jun 14, 2021
ea0ef67
DOCKER-22 Update JDK11 to support TLS1.3
zsoltbalogh Jun 17, 2021
7ff3825
1.6.2 change log
brianchandotcom Jun 17, 2021
f11f5fe
7.3.7-ga8
brianchandotcom Jun 22, 2021
bfa9b6a
SRE-172 Add 7.3.10-dxp-2
balcsida Jun 25, 2021
cac0bb9
SRE-225 Add 7.0.10-de-101
balcsida Jul 21, 2021
4771198
SRE-236 Add 7.2.10-dxp-14,7.2.10-sp5
balcsida Jul 28, 2021
589eaf3
DOCKER-3 If the patching-tool info command fails the script defaults …
Akos-Kreutz Jul 27, 2021
2f491fb
DOCKER-3 SF: use -n instead of -z as it's the pattern we already follow
zsoltbalogh Jul 28, 2021
227e758
1.6.3 change log
brianchandotcom Jul 28, 2021
bb3563a
DOCKER-15 Added tomcat version label to the bundle image.
Akos-Kreutz Jul 15, 2021
a1fd6e4
DOCKER-15 Add .idea to gitignore
ZoltanTakacs Jul 16, 2021
8bbc45a
DOCKER-15 SF
ZoltanTakacs Jul 16, 2021
e961db0
DOCKER-15 Inline the var as it is only used once
ZoltanTakacs Jul 16, 2021
f62e766
DOCKER-24 patching-tool 1.0 compatibility and return code check.
Akos-Kreutz Jul 30, 2021
34d7885
DOCKER-24 SF & a little bit more helpful error message.
zsoltbalogh Aug 2, 2021
d7559aa
DOCKER-24 This file was added by mistake
zsoltbalogh Aug 2, 2021
6c3fd44
DOCKER-24 time was added by mistake
zsoltbalogh Aug 2, 2021
9be1bdc
DOCKER-24 fix weird code
brianchandotcom Aug 2, 2021
815a100
DOCKER-24 Like this
brianchandotcom Aug 2, 2021
c5b14e5
DOCKER-8 The liferay user UID is hardcoded with value 1000
Akos-Kreutz Jul 28, 2021
1d0922d
7.4 GA3
brianchandotcom Aug 2, 2021
a9f31ad
1.6.4 change log
brianchandotcom Aug 2, 2021
5f1d972
DOCKER-24 local needs to be separated in order to get proper exit code
zsoltbalogh Aug 3, 2021
f65b1ac
DOCKER-24 Document it
brianchandotcom Aug 3, 2021
dbd4fd2
DOCKER-23 Webcheck with thread dump.
Akos-Kreutz Jul 14, 2021
5873e92
DOCKER-23 SF - there's no organic ordering method between the optiona…
zsoltbalogh Jul 30, 2021
c0760a5
DOCKER-23 Let's keep the old check for now, it will require less chan…
zsoltbalogh Jul 30, 2021
957bf7e
DOCKER-23 chmod
brianchandotcom Aug 4, 2021
5d54c0a
DOCKER-23 SF
brianchandotcom Aug 4, 2021
8f0bf37
DOCKER-23 Rename
brianchandotcom Aug 4, 2021
1013efd
1.6.5 change log
brianchandotcom Aug 23, 2021
2848148
DOCKER-5 Changed the build_base_image success check in the build_all_…
Akos-Kreutz Aug 2, 2021
6dc21be
DOCKER-5 SF
brianchandotcom Aug 27, 2021
91a0b4f
1.6.6 change log
brianchandotcom Aug 27, 2021
d7bffb7
DOCKER-27 Updated 3.0 Patching Tool to 3.0.25
Akos-Kreutz Sep 1, 2021
faad305
1.6.7 change log
brianchandotcom Sep 2, 2021
9f88269
Standardize with AC's date function
brianchandotcom Sep 4, 2021
9122bf8
DOCKER-26 Change the code to be compatible with beautysh and
Akos-Kreutz Sep 3, 2021
deb56e6
DOCKER-26 SF
zsoltbalogh Sep 10, 2021
0f2148f
DOCKER-26 Validation will run differently
zsoltbalogh Sep 10, 2021
8f716c9
DOCKER-26 changing back the padding on the help message
zsoltbalogh Sep 10, 2021
11bfab7
DOCKER-26 formatting condition to multiple lines
zsoltbalogh Sep 10, 2021
71adac4
DOCKER-26 Let's fix the code so we can still apply the check. It's ve…
brianchandotcom Sep 10, 2021
beb3cf2
DOCKER-26 SF
brianchandotcom Sep 10, 2021
ef5f3ef
DOCKER-35 Ubuntu based image #majorchange
Akos-Kreutz Jul 28, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea
downloads
logs-*
temp-*
49 changes: 49 additions & 0 deletions .releng/docker-image.changelog
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,52 @@ docker.image.git.id-1.5.9=80b50a4a080850c3e4226567586af820cbf2d447

docker.image.change.log-1.6.0=DOCKER-19
docker.image.git.id-1.6.0=297f8a5dba6721305f8fa650d1ebe39ec31463fa

#
# Liferay Docker Image Version 1.6.1
#

docker.image.change.log-1.6.1=DOCKER-20
docker.image.git.id-1.6.1=ab5242dd32e07084d6e4e31b7712e704651d94f7

#
# Liferay Docker Image Version 1.6.2
#

docker.image.change.log-1.6.2=DOCKER-22
docker.image.git.id-1.6.2=ea0ef673c7dc7a71fe07c44cce8740d57dac650d

#
# Liferay Docker Image Version 1.6.3
#

docker.image.change.log-1.6.3=DOCKER-3
docker.image.git.id-1.6.3=2f491fb8cbbbd2e3e728cd0bedc878acae3f959a

#
# Liferay Docker Image Version 1.6.4
#

docker.image.change.log-1.6.4=DOCKER-8 DOCKER-24 DOCKER-15
docker.image.git.id-1.6.4=1d0922dc5200859dc1f46964cb38ce3f0dce7e23

#
# Liferay Docker Image Version 1.6.5
#

docker.image.change.log-1.6.5=DOCKER-23 DOCKER-24
docker.image.git.id-1.6.5=8f0bf37ec5507f41f02161402661d528b1c8ecab

#
# Liferay Docker Image Version 1.6.6
#

docker.image.change.log-1.6.6=DOCKER-5
docker.image.git.id-1.6.6=6dc21beaa20fc8ef6760f3aa1ee853f2780d7642

#
# Liferay Docker Image Version 1.6.7
#

docker.image.change.log-1.6.7=DOCKER-27
docker.image.git.id-1.6.7=d7bffb7bf33ce51ff170cf4cf027350c07ea65db
13 changes: 13 additions & 0 deletions .shellcheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#
# For example, go to https://github.com/koalaman/shellcheck/wiki/SC2236 for more
# information about SC2236.
#

disable=SC1090
disable=SC1091
disable=SC2034
disable=SC2046
disable=SC2143
disable=SC2155
disable=SC2181
disable=SC2236
111 changes: 55 additions & 56 deletions _common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ function check_utils {

for util in "${@}"
do
command -v ${util} >/dev/null 2>&1 || { echo >&2 "The utility ${util} is not installed."; exit 1; }
command -v "${util}" >/dev/null 2>&1 || { echo >&2 "The utility ${util} is not installed."; exit 1; }
done
}

function clean_up_temp_directory {
rm -fr ${TEMP_DIR}
rm -fr "${TEMP_DIR}"
}

function configure_tomcat {
printf "\nCATALINA_OPTS=\"\${CATALINA_OPTS} \${LIFERAY_JVM_OPTS}\"" >> ${TEMP_DIR}/liferay/tomcat/bin/setenv.sh
printf "\nCATALINA_OPTS=\"\${CATALINA_OPTS} \${LIFERAY_JVM_OPTS}\"" >> "${TEMP_DIR}/liferay/tomcat/bin/setenv.sh"
}

function date {
Expand All @@ -28,59 +28,59 @@ function date {
then
if [ "$(uname)" == "Darwin" ]
then
echo $(/bin/date)
/bin/date
elif [ -e /bin/date ]
then
echo $(/bin/date)
/bin/date --iso-8601=seconds
else
echo $(/usr/bin/date)
/usr/bin/date --iso-8601=seconds
fi
else
if [ "$(uname)" == "Darwin" ]
then
echo $(/bin/date -jf "%a %b %e %H:%M:%S %Z %Y" "${1}" "${2}")
/bin/date -juf "%a %b %e %T %Z %Y" "${1}" "${2}"
elif [ -e /bin/date ]
then
echo $(/bin/date -d "${1}" "${2}")
/bin/date -d "${1}" "${2}"
else
echo $(/usr/bin/date -d "${1}" "${2}")
/usr/bin/date -d "${1}" "${2}"
fi
fi
}

function download {
local file_name=${1}
local file_url=${2}
local file_name="${1}"
local file_url="${2}"

if [ -e ${file_name} ] && [[ ${file_url} != */nightly/* ]] && [[ ${file_url} != */latest/* ]]
if [ -e "${file_name}" ] && [[ "${file_url}" != */nightly/* ]] && [[ "${file_url}" != */latest/* ]]
then
return
fi

if [[ ${file_url} != http*://* ]]
if [[ "${file_url}" != http*://* ]]
then
file_url=http://${file_url}
file_url="http://${file_url}"
fi

if [[ ${file_url} != http://mirrors.*.liferay.com* ]] &&
[[ ${file_url} != http://release-1* ]] &&
[[ ${file_url} != https://release.liferay.com* ]]
if [[ "${file_url}" != http://mirrors.*.liferay.com* ]] &&
[[ "${file_url}" != http://release-1* ]] &&
[[ "${file_url}" != https://release.liferay.com* ]]
then
if [ ! -n "${LIFERAY_DOCKER_MIRROR}" ]
then
LIFERAY_DOCKER_MIRROR=lax
fi

file_url=http://mirrors.${LIFERAY_DOCKER_MIRROR}.liferay.com/${file_url##*//}
file_url="http://mirrors.${LIFERAY_DOCKER_MIRROR}.liferay.com/"${file_url##*//}
fi

echo ""
echo "Downloading ${file_url}."
echo ""

mkdir -p $(dirname ${file_name})
mkdir -p $(dirname "${file_name}")

curl ${LIFERAY_DOCKER_CURL_OPTIONS} -f -o ${file_name} ${file_url} || exit 2
curl ${LIFERAY_DOCKER_CURL_OPTIONS} -f -o "${file_name}" "${file_url}" || exit 2
}

function get_docker_image_tags_args {
Expand All @@ -91,20 +91,19 @@ function get_docker_image_tags_args {
docker_image_tags_args="${docker_image_tags_args} --tag ${docker_image_tag}"
done

echo ${docker_image_tags_args}
echo "${docker_image_tags_args}"
}

function get_tomcat_version {
if [ -e ${1}/tomcat-* ]
then
for temp_file_name in `ls ${1}`
do
if [[ ${temp_file_name} == tomcat-* ]]
then
local liferay_tomcat_version=${temp_file_name#*-}
fi
done
fi
for temp_file_name in "${1}"/tomcat-*
do
if [ -e "${temp_file_name}" ]
then
local tomcat_folder=${temp_file_name##*/}
local liferay_tomcat_version=${tomcat_folder#*-}
fi
break
done

if [ -z ${liferay_tomcat_version+x} ]
then
Expand All @@ -113,48 +112,48 @@ function get_tomcat_version {
exit 1
fi

echo ${liferay_tomcat_version}
echo "${liferay_tomcat_version}"
}

function make_temp_directory {
CURRENT_DATE=$(date)

TIMESTAMP=$(date "${CURRENT_DATE}" "+%Y%m%d%H%M%S")

TEMP_DIR=temp-${TIMESTAMP}
TEMP_DIR="temp-${TIMESTAMP}"

mkdir -p ${TEMP_DIR}
mkdir -p "${TEMP_DIR}"

cp -r ${1}/* ${TEMP_DIR}
cp -r "${1}"/* "${TEMP_DIR}"
}

function pid_8080 {
local pid=`lsof -i 4tcp:8080 -sTCP:LISTEN -Fp | head -n 1`
local pid=$(lsof -Fp -i 4tcp:8080 -sTCP:LISTEN | head -n 1)

echo ${pid##p}
"echo ${pid##p}"
}

function prepare_tomcat {
local liferay_tomcat_version=$(get_tomcat_version ${TEMP_DIR}/liferay)
local liferay_tomcat_version=$(get_tomcat_version "${TEMP_DIR}/liferay")

mv ${TEMP_DIR}/liferay/tomcat-${liferay_tomcat_version} ${TEMP_DIR}/liferay/tomcat
mv "${TEMP_DIR}/liferay/tomcat-${liferay_tomcat_version}" "${TEMP_DIR}/liferay/tomcat"

ln -s tomcat ${TEMP_DIR}/liferay/tomcat-${liferay_tomcat_version}
ln -s tomcat "${TEMP_DIR}/liferay/tomcat-${liferay_tomcat_version}"

configure_tomcat

warm_up_tomcat

rm -fr ${TEMP_DIR}/liferay/logs/*
rm -fr ${TEMP_DIR}/liferay/tomcat/logs/*
rm -fr "${TEMP_DIR}"/liferay/logs/*
rm -fr "${TEMP_DIR}"/liferay/tomcat/logs/*
}

function push_docker_images {
if [ "${1}" == "push" ]
then
for docker_image_tag in "${DOCKER_IMAGE_TAGS[@]}"
do
docker push ${docker_image_tag}
docker push "${docker_image_tag}"
done
fi
}
Expand All @@ -177,34 +176,34 @@ function start_tomcat {
echo "Killing process ${pid} that is listening on port 8080."
echo ""

kill -9 ${pid} 2>/dev/null
kill -9 "${pid}" 2>/dev/null
fi

./${TEMP_DIR}/liferay/tomcat/bin/catalina.sh start
"./${TEMP_DIR}/liferay/tomcat/bin/catalina.sh" start

until $(curl --head --fail --output /dev/null --silent http://localhost:8080)
until curl --fail --head --output /dev/null --silent http://localhost:8080
do
sleep 3
done

pid=$(pid_8080)

./${TEMP_DIR}/liferay/tomcat/bin/catalina.sh stop
"./${TEMP_DIR}/liferay/tomcat/bin/catalina.sh" stop

sleep 30

kill -9 ${pid} 2>/dev/null
kill -9 "${pid}" 2>/dev/null

rm -fr ${TEMP_DIR}/liferay/data/osgi/state
rm -fr ${TEMP_DIR}/liferay/osgi/state
rm -fr "${TEMP_DIR}/liferay/data/osgi/state"
rm -fr "${TEMP_DIR}/liferay/osgi/state"
}

function stat {
if [ "$(uname)" == "Darwin" ]
then
echo $(/usr/bin/stat -f "%z" "${1}")
/usr/bin/stat -f "%z" "${1}"
else
echo $(/usr/bin/stat --printf="%s" "${1}")
/usr/bin/stat --printf="%s" "${1}"
fi
}

Expand All @@ -228,19 +227,19 @@ function warm_up_tomcat {
# the Hypersonic files can take over 20 seconds.
#

if [ -d ${TEMP_DIR}/liferay/data/hsql ]
if [ -d "${TEMP_DIR}/liferay/data/hsql" ]
then
if [ $(stat ${TEMP_DIR}/liferay/data/hsql/lportal.script) -lt 1024000 ]
if [ $(stat "${TEMP_DIR}/liferay/data/hsql/lportal.script") -lt 1024000 ]
then
start_tomcat
else
echo Tomcat is already warmed up.
fi
fi

if [ -d ${TEMP_DIR}/liferay/data/hypersonic ]
if [ -d "${TEMP_DIR}/liferay/data/hypersonic" ]
then
if [ $(stat ${TEMP_DIR}/liferay/data/hypersonic/lportal.script) -lt 1024000 ]
if [ $(stat "${TEMP_DIR}/liferay/data/hypersonic/lportal.script") -lt 1024000 ]
then
start_tomcat
else
Expand Down
Loading