[Project] sources are now generated in package goal

This commit is contained in:
Robert von Burg 2014-03-21 22:54:34 +01:00
parent bbb5a0d1ca
commit 45bc38df7d
2 changed files with 68 additions and 2 deletions

View File

@ -1,5 +1,7 @@
#!/bin/bash
VERVEINE="/data/programs/verveinej/verveinej.sh"
DIST_STROLCH_MSE="/var/www/eitch/www.strolch.li/dist/snapshot"
DIST_STROLCH="/var/www/eitch/www.strolch.li/dist/snapshot"
## Prepare a new environment
mkdir -p target/strolch_mse
@ -42,7 +44,7 @@ if ! tar --exclude="*/target" --exclude="*/.git*" -cvzf strolch_mse.tar.gz strol
fi
rm -rf strolch_mse/
if ! mv strolch_mse.tar.gz ${DIST_STROLCH_MSE}/strolch_mse.tar.gz ; then
if ! mv strolch_mse.tar.gz ${DIST_STROLCH}/strolch_mse.tar.gz ; then
echo "ERROR: Failed to publish MSE file!"
exit 1
fi

64
createBundle.sh Executable file
View File

@ -0,0 +1,64 @@
#!/bin/bash
DIST_STROLCH="/var/www/eitch/www.strolch.li/dist/snapshot"
workDir="${PWD}/target/strolch_bundle"
projectsFile="${PWD}/projects.lst"
DIST_STROLCH="/Users/eitch/Downloads/"
# first we create all needed packages
if ! mvn -DskipTests clean package ; then
echo "ERROR: Failed to build packages!"
exit 1
fi
# Make sure the work directory exists
if ! [ -d "${workDir}" ] ; then
if ! mkdir -p "${workDir}" ; then
echo "ERROR: Failed to create work dir ${workDir}."
exit 1
fi
fi
echo "INFO: Bundling projects..."
# Now copy those packages to our work dir
cd ..
while read project; do
if [ "${project}" == "" ] ; then
continue;
fi
if ! cd "${project}" ; then
echo "ERROR: Could not switch to directory ${project}"
exit 1
fi
echo "INFO: Copying ${project} packages..."
if ! ls target/*.jar 2>/dev/null ; then
echo "INFO: Project ${project} has no target, skipping."
cd ..
continue
fi
if ! cp target/*.jar "${workDir}" ; then
echo "ERROR: Failed to copy package for project ${project}."
exit 1
fi
cd ..
done < ${projectsFile}
cd ${workDir}/..
if ! tar -cvzf strolch_bundle.tar.gz strolch_bundle ; then
echo "ERROR: Failed to make bundle."
exit 1
fi
if ! mv strolch_bundle.tar.gz "${DIST_STROLCH}" ; then
echo "ERROR: Failed to publish bundle."
exit 1
fi
echo "Done."
exit 0