Skip to content

Instantly share code, notes, and snippets.

@yolabingo
Last active February 2, 2024 23:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save yolabingo/f11e81b2cbdb00fff9b1ae0ef8076263 to your computer and use it in GitHub Desktop.
Save yolabingo/f11e81b2cbdb00fff9b1ae0ef8076263 to your computer and use it in GitHub Desktop.
Gets the CUSTOM_STARTER_URL for a specific version of dotCMS
#!/usr/bin/env bash
# https://gist.github.com/yolabingo/f11e81b2cbdb00fff9b1ae0ef8076263
# checks out dotcms/core GH repo, then prints the CUSTOM_STARTER_URL for demo site content
# for each tagged version release
# output formatted for docker-compose.yml
if ! which git > /dev/null
then
echo "'git' must be installed to run this script"
echo
exit 0
fi
gitdir=/var/tmp/dotcms-get-starter-urls-repo
if [ ! -d $gitdir ]
then
echo "Initial clone of dotcms repo to $gitdir - this will take some time"
echo
git clone https://github.com/dotCMS/core.git $gitdir
fi
pushd $gitdir >/dev/null
git checkout -q master
git pull -q
for version in $(git tag -l v* | sed 's/^v//' | sort -n | uniq | grep -v MM.YY)
do
echo
git checkout -q v${version}
if [ -f dotCMS/build.gradle ]
then
starter_date=$(grep 'starter group' dotCMS/build.gradle | grep -v empty_ | awk -F \' '{print $6}')
elif [ -f starter/pom.xml ]
then
starter_date=$(grep starter.zip.location.src/main/resources/local-zips/starter_20 starter/pom.xml | awk -F starter_ '{print $2}' | awk -F .zip '{print $1}')
echo "POM"
grep starter.zip.location.src/main/resources/local-zips/starter_20 starter/pom.xml
echo "## POM"
fi
cat <<EOF
dotcms:
image: dotcms/dotcms:${version}
environment:
CUSTOM_STARTER_URL: https://repo.dotcms.com/artifactory/libs-release-local/com/dotcms/starter/${starter_date}/starter-${starter_date}.zip
EOF
done
git checkout -q master
echo
pushd >/dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment