mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
* Reuse the common deployment and modeling api * Add files to testing * Pass parameters * Travis initaae with correct parameters * Travis initaae with correct parameters * Add cli to the smart build
119 lines
2.0 KiB
Bash
Executable File
119 lines
2.0 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
eval BRANCH_NAME=""
|
|
eval GNU=false
|
|
|
|
show_help() {
|
|
echo "Usage: smart-build.sh"
|
|
echo ""
|
|
echo "-b branch name"
|
|
echo "-gnu for gnu"
|
|
}
|
|
|
|
branch_name(){
|
|
BRANCH_NAME=$1
|
|
}
|
|
|
|
gnu_mode() {
|
|
echo "====== GNU MODE ====="
|
|
GNU=true
|
|
}
|
|
|
|
while [[ $1 == -* ]]; do
|
|
case "$1" in
|
|
-b) branch_name $2; shift 2;;
|
|
-gnu) gnu_mode; shift;;
|
|
-*) echo "invalid option: $1" 1>&2; show_help; exit 0;;
|
|
esac
|
|
done
|
|
|
|
if [[ "$BRANCH_NAME" == "" ]]
|
|
then
|
|
echo "The branch name is mandatory"
|
|
exit 0
|
|
fi
|
|
|
|
echo "The branch name to check is $BRANCH_NAME"
|
|
|
|
if $GNU; then
|
|
gnu='-gnu'
|
|
else
|
|
gnu=''
|
|
fi
|
|
|
|
if [ $BRANCH_NAME == "undefined" ]; then
|
|
echo "Rebase your branch"
|
|
exit 1
|
|
fi
|
|
|
|
#reset the tmp folder
|
|
affected="$(./scripts/affected-libs.sh ${gnu[@]} -b "$BRANCH_NAME")"
|
|
echo $affected
|
|
libs=(`echo $affected | sed 's/^$/\n/g'`)
|
|
|
|
echo "Builds"
|
|
|
|
#extensions
|
|
for i in "${libs[@]}"
|
|
do
|
|
if [ "$i" == "extensions$" ] ; then
|
|
./scripts/build/build-extensions.sh || exit 1;
|
|
fi
|
|
done
|
|
|
|
#core
|
|
for i in "${libs[@]}"
|
|
do
|
|
if [ "$i" == "core$" ] ; then
|
|
./scripts/build/build-core.sh || exit 1;
|
|
fi
|
|
done
|
|
|
|
#content-services
|
|
for i in "${libs[@]}"
|
|
do
|
|
if [ "$i" == "content-services$" ] ; then
|
|
./scripts/build/build-content-services.sh || exit 1;
|
|
fi
|
|
done
|
|
|
|
#process-services
|
|
for i in "${libs[@]}"
|
|
do
|
|
if [ "$i" == "process-services$" ] ; then
|
|
./scripts/build/build-process-services.sh || exit 1;
|
|
fi
|
|
done
|
|
|
|
#process-services-cloud
|
|
for i in "${libs[@]}"
|
|
do
|
|
if [ "$i" == "process-services-cloud$" ] ; then
|
|
./scripts/build/build-process-services-cloud.sh || exit 1;
|
|
fi
|
|
done
|
|
|
|
#insights
|
|
for i in "${libs[@]}"
|
|
do
|
|
if [ "$i" == "insights$" ] ; then
|
|
./scripts/build/build-insights.sh || exit 1;
|
|
fi
|
|
done
|
|
|
|
#testing
|
|
for i in "${libs[@]}"
|
|
do
|
|
if [ "$i" == "testing$" ] ; then
|
|
./scripts/build/build-testing.sh || exit 1;
|
|
fi
|
|
done
|
|
|
|
#cli
|
|
for i in "${libs[@]}"
|
|
do
|
|
if [ "$i" == "cli$" ] ; then
|
|
./scripts/build/build-cli.sh || exit 1;
|
|
fi
|
|
done
|