[Project] extended checking out to support tag/branch

This commit is contained in:
Robert von Burg 2014-08-24 18:06:09 +02:00
parent dbe9b8e61b
commit 0673036a98
7 changed files with 102 additions and 42 deletions

View File

@ -9,10 +9,20 @@ while read project; do
if [ "${project}" == "" ] ; then if [ "${project}" == "" ] ; then
continue; continue;
fi fi
if [ -d "${project}" ] ; then
echo "Project ${project} already cloned." array=(${project//:/ })
name="${array[0]}"
tag="${array[1]}"
if [ "${name}" == "" ] || [ "${tag}" == "" ] ; then
echo -e "ERROR: Invalid project: ${project}! Must have form <git_name:tag>"
exit 1
fi
if [ -d "${name}" ] ; then
echo "Project ${name} already cloned."
else else
if ! git clone "git@github.com:eitchnet/${project}.git" "${project}" ;then if ! git clone "git@github.com:eitchnet/${name}.git" "${name}" ;then
exit 1 exit 1
fi fi
echo echo
@ -20,4 +30,4 @@ while read project; do
done < ${projectsFile} done < ${projectsFile}
echo "Done." echo "Done."
exit 0 exit 0

View File

@ -9,10 +9,20 @@ while read project; do
if [ "${project}" == "" ] ; then if [ "${project}" == "" ] ; then
continue; continue;
fi fi
if [ -d "${project}" ] ; then
echo "Project ${project} already cloned." array=(${project//:/ })
name="${array[0]}"
tag="${array[1]}"
if [ "${name}" == "" ] || [ "${tag}" == "" ] ; then
echo -e "ERROR: Invalid project: ${project}! Must have form <git_name:tag>"
exit 1
fi
if [ -d "${name}" ] ; then
echo "Project ${name} already cloned."
else else
if ! git clone "https://github.com/eitchnet/${project}.git" "${project}" ;then if ! git clone "https://github.com/eitchnet/${name}.git" "${name}" ;then
exit 1 exit 1
fi fi
echo echo
@ -20,4 +30,4 @@ while read project; do
done < ${projectsFile} done < ${projectsFile}
echo "Done." echo "Done."
exit 0 exit 0

View File

@ -40,32 +40,42 @@ while read project; do
if [ "${project}" == "" ] ; then if [ "${project}" == "" ] ; then
continue; continue;
fi fi
if ! cd "${project}" ; then
echo "ERROR: Could not switch to directory ${project}" array=(${project//:/ })
name="${array[0]}"
tag="${array[1]}"
if [ "${name}" == "" ] || [ "${tag}" == "" ] ; then
echo -e "ERROR: Invalid project: ${project}! Must have form <git_name:tag>"
exit 1 exit 1
fi fi
echo "INFO: Copying ${project} packages..." if ! cd "${name}" ; then
echo "ERROR: Could not switch to directory ${name}"
exit 1
fi
echo "INFO: Copying ${name} packages..."
if ls target/*.jar 2>/dev/null ; then if ls target/*.jar 2>/dev/null ; then
if ! cp target/*.jar "${workDir}" ; then if ! cp target/*.jar "${workDir}" ; then
echo "ERROR: Failed to copy package for project ${project}." echo "ERROR: Failed to copy package for project ${name}."
exit 1 exit 1
fi fi
if ! cp target/*.jar "${DIST_STROLCH}" ; then if ! cp target/*.jar "${DIST_STROLCH}" ; then
echo "ERROR: Failed to publish package for project ${project}." echo "ERROR: Failed to publish package for project ${name}."
exit 1 exit 1
fi fi
elif ls target/*.war 2>/dev/null ; then elif ls target/*.war 2>/dev/null ; then
if ! cp target/*.war "${workDir}" ; then if ! cp target/*.war "${workDir}" ; then
echo "ERROR: Failed to copy wars for project ${project}." echo "ERROR: Failed to copy wars for project ${name}."
exit 1 exit 1
fi fi
if ! cp target/*.war "${DIST_STROLCH}" ; then if ! cp target/*.war "${DIST_STROLCH}" ; then
echo "ERROR: Failed to publish wars for project ${project}." echo "ERROR: Failed to publish wars for project ${name}."
exit 1 exit 1
fi fi
else else
echo "INFO: Project ${project} has no target, skipping." echo "INFO: Project ${name} has no target, skipping."
fi fi
cd .. cd ..
@ -84,4 +94,4 @@ if ! mv ${projectName}-${projectVersion}.tar.gz "${DIST_STROLCH}" ; then
fi fi
echo "Done." echo "Done."
exit 0 exit 0

View File

@ -1,18 +1,17 @@
ch.eitchnet.parent ch.eitchnet.parent:1.0.0
ch.eitchnet.privilege ch.eitchnet.privilege:master
ch.eitchnet.utils ch.eitchnet.utils:master
ch.eitchnet.xmlpers ch.eitchnet.xmlpers:master
li.strolch.dev li.strolch.dev:master
li.strolch.parent li.strolch.parent:master
li.strolch.bom li.strolch.bom:master
li.strolch.model li.strolch.model:master
li.strolch.testbase li.strolch.testbase:master
li.strolch.agent li.strolch.agent:master
li.strolch.service li.strolch.service:master
li.strolch.rest li.strolch.rest:master
li.strolch.persistence.xml li.strolch.persistence.xml:master
li.strolch.persistence.postgresql li.strolch.persistence.postgresql:master
li.strolch.tutorialapp li.strolch.tutorialapp:master
li.strolch.tutorialwebapp li.strolch.tutorialwebapp:master
li.strolch.website li.strolch.website:master

15
pull.sh
View File

@ -7,12 +7,23 @@ while read project; do
if [ "${project}" == "" ] ; then if [ "${project}" == "" ] ; then
continue; continue;
fi fi
array=(${project//:/ })
name="${array[0]}"
tag="${array[1]}"
if [ "${name}" == "" ] || [ "${tag}" == "" ] ; then
echo -e "ERROR: Invalid project: ${project}! Must have form <git_name:tag>"
exit 1
fi
echo "Pulling ${project}..." echo "Pulling ${project}..."
cd ${project} cd ${name}
git pull git pull
git checkout ${tag}
cd .. cd ..
echo echo
done < ${projectsFile} done < ${projectsFile}
echo "Done." echo "Done."
exit 0 exit 0

16
push.sh
View File

@ -7,12 +7,22 @@ while read project; do
if [ "${project}" == "" ] ; then if [ "${project}" == "" ] ; then
continue; continue;
fi fi
echo "Pushing ${project}..."
cd ${project} array=(${project//:/ })
name="${array[0]}"
tag="${array[1]}"
if [ "${name}" == "" ] || [ "${tag}" == "" ] ; then
echo -e "ERROR: Invalid project: ${project}! Must have form <git_name:tag>"
exit 1
fi
echo "Pushing ${name}..."
cd ${name}
git push git push
cd .. cd ..
echo echo
done < ${projectsFile} done < ${projectsFile}
echo "Done." echo "Done."
exit 0 exit 0

View File

@ -7,8 +7,18 @@ while read project; do
if [ "${project}" == "" ] ; then if [ "${project}" == "" ] ; then
continue; continue;
fi fi
echo "Status of ${project}..."
cd ${project} array=(${project//:/ })
name="${array[0]}"
tag="${array[1]}"
if [ "${name}" == "" ] || [ "${tag}" == "" ] ; then
echo -e "ERROR: Invalid project: ${project}! Must have form <git_name:tag>"
exit 1
fi
echo "Status of ${name}..."
cd ${name}
git status -s git status -s
cd .. cd ..
echo echo