Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy TypeScript Sample app to BTP Free Tier HTML5 repo to help with #378 #414

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/ui5-ts-app/approuter/xs-app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"authenticationMethod": "route",
"routes": [
{
"source": ".*/V2(.*)",
"source": "^.*/V2(.*)",
"target": "$1",
"destination": "V2",
"authenticationType": "none",
Expand Down
92 changes: 83 additions & 9 deletions examples/ui5-ts-app/mta.yaml
Original file line number Diff line number Diff line change
@@ -1,33 +1,107 @@
ID: ui5-approuter
ID: wdi5-sample-app
_schema-version: 3.2.0
version: 1.0.0
parameters:
enable-parallel-deployments: true
build-parameters:
before-all:
- builder: custom
commands:
- npm run clean
- npm run build:ts
- npm run build:ui5
- cp -r dist approuter/webapp

modules:
- name: approuter
- name: wdi5-sample-app
type: approuter.nodejs
path: ./approuter
parameters:
disk-quota: 256M
memory: 256M
routes:
- route: wdi5-sample-app.cfapps.eu20.hana.ondemand.com
requires:
- name: html5-destination
- name: html5-uaa
- name: wdi5-sample-app-destination
- name: wdi5-sample-app-uaa
- name: wdi5-sample-app-repo-runtime

- name: test.Sample.tsapp
type: html5
path: ./
build-parameters:
build-result: dist
builder: custom
commands:
- echo "no additional step required"
supported-platforms: []

- name: wdi5-sample-app-deployer
type: com.sap.application.content
path: .
requires:
- name: wdi5-sample-app-repo-host
parameters:
content-target: true
build-parameters:
build-result: resources
requires:
- artifacts:
- test.Sample.tsapp.zip
name: test.Sample.tsapp
target-path: resources/

- name: wdi5-sample-app-destination-content
type: com.sap.application.content
requires:
- name: wdi5-sample-app-uaa
parameters:
service-key:
name: wdi5-sample-app-uaa-key
- name: wdi5-sample-app-repo-host
parameters:
service-key:
name: wdi5-sample-app-repo-host-key
- name: wdi5-sample-app-destination
parameters:
content-target: true
parameters:
content:
subaccount:
destinations:
- Name: wdi5-sample-app-repo-host
ServiceInstanceName: wdi5-sample-app-repo-host
ServiceKeyName: wdi5-sample-app-repo-host-key
sap.cloud.service: wdi5.samples
- Authentication: OAuth2UserTokenExchange
Name: wdi5-sample-app-uaa
ServiceInstanceName: wdi5-sample-app-uaa
ServiceKeyName: wdi5-sample-app-uaa-key
sap.cloud.service: wdi5.samples
existing_destinations_policy: update
build-parameters:
no-source: true

resources:
- name: html5-destination
- name: wdi5-sample-app-destination
type: org.cloudfoundry.managed-service
parameters:
service-plan: lite
service: destination
path: ./destinations.json
- name: html5-uaa
- name: wdi5-sample-app-uaa
type: org.cloudfoundry.managed-service
parameters:
service: xsuaa
service-plan: application
config:
xsappname: "ui5-approuter-uaa"
xsappname: "wdi5-sample-app"
tenant-mode: dedicated
- name: wdi5-sample-app-repo-host
type: org.cloudfoundry.managed-service
parameters:
service: html5-apps-repo
service-plan: app-host
- name: wdi5-sample-app-repo-runtime
type: org.cloudfoundry.managed-service
parameters:
service-plan: app-runtime
service: html5-apps-repo
9 changes: 5 additions & 4 deletions examples/ui5-ts-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@
"authentication:custom": "wdio run test/e2e/authentication/wdio-custom-authentication.conf.ts",
"authentication:multiRemote": "wdio run test/e2e/authentication/wdio-btp-authentication-multiremote.conf.ts",
"build:ts": "babel src --out-dir webapp --source-maps true --extensions \".ts,.js\" --copy-files",
"build:ui5": "ui5 build --clean-dest",
"build:mtar": "mv dist approuter/webapp && mbt build",
"build:ui5": "ui5 build --clean-dest --include-task=generateManifestBundle",
"clean": "rimraf dist webapp approuter/webapp",
"build:cf": "npm-run-all --sequential clean build:ts build:ui5 build:mtar"
"build:cf": "mbt build"
},
"devDependencies": {
"@babel/cli": "^7.18.10",
Expand All @@ -35,11 +34,13 @@
"mbt": "^1.2.18",
"ts-deepmerge": "^5.0.0",
"ui5-middleware-simpleproxy": "^0.9.0",
"ui5-task-zipper": "^0.6.1",
"wdio-ui5-service": "*"
},
"ui5": {
"dependencies": [
"ui5-middleware-simpleproxy"
"ui5-middleware-simpleproxy",
"ui5-task-zipper"
]
}
}
29 changes: 20 additions & 9 deletions examples/ui5-ts-app/src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"_version": "1.12.0",
"sap.cloud": {
"public": true,
"service": "wdi5.samples"
},
"sap.app": {
"id": "test.Sample.tsapp",
"type": "application",
Expand All @@ -11,15 +15,26 @@
},
"dataSources": {
"BackendDataSource": {
"uri": "/V2/Northwind/Northwind.svc/",
"uri": "V2/Northwind/Northwind.svc/",
"type": "OData",
"settings": {
"odataVersion": "2.0"
}
},
"LatestUI5Datasource": {
"uri": "",
"type": "JSON"
}
},
"crossNavigation": {
"inbounds": {
"fe-inbound": {
"signature": {
"parameters": {},
"additionalParameters": "allowed"
},
"semanticObject": "TestSampleTSapp",
"action": "display",
"title": "Sample App",
"subTitle": "TypeScript",
"icon": ""
}
}
}
},
Expand Down Expand Up @@ -69,10 +84,6 @@
"groupId": "$direct",
"synchronizationMode": "None"
}
},
"LatestUI5": {
"type": "sap.ui.model.json.JSONModel",
"dataSource": "LatestUI5Datasource"
}
},
"routing": {
Expand Down
8 changes: 8 additions & 0 deletions examples/ui5-ts-app/ui5.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,11 @@ server:
baseUri: "https://services.odata.org/V2"
strictSSL: false
debug: true
builder:
customTasks:
- name: ui5-task-zipper
afterTask: uglify
configuration:
archiveName: "test.Sample.tsapp"
additionalFiles:
- xs-app.json
37 changes: 37 additions & 0 deletions examples/ui5-ts-app/xs-app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"welcomeFile": "index.html",
"authenticationMethod": "route",
"routes": [
{
"source": "^.*/V2(.*)",
"target": "$1",
"destination": "V2",
"authenticationType": "none",
"csrfProtection": false
},
{
"source": "^.*/resources/(.*)$",
"target": "/resources/$1",
"authenticationType": "none",
"destination": "ui5"
},
{
"source": "^.*/test-resources/(.*)$",
"target": "/test-resources/$1",
"authenticationType": "none",
"destination": "ui5"
},
{
"source": "^index.html$",
"service": "html5-apps-repo-rt",
"authenticationType": "xsuaa",
"cacheControl": "no-cache, no-store, must-revalidate"
},
{
"source": "^(.*)$",
"target": "$1",
"service": "html5-apps-repo-rt",
"authenticationType": "xsuaa"
}
]
}
Loading