mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
update project script possible different JS-API (#4949)
This commit is contained in:
@@ -2,8 +2,6 @@
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
cd $DIR/../../
|
||||
|
||||
echo "Update Generator"
|
||||
./update-project.sh -gnu -t $GITHUB_TOKEN -n 'Alfresco/generator-ng2-alfresco-app'
|
||||
echo "Update ACA"
|
||||
|
62
scripts/travis/update/update-project.sh
Executable file
62
scripts/travis/update/update-project.sh
Executable file
@@ -0,0 +1,62 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
eval GNU=false
|
||||
|
||||
set -e
|
||||
TEMP_GENERATOR_DIR=".tmp-generator";
|
||||
VERSION=$(npm view @alfresco/adf-core@beta version)
|
||||
JS_VERSION=$(npm view @alfresco/js-api@beta version)
|
||||
|
||||
show_help() {
|
||||
echo "Usage: update-project.sh"
|
||||
echo ""
|
||||
echo "-t or --token Github ouath token"
|
||||
echo "-n or --name Github name of the project"
|
||||
echo "-gnu for gnu"
|
||||
}
|
||||
|
||||
gnu_mode() {
|
||||
echo "====== GNU MODE ====="
|
||||
GNU=true
|
||||
}
|
||||
|
||||
token() {
|
||||
TOKEN=$1
|
||||
}
|
||||
|
||||
name_repo() {
|
||||
NAME_REPO=$1
|
||||
}
|
||||
|
||||
while [[ $1 == -* ]]; do
|
||||
case "$1" in
|
||||
-h|--help|-\?) show_help; exit 0;;
|
||||
-n|--name|-\?) name_repo $2; shift 2;;
|
||||
-gnu) gnu_mode; shift;;
|
||||
-t|--token) token $2; shift 2;;
|
||||
-*) echo "invalid option: $1" 1>&2; show_help; exit 1;;
|
||||
esac
|
||||
done
|
||||
|
||||
rm -rf $TEMP_GENERATOR_DIR;
|
||||
|
||||
git clone https://$TOKEN@github.com/$NAME_REPO.git $TEMP_GENERATOR_DIR
|
||||
cd $TEMP_GENERATOR_DIR
|
||||
git checkout development
|
||||
|
||||
BRANCH="ADF-update-beta-$VERSION"
|
||||
git checkout -b $BRANCH
|
||||
|
||||
if $GNU; then
|
||||
./scripts/update-version.sh -gnu -v $VERSION -vj $JS_VERSION
|
||||
else
|
||||
./scripts/update-version.sh -v $VERSION -vj $JS_VERSION
|
||||
fi
|
||||
|
||||
git add .
|
||||
git commit -m "Update ADF packages version $VERSION"
|
||||
git push -u origin $BRANCH
|
||||
|
||||
curl -H "Authorization: token $TOKEN" -X POST -d '{"body":"Update ADF packages version '$VERSION'","head":"'$BRANCH'","base":"development","title":"Update ADF packages version '$VERSION'"}' https://api.github.com/repos/$NAME_REPO/pulls
|
||||
|
||||
rm -rf $TEMP_GENERATOR_DIR;
|
Reference in New Issue
Block a user