|
| 1 | +_schema-version: '2.1' |
| 2 | +ID: bookshop-mt |
| 3 | +version: 1.0.0 |
| 4 | +description: "Multitenant Bookshop CAP Java Project with UI" |
| 5 | +parameters: |
| 6 | + enable-parallel-deployments: true |
| 7 | +modules: |
| 8 | +# --------------------- SERVER MODULE ------------------------ |
| 9 | + - name: bookshop-mt-srv |
| 10 | +# ------------------------------------------------------------ |
| 11 | + type: java |
| 12 | + path: srv |
| 13 | + parameters: |
| 14 | + memory: 1024M |
| 15 | + disk-quota: 512M |
| 16 | + buildpack: sap_java_buildpack_jakarta |
| 17 | + properties: |
| 18 | + SPRING_PROFILES_ACTIVE: cloud,sandbox |
| 19 | + CDS_MULTITENANCY_APPUI_TENANTSEPARATOR: "-" |
| 20 | + JBP_CONFIG_COMPONENTS: "jres: ['com.sap.xs.java.buildpack.jre.SAPMachineJRE']" |
| 21 | + JBP_CONFIG_SAP_MACHINE_JRE: '{ version: 21.+ }' |
| 22 | + REPOSITORY_ID: __REPOSITORY_ID__ # Placeholder for REPOSITORY_ID |
| 23 | + INCOMING_CONNECTION_TIMEOUT: 12000000 |
| 24 | + INCOMING_REQUEST_TIMEOUT: 12000000 |
| 25 | + timeout: 12000000 |
| 26 | + build-parameters: |
| 27 | + builder: custom |
| 28 | + commands: |
| 29 | + - mvn clean package -DskipTests=true |
| 30 | + build-result: target/*-exec.jar |
| 31 | + requires: |
| 32 | + - name: bookshop-mt-service-manager |
| 33 | + - name: bookshop-mt-uaa |
| 34 | + - name: bookshop-mt-saas-registry |
| 35 | + - name: sdm |
| 36 | + - name: mtx-api |
| 37 | + properties: |
| 38 | + CDS_MULTITENANCY_SIDECAR_URL: ~{mtx-url} |
| 39 | + - name: app-api |
| 40 | + properties: |
| 41 | + CDS_MULTITENANCY_APPUI_URL: ~{app-url} |
| 42 | + - name: cf-logging |
| 43 | + provides: |
| 44 | + - name: srv-api |
| 45 | + properties: |
| 46 | + srv-url: '${default-url}' |
| 47 | +# --------------------- SIDECAR MODULE ----------------------- |
| 48 | + - name: bookshop-mt-sidecar |
| 49 | +# ------------------------------------------------------------ |
| 50 | + type: nodejs |
| 51 | + path: mtx/sidecar |
| 52 | + parameters: |
| 53 | + memory: 256M |
| 54 | + disk-quota: 1024M |
| 55 | + build-parameters: |
| 56 | + builder: custom |
| 57 | + build-result: gen |
| 58 | + commands: |
| 59 | + - npm run build |
| 60 | + requires: |
| 61 | + - name: bookshop-mt-srv |
| 62 | + requires: |
| 63 | + - name: bookshop-mt-service-manager |
| 64 | + - name: bookshop-mt-uaa |
| 65 | + - name: cf-logging |
| 66 | + - name: sdm |
| 67 | + provides: |
| 68 | + - name: mtx-api |
| 69 | + properties: |
| 70 | + mtx-url: ${default-url} |
| 71 | + hooks: |
| 72 | + - name: upgrade-all |
| 73 | + type: task |
| 74 | + phases: |
| 75 | + - blue-green.application.before-start.idle |
| 76 | + - deploy.application.before-start |
| 77 | + parameters: |
| 78 | + name: upgrade |
| 79 | + memory: 512M |
| 80 | + disk-quota: 768M |
| 81 | + command: npx -p @sap/cds-mtx cds-mtx upgrade "*" |
| 82 | +# --------------------- APPROUTER MODULE --------------------- |
| 83 | + - name: bookshop-mt-app |
| 84 | +# ------------------------------------------------------------ |
| 85 | + type: approuter.nodejs |
| 86 | + path: app |
| 87 | + |
| 88 | + parameters: |
| 89 | + memory: 256M |
| 90 | + disk-quota: 512M |
| 91 | + keep-existing-routes: true |
| 92 | + host: ${space}-1-multi-pgnaicm |
| 93 | + routes: |
| 94 | + # - route: playground-agri-com-de2-subscriber-${space}-pgcnaim.${default-domain} |
| 95 | + - route: sdm-dev-consumer-eu12-6uxoiqfk-${default-uri} |
| 96 | + - route: sdmgoogleworkspace-cpok9mi1-${default-uri} |
| 97 | + properties: |
| 98 | + TENANT_HOST_PATTERN: ^(.*)-${default-uri} # testing only, use custom domain with wildcard for production |
| 99 | + INCOMING_CONNECTION_TIMEOUT: 1200000 |
| 100 | + INCOMING_REQUEST_TIMEOUT: 1200000 |
| 101 | + timeout: 1200000 |
| 102 | + requires: |
| 103 | + - name: srv-api |
| 104 | + group: destinations |
| 105 | + properties: |
| 106 | + name: backend |
| 107 | + url: ~{srv-url} |
| 108 | + forwardAuthToken: true |
| 109 | + strictSSL: true |
| 110 | + timeout: 1200000 |
| 111 | + - name: bookshop-mt-uaa |
| 112 | + provides: |
| 113 | + - name: app-api |
| 114 | + properties: |
| 115 | + app-url: '${default-url}' |
| 116 | + app-domain: '${domain}' |
| 117 | +# --------------------- RESOURCES --------------------- |
| 118 | +resources: |
| 119 | +# ----------------------------------------------------- |
| 120 | + - name: bookshop-mt-uaa |
| 121 | + type: org.cloudfoundry.managed-service |
| 122 | + parameters: |
| 123 | + service: xsuaa |
| 124 | + service-plan: application |
| 125 | + path: ./xs-security-mt.json |
| 126 | + config: # override xsappname as it needs to be unique |
| 127 | + xsappname: bookshop-mt-${org}-${space} |
| 128 | + oauth2-configuration: |
| 129 | + credential-types: |
| 130 | + - binding-secret |
| 131 | + - x509 |
| 132 | + redirect-uris: |
| 133 | + - https://*.~{app-api/app-domain}/** |
| 134 | + requires: |
| 135 | + - name: app-api |
| 136 | + - name: bookshop-mt-service-manager |
| 137 | + type: org.cloudfoundry.managed-service |
| 138 | + parameters: |
| 139 | + service: service-manager |
| 140 | + service-plan: container |
| 141 | + - name: bookshop-mt-saas-registry |
| 142 | + type: org.cloudfoundry.managed-service |
| 143 | + parameters: |
| 144 | + service: saas-registry |
| 145 | + service-plan: application |
| 146 | + config: |
| 147 | + appName: bookshop-mt-${org}-${space} # this is the text on the tile |
| 148 | + xsappname: bookshop-mt-${org}-${space} # this is the value from xsuaa.parameters.config.xsappname |
| 149 | + appUrls: |
| 150 | + getDependencies: ~{srv-api/srv-url}/mt/v1.0/subscriptions/dependencies |
| 151 | + onSubscription: ~{srv-api/srv-url}/mt/v1.0/subscriptions/tenants/{tenantId} |
| 152 | + onSubscriptionAsync: true |
| 153 | + onUnSubscriptionAsync: true |
| 154 | + onUpdateDependenciesAsync: true |
| 155 | + callbackTimeoutMillis: 3600000 |
| 156 | + displayName: Multitenancy App ${space} |
| 157 | + description: Multitenancy App test deployed using job |
| 158 | + category: 'Category' |
| 159 | + requires: |
| 160 | + - name: srv-api |
| 161 | + - name: cf-logging |
| 162 | + type: org.cloudfoundry.managed-service |
| 163 | + parameters: |
| 164 | + service: application-logs |
| 165 | + service-plan: lite |
| 166 | + - name: sdm |
| 167 | + type: org.cloudfoundry.managed-service |
| 168 | + parameters: |
| 169 | + service: sdm |
| 170 | + service-plan: standard |
0 commit comments