[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
continue;
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
if ! git clone "git@github.com:eitchnet/${project}.git" "${project}" ;then
if ! git clone "git@github.com:eitchnet/${name}.git" "${name}" ;then
exit 1
fi
echo
@ -20,4 +30,4 @@ while read project; do
done < ${projectsFile}
echo "Done."
exit 0
exit 0

View File

@ -9,10 +9,20 @@ while read project; do
if [ "${project}" == "" ] ; then
continue;
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
if ! git clone "https://github.com/eitchnet/${project}.git" "${project}" ;then
if ! git clone "https://github.com/eitchnet/${name}.git" "${name}" ;then
exit 1
fi
echo
@ -20,4 +30,4 @@ while read project; do
done < ${projectsFile}
echo "Done."
exit 0
exit 0

View File

@ -40,32 +40,42 @@ while read project; do
if [ "${project}" == "" ] ; then
continue;
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
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 ! 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
fi
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
fi
elif ls target/*.war 2>/dev/null ; 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
fi
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
fi
else
echo "INFO: Project ${project} has no target, skipping."
echo "INFO: Project ${name} has no target, skipping."
fi
cd ..
@ -84,4 +94,4 @@ if ! mv ${projectName}-${projectVersion}.tar.gz "${DIST_STROLCH}" ; then
fi
echo "Done."
exit 0
exit 0

View File

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

15
pull.sh
View File

@ -7,12 +7,23 @@ while read project; do
if [ "${project}" == "" ] ; then
continue;
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}..."
cd ${project}
cd ${name}
git pull
git checkout ${tag}
cd ..
echo
done < ${projectsFile}
echo "Done."
exit 0
exit 0

16
push.sh
View File

@ -7,12 +7,22 @@ while read project; do
if [ "${project}" == "" ] ; then
continue;
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
cd ..
echo
done < ${projectsFile}
echo "Done."
exit 0
exit 0

View File

@ -7,8 +7,18 @@ while read project; do
if [ "${project}" == "" ] ; then
continue;
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
cd ..
echo