refactor: app deployment

This commit is contained in:
2023-06-05 10:54:18 +02:00
parent b21833de40
commit 3b8a344d73
104 changed files with 583 additions and 13494 deletions

View File

@@ -1,15 +0,0 @@
#!/usr/bin/env sh
# Adds a preedefined script tag including the merge current request id to the angular web app index.html.
# This enables the interactive gitlab review toolbar.
MERGE_REQUEST_ID=""
if echo -n $3 | grep -Eq '[0-9]+$'; then
MERGE_REQUEST_ID="$(echo -n "$3" | grep -Eo '[0-9]+$')"
fi
INDEX_PATH=$(dirname $1)
SCRIPT_TAG="<script defer data-project-id=\"$2\" data-project-path=\"openstapps/app\" data-merge-request-id=\"$MERGE_REQUEST_ID\" data-mr-url=\"https://gitlab.com\" id=\"review-app-toolbar-script\" src=\"visual_review_toolbar.js\"></script>"
curl https://gitlab.com/assets/webpack/visual_review_toolbar.js --output "$INDEX_PATH/visual_review_toolbar.js" --silent
sed -i -e "\@</head>@i\\$SCRIPT_TAG" $1

View File

@@ -1,4 +0,0 @@
#!/usr/bin/env sh
# script returns string with everything after the last colon of $1 input
echo -n $1 | grep -oE '[^:]+$'

View File

@@ -1,8 +0,0 @@
#!/usr/bin/env sh
# script returns semantical versioning string like 2.0.0 (if $1 is v2.0.0) or $1
if echo -n $1 | grep -Eq 'v[0-9]+\.[0-9]+\.[0-9]+'; then
echo $(echo -n "$1" | cut -c 2-);
else
echo $1;
fi

View File

@@ -1,7 +0,0 @@
#!/usr/bin/env sh
# If this is a pipeline of a version tag, also push this version
# as latest to the registry alias $2:latest
if echo -n $1 | grep -Eq 'v[0-9]+\.[0-9]+\.[0-9]+'; then
docker push $2:latest;
fi

View File

@@ -1,29 +0,0 @@
#!/usr/bin/env sh
# test all CI scripts
SCRIPT_DIR=$(dirname "$0")
TAG_VERSION=$(sh $SCRIPT_DIR/getRegistryTag.sh "v1.0.0")
TAG_TEST=$(sh $SCRIPT_DIR/getRegistryTag.sh "TEST")
BRANCH_NAME=$(sh $SCRIPT_DIR/getRegistryBranch.sh "very:first:test")
# Leaving out pushAsLatestVersion.sh as its control flow
# is based on the same condition as getRegistryTag.sh
if [ $TAG_VERSION != "1.0.0" ]; then
echo "ERROR in CI SCRIPT: $SCRIPT_DIR/getRegistryTag.sh"
return 1
fi
if [ $TAG_TEST != "TEST" ]; then
echo "ERROR in CI SCRIPT: $SCRIPT_DIR/getRegistryTag.sh"
return 2
fi
if [ $BRANCH_NAME != "test" ]; then
echo "ERROR in CI SCRIPT: $SCRIPT_DIR/getRegistryBranch.sh"
return 3
fi
return 0

View File

@@ -1,32 +0,0 @@
## Summary
(Summarize the bug encountered concisely)
## Steps to reproduce
(How one can reproduce the issue - this is very important)
## Example Project
(If possible, please create an example project here on GitLab.com that exhibits the problematic behaviour, and link to it here in the bug report)
(If you are using an older version of GitLab, this will also determine whether the bug has been fixed in a more recent version)
## What is the current bug behavior?
(What actually happens)
## What is the expected correct behavior?
(What you should see instead)
## Relevant logs and/or screenshots
(Paste any relevant logs - please use code blocks (```) to format console output,
logs, and code as it's very hard to read otherwise.)
## Possible fixes
(If you can, link to the line of code that might be responsible for the problem)
/label ~bug ~meeting

View File

@@ -1,17 +0,0 @@
## Description
(Describe the feature that you're requesting concisely)
## Explanation
(Explain why the feature is necessary)
## Mockups/Screenshots
(If possible, provide mockups or screenshots, which demonstrate the feature)
## Dependencies, issues to be resolved beforehand
(List issues or dependencies that need to be resolved before this feature can be implemented)
/label ~feature ~meeting

View File

@@ -1,17 +0,0 @@
## What needs to be changed?
??? - Describe use case!
## How is the current state not sufficient?
???
## Which changes are necessary?
???
## Do the proposed changes impact current use cases?
???
/label ~improvement ~meeting

View File

@@ -1,7 +1,7 @@
{
"name": "@openstapps/app",
"description": "The generic app tailored to fulfill needs of German universities, written using Ionic Framework.",
"version": "2.1.0",
"version": "3.0.0",
"license": "GPL-3.0-only",
"author": "Karl-Philipp Wulfert <krlwlfrt@gmail.com>",
"contributors": [
@@ -14,10 +14,10 @@
],
"scripts": {
"analyze": "webpack-bundle-analyzer www/stats.json",
"build": "ng build",
"build": "ng build --configuration=production",
"build:analyze": "npm run build:stats && npm run analyze",
"build:android": "ionic capacitor build android --no-open && cd android && ./gradlew clean assembleDebug && cd ..",
"build:prod": "ng build --configuration=production",
"build:dev": "ng build",
"build:stats": "ng build --configuration=production --stats-json",
"changelog": "conventional-changelog -p angular -i src/assets/about/CHANGELOG.md -s -r 0",
"check-icons": "ts-node scripts/check-icon-correctness.ts",
@@ -37,7 +37,7 @@
"lint:fix": "eslint --fix -c .eslintrc.json --ignore-path .eslintignore --ext .ts,.html src/",
"minify-icons": "ts-node scripts/minify-icon-font.ts",
"ng": "ng",
"postinstall": "npx jetify",
"postinstall": "jetify || echo \"skipping jetify in production mode\"",
"push": "git push && git push origin \"v$npm_package_version\"",
"resources:android": "cordova-res android --skip-config --copy",
"resources:ios": "cordova-res ios --skip-config --copy",
@@ -147,7 +147,7 @@
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-unicorn": "45.0.2",
"fontkit": "2.0.2",
"glob": "10.2.6",
"glob": "10.2.7",
"is-docker": "2.2.1",
"jasmine-core": "4.5.0",
"jasmine-spec-reporter": "7.0.0",

View File

@@ -16,7 +16,6 @@ import {Injectable} from '@angular/core';
import {Client} from '@openstapps/api';
import {SCAppConfiguration, SCIndexResponse} from '@openstapps/core';
import {NGXLogger} from 'ngx-logger';
import packageJson from '../../../../package.json';
import {environment} from '../../../environments/environment';
import {StAppsWebHttpClient} from '../data/stapps-web-http-client.provider';
import {StorageProvider} from '../storage/storage.provider';
@@ -55,7 +54,7 @@ export class ConfigProvider {
/**
* Version of the @openstapps/core package that app is using
*/
scVersion = packageJson.dependencies['@openstapps/core'];
scVersion = environment.sc_version;
/**
* First session indicator (config not found in storage)

View File

@@ -22,6 +22,7 @@ export const environment = {
app_host: 'mobile.app.uni-frankfurt.de',
custom_url_scheme: 'de.anyschool.app',
backend_version: '3.0.0',
sc_version: '1.0.1',
production: true,
};

View File

@@ -22,6 +22,7 @@ export const environment = {
app_host: 'mobile.app.uni-frankfurt.de',
custom_url_scheme: 'de.anyschool.app',
backend_version: '3.0.0',
sc_version: '1.0.1',
production: false,
};