Merge pull request #92 in TEA/mina-sidor-fa-web from feature/version-number to develop

Squashed commit of the following:

commit 2b0f98a4151d3afddd6e717cf3495dd4f78fb79e
Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se>
Date:   Tue Sep 14 15:56:22 2021 +0200

    Removed unused files

commit 0c308eea737b181bb56628c964d6a15f8f142712
Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se>
Date:   Tue Sep 14 15:52:34 2021 +0200

    Implemented version number so it is saved in environments file upon build
This commit is contained in:
Erik Tiekstra
2021-09-14 15:57:12 +02:00
parent 52cd7ad6f4
commit ca8160f571
11 changed files with 30 additions and 25 deletions

View File

@@ -14,11 +14,7 @@ ORANGE='\033[0;33m'
CYAN='\033[0;36m'
YELLOW='\033[1;33m'
BRANCH=$(git rev-parse --abbrev-ref HEAD)
version=${version:-$BRANCH}
config=${config:-prod}
while [ $# -gt 0 ]; do
@@ -31,20 +27,19 @@ while [ $# -gt 0 ]; do
shift
done
config=${config:-prod}
version=${version:-$config}
# ----------------------------------
# UPDATING VERSION
# ----------------------------------
echo -e "${CYAN}Setting VERSION to ${version} inside assets directory${NOCOLOR}"
rm -f apps/mina-sidor-fa/src/assets/VERSION.md
touch apps/mina-sidor-fa/src/assets/VERSION.md
echo $version > apps/mina-sidor-fa/src/assets/VERSION.md
echo -e "${GREEN}VERSION set to ${version}${NOCOLOR}"
echo -e "${CYAN}Setting version to ${version} inside environments.${config}.ts${NOCOLOR}"
sed "s/version:.*',/version: '${version}',/" apps/mina-sidor-fa/src/environments/environment.$config.ts > temp.txt && mv temp.txt apps/mina-sidor-fa/src/environments/environment.$config.ts
echo -e "${GREEN}Version set to ${version}${NOCOLOR}"
# ----------------------------------
# BUILD APPLICATION
# ----------------------------------
if [ $config = "prod" ]; then
echo -e "${CYAN}Running npm run build -- --prod${NOCOLOR}"
npm run build -- --prod

View File

@@ -14,10 +14,7 @@ ORANGE='\033[0;33m'
CYAN='\033[0;36m'
YELLOW='\033[1;33m'
BRANCH=$(git rev-parse --abbrev-ref HEAD)
version=${version:-$BRANCH}
config=${config:-prod}
while [ $# -gt 0 ]; do
@@ -30,14 +27,16 @@ while [ $# -gt 0 ]; do
shift
done
config=${config:-prod}
version=${version:-$config}
# ----------------------------------
# UPDATING VERSION
# ----------------------------------
echo -e "${CYAN}Setting VERSION to ${version} inside assets directory${NOCOLOR}"
rm -f apps/mina-sidor-fa/src/assets/VERSION.md
touch apps/mina-sidor-fa/src/assets/VERSION.md
echo $version > apps/mina-sidor-fa/src/assets/VERSION.md
echo -e "${GREEN}VERSION set to ${version}${NOCOLOR}"
echo -e "${CYAN}Setting version to ${version} inside environments.${config}.ts${NOCOLOR}"
sed "s/version:.*',/version: '${version}',/" apps/mina-sidor-fa/src/environments/environment.$config.ts > temp.txt && mv temp.txt apps/mina-sidor-fa/src/environments/environment.$config.ts
echo -e "${GREEN}Version set to ${version}${NOCOLOR}"
# ----------------------------------
# BUILD APPLICATION