Commit 50e3d956 authored by LAVENIER's avatar LAVENIER
Browse files

Merge branch 'release/1.5.2'

parents 6d174e63 506998a3
......@@ -4,7 +4,7 @@
"extensions": {
"endpoints": {
"Default GraphQL Endpoint": {
"url": "http://localhost:8080/graphql",
"url": "http://192.168.0.45:8080/graphql",
"headers": {
"user-agent": "JS GraphQL"
},
......
<?xml version='1.0' encoding='utf-8'?>
<widget android-versionCode="10501" id="net.sumaris.app" version="1.5.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget android-versionCode="10502" id="net.sumaris.app" version="1.5.2" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>SUMARiS</name>
<description>Halieutic data capture</description>
<author email="contact@e-is.pro" href="http://www.e-is.pro">Environmental Information Systems</author>
......
......@@ -8,9 +8,9 @@ This article will explain how to install your environment, then build the applic
1. Install [NVM](https://github.com/nvm-sh/nvm)
2. Install Node (v12) ex: 12.18.2
2. Install Node (v12) ex: 12.19.1
```bash
nvm install 12.18.2
nvm install 12.19.1
```
3. Install global dependency:
......
......@@ -15,7 +15,7 @@ if [[ "_$INSTALL_DIR" == "_" ]]; then
fi
latest_version() {
echo "1.5.1" #lastest
echo "1.5.2" #lastest
}
api_release_url() {
......
{
"name": "sumaris-app",
"description": "SUMARiS app",
"version": "1.5.1",
"version": "1.5.2",
"author": "contact@e-is.pro",
"license": "AGPL-3.0",
"readmeFilename": "README.md",
......@@ -24,16 +24,20 @@
"e2e": "npm run ng e2e"
},
"dependencies": {
"@angular/animations": "^10.0.14",
"@angular/cdk": "^10.0.2",
"@angular/common": "^10.0.14",
"@angular/core": "^10.0.14",
"@angular/forms": "^10.0.14",
"@angular/material": "^10.0.2",
"@angular/material-moment-adapter": "^10.0.2",
"@angular/platform-browser": "^10.0.14",
"@angular/platform-browser-dynamic": "^10.0.14",
"@angular/router": "^10.0.14",
"@angular/animations": "^11.0.2",
"@angular/cdk": "^11.0.0",
"@angular/common": "^11.0.2",
"@angular/core": "^11.0.2",
"@angular/forms": "^11.0.2",
"@angular/material": "^11.0.0",
"@angular/material-moment-adapter": "^11.0.0",
"@angular/platform-browser": "^11.0.2",
"@angular/platform-browser-dynamic": "^11.0.2",
"@angular/router": "^11.0.2",
"@apollo/client": "^3.2.7",
"@apollo/link-error": "^2.0.0-beta.3",
"@apollo/link-retry": "^2.0.0-beta.3",
"@apollo/link-ws": "^2.0.0-beta.3",
"@asymmetrik/ngx-leaflet": "^7.0.1",
"@e-is/ngx-material-table": "0.10.2",
"@ionic-native/audio-management": "^5.29.0",
......@@ -41,7 +45,6 @@
"@ionic-native/core": "^5.29.0",
"@ionic-native/downloader": "^5.29.0",
"@ionic-native/geolocation": "^5.29.0",
"@ionic-native/http": "^5.29.0",
"@ionic-native/in-app-browser": "^5.29.0",
"@ionic-native/keyboard": "^5.29.0",
"@ionic-native/native-audio": "^5.29.0",
......@@ -49,26 +52,21 @@
"@ionic-native/splash-screen": "^5.29.0",
"@ionic-native/status-bar": "^5.29.0",
"@ionic-native/vibration": "^5.29.0",
"@ionic/angular": "^5.3.5",
"@ionic/core": "^5.3.5",
"@ionic/angular": "^5.5.0",
"@ionic/core": "^5.5.0",
"@ionic/pwa-elements": "^3.0.1",
"@ionic/storage": "^2.3.1",
"@ngtools/webpack": "^10.1.7",
"@ngtools/webpack": "^11.0.2",
"@ngx-translate/core": "^13.0.0",
"@ngx-translate/http-loader": "^6.0.0",
"angular2-text-mask": "^9.0.0",
"apollo-angular": "^1.10.0",
"apollo-angular-link-http": "^1.10.0",
"apollo-angular": "^2.1.0",
"apollo-angular-link-http": "^1.11.0",
"apollo-cache-inmemory": "^1.6.6",
"apollo-cache-persist": "^0.1.1",
"apollo-client": "^2.6.10",
"apollo-link": "^1.2.14",
"apollo-link-error": "^1.1.13",
"apollo-link-logger": "^1.2.3",
"apollo-link-queue": "^2.2.0",
"apollo-link-retry": "^2.2.16",
"apollo3-cache-persist": "^0.9.1",
"apollo-link-logger": "^2.0.0",
"apollo-link-queue": "^3.0.0",
"apollo-link-serialize": "^3.1.1",
"apollo-link-ws": "^1.0.20",
"chart.js": "^2.9.4",
"clovelced-plugin-audiomanagement": "^1.0.2",
"cordova-android": "^8.1.0",
......@@ -87,8 +85,8 @@
"geojson": "^0.5.0",
"graphql": "^15.4.0",
"graphql-tag": "^2.11.0",
"hammer-timejs": "^1.1.0",
"hammerjs": "^2.0.8",
"hammer-timejs": "^1.1.0",
"integrator-cordova-plugin-downloader": "^1.1.0",
"ionic-cache": "^5.2.0",
"ionicons": "^5.1.2",
......@@ -100,12 +98,11 @@
"moment": "^2.27.0",
"ng2-charts": "^2.4.2",
"ng2-charts-schematics": "^0.1.7",
"ngx-color-picker": "^9.1.0",
"ngx-color-picker": "^10.1.0",
"ngx-markdown": "^10.1.1",
"ngx-material-timepicker": "5.5.3",
"ngx-quicklink": "^0.2.4",
"roboto-fontface": "^0.10.0",
"rxjs": "6.4.0",
"scrypt-async": "^2.0.1",
"seedrandom": "^3.0.5",
"subscriptions-transport-ws": "^0.9.16",
......@@ -114,29 +111,33 @@
"tweetnacl": "^1.0.3",
"tweetnacl-util": "^0.15.1",
"uuid": "^3.3.3",
"zone.js": "~0.10.3"
"zone.js": "~0.11.3"
},
"peerDependencies": {
"tar": "^5.0.5"
"tar": "^5.0.5",
"rxjs": "^6.6.3"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.1000.8",
"@angular/cli": "^10.0.8",
"@angular/compiler": "^10.0.14",
"@angular/compiler-cli": "^10.0.14",
"@angular/language-service": "^10.0.14",
"@ionic/angular-toolkit": "^2.3.3",
"@ionic/cli": "^6.11.8",
"@types/async": "^3.0.8",
"@types/graphql": "14.2.3",
"@types/jasmine": "^3.5.10",
"@angular-devkit/build-angular": "~0.1100.2",
"@angular-devkit/build-webpack": "~0.1100.2",
"@angular/cli": "^11.0.2",
"@angular/compiler": "^11.0.2",
"@angular/compiler-cli": "^11.0.2",
"@angular/language-service": "^11.0.2",
"@ionic/angular-toolkit": "^3.0.0",
"@ionic/cli": "^6.12.2",
"@types/async": "^3.2.4",
"@types/graphql": "14.5.0",
"@types/jasmine": "^3.6.2",
"@types/jasminewd2": "^2.0.8",
"@types/leaflet": "^1.5.13",
"@types/node": "^12.11.1",
"@types/leaflet": "^1.5.19",
"@types/node": "^12.19.6",
"@types/uuid": "^3.4.9",
"acorn": "^7.3.1",
"codelyzer": "^6.0.0",
"cordova": "^9.0.0",
"cordova-res": "^0.15.2",
"rxjs": "^6.6.3",
"cordova-plugin-camera": "^4.1.0",
"cordova-plugin-device": "^2.0.3",
"cordova-plugin-ionic-keyboard": "^2.2.0",
......@@ -145,6 +146,7 @@
"cordova-plugin-statusbar": "^2.4.3",
"cordova-plugin-whitelist": "^1.3.4",
"eslint": "^7.4.0",
"react": "^17.0.1",
"jasmine-core": "~3.6.0",
"jasmine-spec-reporter": "~5.0.2",
"karma": "~5.2.1",
......@@ -152,13 +154,13 @@
"karma-coverage-istanbul-reporter": "~3.0.3",
"karma-jasmine": "~4.0.1",
"karma-jasmine-html-reporter": "^1.5.4",
"node-sass": "^4.14.1",
"protractor": "~7.0.0",
"sass-loader": "^7.3.1",
"sass": "^1.29.0",
"sass-loader": "^10.1.0",
"tar": "^5.0.5",
"ts-node": "^8.10.2",
"typescript": "~3.9.7",
"webpack": "^4.44.2"
"typescript": "~4.0.5",
"webpack": "^4.0.1"
},
"cordova": {
"plugins": {
......
#!/bin/bash
# Get to the root project
if [[ "_" == "_${PROJECT_DIR}" ]]; then
SCRIPT_DIR=$(dirname $0)
PROJECT_DIR=$(cd "${SCRIPT_DIR}/.." && pwd)
export PROJECT_DIR
fi;
# Preparing Android environment
. ${PROJECT_DIR}/scripts/env-android.sh
[[ $? -ne 0 ]] && exit 1
cd ${PROJECT_DIR}
# Read parameters
task=$1
version=$2
androidVersion=$3
release_description=$4
# Check version format
if [[ ! $task =~ ^(pre|rel)$ || ! $version =~ ^[0-9]+.[0-9]+.[0-9]+(-(alpha|beta|rc)[0-9]+)?$ || ! $androidVersion =~ ^[0-9]+$ ]]; then
echo "Wrong version format"
echo "Usage:"
echo " > ./release-gitflow.sh [pre|rel] <version> <android-version> <release_description>"
echo "with:"
echo " - pre: use for pre-release"
echo " - rel: for full release"
echo " - version: x.y.z"
echo " - android-version: nnn"
echo " - release_description: a comment on release"
exit 1
fi
### Control that the script is run on `dev` branch
resumeRelease=0
branch=`git rev-parse --abbrev-ref HEAD`
if [[ ! "$branch" = "develop" ]]
then
if [[ "$branch" = "release/$version" ]]
then
echo "Resuming release ..."
resumeRelease=1
else
echo ">> This script must be run under \`develop\` or \`release/$version\` branch"
exit 1
fi
fi
PROJECT_DIR=`pwd`
### Get current version (package.json)
current=`grep -oP "version\": \"\d+.\d+.\d+(-(alpha|beta|rc)[0-9]+)?" package.json | grep -m 1 -oP "\d+.\d+.\d+(-(alpha|beta|rc)[0-9]+)?"`
if [[ "_$current" == "_" ]]; then
echo ">> Unable to read the current version in 'package.json'. Please check version format is: x.y.z (x and y should be an integer)."
exit 1;
fi
echo "Current version: $current"
### Get current version for Android
currentAndroid=`grep -oP "android-versionCode=\"[0-9]+\"" config.xml | grep -oP "\d+"`
if [[ "_$currentAndroid" == "_" ]]; then
echo ">> Unable to read the current Android version in 'config.xml'. Please check version format is an integer."
exit 1;
fi
echo "Current Android version: $currentAndroid"
echo "**********************************"
if [[ $resumeRelease = 0 ]]
then
echo "* Starting release..."
else
echo "* Resuming release..."
fi
echo "**********************************"
echo "* new build version: $version"
echo "* new build android version: $androidVersion"
echo "**********************************"
if [[ $resumeRelease = 0 ]]
then
read -r -p "Is these new versions correct ? [y/N] " response
response=${response,,} # tolower
[[ ! "$response" =~ ^(yes|y)$ ]] && exit 1
git flow release start "$version"
[[ $? -ne 0 ]] && exit 1
fi
case "$task" in
rel|pre)
# Change the version in files: 'package.json' and 'config.xml'
sed -i "s/version\": \"$current\"/version\": \"$version\"/g" package.json
currentConfigXmlVersion=`grep -oP "version=\"\d+.\d+.\d+(-(alpha|beta|rc)[0-9]+)?\"" config.xml | grep -oP "\d+.\d+.\d+(-(alpha|beta|rc)[0-9]+)?"`
sed -i "s/ version=\"$currentConfigXmlVersion\"/ version=\"$version\"/g" config.xml
sed -i "s/ android-versionCode=\"$currentAndroid\"/ android-versionCode=\"$androidVersion\"/g" config.xml
# Change version in file: 'src/assets/manifest.json'
currentManifestJsonVersion=`grep -oP "version\": \"\d+.\d+.\d+(-(alpha|beta|rc)[0-9]+)?\"" src/assets/manifest.json | grep -oP "\d+.\d+.\d+(-(alpha|beta|rc)[0-9]+)?"`
sed -i "s/version\": \"$currentManifestJsonVersion\"/version\": \"$version\"/g" src/assets/manifest.json
# Bump the install.sh
sed -i "s/echo \".*\" #lastest/echo \"$version\" #lastest/g" install.sh
;;
*)
echo "No task given"
;;
esac
echo "----------------------------------"
echo "- Compiling sources..."
echo "----------------------------------"
npm run build.prod
[[ $? -ne 0 ]] && exit 1
echo "----------------------------------"
echo "- Creating web artifact..."
echo "----------------------------------"
mkdir -p "${PROJECT_DIR}/dist"
ZIP_FILE=${PROJECT_DIR}/dist/${PROJECT_NAME}.zip
if [[ -f "$ZIP_FILE" ]]; then
rm $ZIP_FILE
fi
cd $PROJECT_DIR/www
zip -q -r $ZIP_FILE .
if [[ $? -ne 0 ]]; then
echo "Connot create the archive for the web artifact"
exit 1
fi
echo "-------------------------------------------"
echo "- Compiling sources for Android platform..."
echo "-------------------------------------------"
# Removing previous APK..."
rm ${PROJECT_DIR}/platforms/android/app/build/outputs/apk/release/*.apk
# Copy generated i18n files, to make sure Android release will use it
cp ${PROJECT_DIR}/www/assets/i18n/*.json ${PROJECT_DIR}/src/assets/i18n/
# Launch the build script
PROJECT_DIR=${PROJECT_DIR}
cd ${PROJECT_DIR}/scripts || exit 1
./release-android.sh
[[ $? -ne 0 ]] && exit 1
description="$release_description"
if [[ "_$description" == "_" ]]; then
description="Release $version"
fi
# Commit
#cd $PROJECT_DIR
#git reset HEAD
#git add package.json config.xml src/assets/manifest.json install.sh
#git commit -m "$version"
#git tag -f -a "$version" -m "${description}"
#git push origin "$version"
#[[ $? -ne 0 ]] && exit 1
# Pause (if propagation is need between hosted git server and github)
#sleep 10s
echo "**********************************"
echo "* Uploading artifacts to Github..."
echo "**********************************"
cd $PROJECT_DIR/scripts
./release-to-github.sh "$task" ''"$description"''
[[ $? -ne 0 ]] && exit 1
#echo "----------------------------------"
#echo "- Building desktop artifacts..."
#echo "----------------------------------"
#git submodule init
#git submodule sync
#git submodule update --remote --merge
#if [[ -d "$PROJECT_DIR/platforms/desktop" ]]; then
# cd platforms/desktop
# # Build desktop assets
# ./release.sh $version
# if [[ $? -ne 0 ]]; then
# exit 1
# fi
#else
# echo "WARN: platform/desktop not found -> Skipping desktop build!"
#fi;
echo "**********************************"
echo "* Finishing release"
echo "**********************************"
cd ${PROJECT_DIR}/scripts || exit 1
./release-gitflow-finish.sh "$version" ''"$release_description"''
[[ $? -ne 0 ]] && exit 1
echo "**********************************"
echo "* Build release succeed !"
echo "**********************************"
......@@ -12,21 +12,47 @@ fi;
cd ${PROJECT_DIR}
# Read parameters
task=$1
version=$2
androidVersion=$3
release_description=$4
# Check version format
if [[ ! $task =~ ^(pre|rel)$ || ! $version =~ ^[0-9]+.[0-9]+.[0-9]+(-(alpha|beta|rc)[0-9]+)?$ || ! $androidVersion =~ ^[0-9]+$ ]]; then
echo "Wrong version format"
echo "Usage:"
echo " > ./release-gitflow.sh [pre|rel] <version> <android-version> <release_description>"
echo "with:"
echo " - pre: use for pre-release"
echo " - rel: for full release"
echo " - version: x.y.z"
echo " - android-version: nnn"
echo " - release_description: a comment on release"
exit 1
fi
### Control that the script is run on `dev` branch
resumeRelease=0
branch=`git rev-parse --abbrev-ref HEAD`
if [[ ! "$branch" = "master" ]];
if [[ ! "$branch" = "develop" ]]
then
echo ">> This script must be run under \`master\` branch"
exit 1
if [[ "$branch" = "release/$version" ]]
then
echo "Resuming release ..."
resumeRelease=1
else
echo ">> This script must be run under \`develop\` or \`release/$version\` branch"
exit 1
fi
fi
PROJECT_DIR=`pwd`
### Get current version (package.json)
current=`grep -oP "version\": \"\d+.\d+.\d+((a|b)[0-9]+)?" package.json | grep -m 1 -oP "\d+.\d+.\d+((a|b)[0-9]+)?"`
current=`grep -oP "version\": \"\d+.\d+.\d+(-(alpha|beta|rc)[0-9]+)?" package.json | grep -m 1 -oP "\d+.\d+.\d+(-(alpha|beta|rc)[0-9]+)?"`
if [[ "_$current" == "_" ]]; then
echo "Unable to read the current version in 'package.json'. Please check version format is: x.y.z (x and y should be an integer)."
echo ">> Unable to read the current version in 'package.json'. Please check version format is: x.y.z (x and y should be an integer)."
exit 1;
fi
echo "Current version: $current"
......@@ -34,42 +60,46 @@ echo "Current version: $current"
### Get current version for Android
currentAndroid=`grep -oP "android-versionCode=\"[0-9]+\"" config.xml | grep -oP "\d+"`
if [[ "_$currentAndroid" == "_" ]]; then
echo "Unable to read the current Android version in 'config.xml'. Please check version format is an integer."
echo ">> Unable to read the current Android version in 'config.xml'. Please check version format is an integer."
exit 1;
fi
echo "Current Android version: $currentAndroid"
# Check version format
if [[ ! $2 =~ ^[0-9]+.[0-9]+.[0-9]+((a|b)[0-9]+)?$ || ! $3 =~ ^[0-9]+$ ]]; then
echo "Wrong version format"
echo "Usage:"
echo " > ./release.sh [pre|rel] <version> <android-version> <release_description>"
echo "with:"
echo " - pre: use for pre-release"
echo " - rel: for full release"
echo " - version: x.y.z"
echo " - android-version: nnn"
echo " - release_description: a comment on release"
exit 1
echo "**********************************"
if [[ $resumeRelease = 0 ]]
then
echo "* Starting release..."
else
echo "* Resuming release..."
fi
echo "**********************************"
echo "* new build version: $version"
echo "* new build android version: $androidVersion"
echo "**********************************"
echo "new build version: $2"
echo "new build android version: $3"
if [[ $resumeRelease = 0 ]]
then
read -r -p "Is these new versions correct ? [y/N] " response
response=${response,,} # tolower
[[ ! "$response" =~ ^(yes|y)$ ]] && exit 1
git flow release start "$version"
[[ $? -ne 0 ]] && exit 1
fi
case "$1" in
case "$task" in
rel|pre)
# Change the version in files: 'package.json' and 'config.xml'
sed -i "s/version\": \"$current\"/version\": \"$2\"/g" package.json
currentConfigXmlVersion=`grep -oP "version=\"\d+.\d+.\d+((a|b)[0-9]+)?\"" config.xml | grep -oP "\d+.\d+.\d+((a|b)[0-9]+)?"`
sed -i "s/ version=\"$currentConfigXmlVersion\"/ version=\"$2\"/g" config.xml
sed -i "s/ android-versionCode=\"$currentAndroid\"/ android-versionCode=\"$3\"/g" config.xml
sed -i "s/version\": \"$current\"/version\": \"$version\"/g" package.json
currentConfigXmlVersion=`grep -oP "version=\"\d+.\d+.\d+(-(alpha|beta|rc)[0-9]+)?\"" config.xml | grep -oP "\d+.\d+.\d+(-(alpha|beta|rc)[0-9]+)?"`
sed -i "s/ version=\"$currentConfigXmlVersion\"/ version=\"$version\"/g" config.xml
sed -i "s/ android-versionCode=\"$currentAndroid\"/ android-versionCode=\"$androidVersion\"/g" config.xml
# Change version in file: 'src/assets/manifest.json'
currentManifestJsonVersion=`grep -oP "version\": \"\d+.\d+.\d+((a|b)[0-9]+)?\"" src/assets/manifest.json | grep -oP "\d+.\d+.\d+((a|b)[0-9]+)?"`
sed -i "s/version\": \"$currentManifestJsonVersion\"/version\": \"$2\"/g" src/assets/manifest.json
currentManifestJsonVersion=`grep -oP "version\": \"\d+.\d+.\d+(-(alpha|beta|rc)[0-9]+)?\"" src/assets/manifest.json | grep -oP "\d+.\d+.\d+(-(alpha|beta|rc)[0-9]+)?"`
sed -i "s/version\": \"$currentManifestJsonVersion\"/version\": \"$version\"/g" src/assets/manifest.json
# Bump the install.sh
sed -i "s/echo \"v.*\" #lastest/echo \"v$2\" #lastest/g" install.sh
sed -i "s/echo \".*\" #lastest/echo \"$version\" #lastest/g" install.sh
;;
*)
echo "No task given"
......@@ -97,9 +127,9 @@ if [[ $? -ne 0 ]]; then
exit 1
fi
echo "----------------------------------"
echo "-------------------------------------------"
echo "- Compiling sources for Android platform..."
echo "----------------------------------"
echo "-------------------------------------------"
# Removing previous APK..."
rm ${PROJECT_DIR}/platforms/android/app/build/outputs/apk/release/*.apk
......@@ -113,33 +143,28 @@ cd ${PROJECT_DIR}/scripts || exit 1
./release-android.sh
[[ $? -ne 0 ]] && exit 1
echo "----------------------------------"
echo "- Executing git push, with tag: v$2"
echo "----------------------------------"
description="$4"
description="$release_description"
if [[ "_$description" == "_" ]]; then
description="Release v$2"
description="Release $version"
fi
# Commit
cd $PROJECT_DIR
git reset HEAD
git add package.json config.xml src/assets/manifest.json install.sh
git commit -m "v$2"
git tag -f -a "v$2" -m "${description}"
git push origin "v$2"
[[ $? -ne 0 ]] && exit 1
#cd $PROJECT_DIR
#git reset HEAD
#git add package.json config.xml src/assets/manifest.json install.sh
#git commit -m "$version"
#git tag -f -a "$version" -m "${description}"
#git push origin "$version"
#[[ $? -ne 0 ]] && exit 1
# Pause (if propagation is need between hosted git server and github)
sleep 10s
#sleep 10s
echo "**********************************"
echo "* Uploading artifacts to Github..."
echo "**********************************"
cd $PROJECT_DIR/scripts
./release-to-github.sh $1 ''"$description"''
./release-to-github.sh "$task" ''"$description"''
[[ $? -ne 0 ]] && exit 1
#echo "----------------------------------"
......@@ -154,7 +179,7 @@ cd $PROJECT_DIR/scripts