Skip to content
This repository has been archived by the owner on Jan 22, 2022. It is now read-only.

Commit

Permalink
Changes to support automated release process
Browse files Browse the repository at this point in the history
  • Loading branch information
dotcmsbuild authored and victoralfaro-dotcms committed Feb 19, 2021
1 parent d5ffdcf commit cc440f6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
8 changes: 3 additions & 5 deletions images/dotcms-seed/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,14 @@ LABEL com.dotcms.contact "info@dotcms.com"
LABEL com.dotcms.vendor "dotCMS LLC"
LABEL com.dotcms.description "dotCMS Content Management System"


WORKDIR /srv

# Build env dependencies
RUN apk update && apk --no-cache add bash grep openssl git nodejs=10.14.2-r0 npm=10.14.2-r0 sed

RUN apk update && apk --no-cache add bash grep openssl git nodejs=10.14.2-r0 npm=10.14.2-r0 sed

RUN mkdir -p /build/src \
&& echo "Pulling dotCMS src" \
&& cd /build/src && git clone https://github.com/dotCMS/core.git core \
&& cd /build/src && git clone https://github.com/dotCMS/core.git core \
&& cd /build/src/core/dotCMS \
&& git gc --aggressive \
&& ./gradlew --no-daemon downloadDependencies clonePullTomcatDist -PuseGradleNode=false
&& ./gradlew --no-daemon downloadDependencies clonePullTomcatDist -PuseGradleNode=false
2 changes: 1 addition & 1 deletion images/dotcms/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ARG BUILD_FROM=COMMIT
ARG BUILD_ID=HEAD

# Tomcat version
ARG TOMCAT_VERSION
ARG TOMCAT_VERSION=""

WORKDIR /srv

Expand Down
19 changes: 14 additions & 5 deletions images/dotcms/build-src/build_dotcms.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

set -e

echo "Executing: $0 $@"

build_source=$1
build_id=$2
tomcat_version=$3
Expand All @@ -25,21 +27,28 @@ build_by_commit() {
mkdir -p /build/src && cd /build/src

cd /build/src/core
git fetch --all --tags
git clean -f -d
git pull

echo "Checking out commit/tag/branch: $1"
git checkout $1
if [[ ${is_release} == true ]]; then
echo "Executing: git checkout tags/${1} -b ${1}"
git checkout tags/${1} -b ${1}
else
echo "Executing: git checkout ${1}"
git checkout ${1}
fi

cd dotCMS && ./gradlew clonePullTomcatDist createDistPrep -PuseGradleNode=false
find ../dist/ -name "*.sh" -exec chmod 500 {} \;
mv ../dist/* "${build_target_dir}"
}

set_tomcat_dir() {
tomcat_versions=$(find /srv/dotserver/ -type d -name tomcat-* | grep -oP "(?<=tomcat-)[0-9]{1}\.[0-9]{1}\.[0-9]+$ | sort -k1.2n")
echo "Found tomcat installations:
${tomcat_versions}"
tomcat_versions=$(find /srv/dotserver/ -type d -name tomcat-* | grep -oP "(?<=tomcat-)[0-9]{1}\.[0-9]{1}\.[0-9]+$" | sort -n)
display_tomcat_version=$(echo ${tomcat_versions} | tr '\n' ' ')
echo "Found tomcat installations: ${display_tomcat_version}"

if [[ -n "${tomcat_version}" ]]; then
echo "Provided Tomcat version: ${tomcat_version}"
Expand All @@ -50,7 +59,7 @@ set_tomcat_dir() {
exit 1
fi
else
tomcat_version=$(find /srv/dotserver/ -type d -name tomcat-* | grep -oP "(?<=tomcat-)[0-9]{1}\.[0-9]{1}\.[0-9]+$" | sort -k1.2n | tail -n 1)
tomcat_version=$(find /srv/dotserver/ -type d -name tomcat-* | grep -oP "(?<=tomcat-)[0-9]{1}\.[0-9]{1}\.[0-9]+$" | sort -n | tail -n 1)
[[ -z "${tomcat_version}" ]] && echo "ERROR: Unable to determine Tomcat version" && exit 1
fi

Expand Down

0 comments on commit cc440f6

Please sign in to comment.