Forked from yolabingo/dotcms-get-demo-site-starter-urls.sh
Created
April 13, 2022 21:59
-
-
Save wezell/84ff09f3c5a88b3633dfce7fdbaf25a0 to your computer and use it in GitHub Desktop.
Gets the CUSTOM_STARTER_URL for a specific version of dotCMS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/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 | |
# local_ip=$(ifconfig | grep "inet " | grep -Fv 127.0.0.1 | awk '{print $2}') | |
gitdir=/var/tmp/dotcms-get-starter-urls-repo | |
if [ ! -d $gitdir ] | |
then | |
echo "Cloning dotcms core repo to $gitdir" | |
git clone https://github.com/dotCMS/core.git $gitdir | |
fi | |
pushd $gitdir >/dev/null | |
git checkout master 2>/dev/null >/dev/null | |
git pull 2>/dev/null >/dev/null | |
for version in $(git tag -l v* | sed 's/^v//' | sort -n | uniq | grep -v MM.YY) | |
do | |
echo | |
git checkout v${version} 2>/dev/null >/dev/null | |
starter_date=$(grep 'starter group' dotCMS/build.gradle | grep -v empty_ | awk -F \' '{print $6}') | |
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 master 2>/dev/null >/dev/null | |
echo | |
pushd >/dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment