1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-07-15 01:34:38 +02:00

Invalidate cache for neo deployments (#2209)

* Add additional parameters for invalidating cache

* Fetch bearer token

* Fetch x-csrf token

* Add echo for testing

* Add echo

* Add another echo

* Check status

* Debug

* Clean up

* Throw exception

* Code review changes

* Review changes

* Add test

* Fix tests

* Fetch bearer token

* Fetch x-csrf token

* Add echo for testing

* Add echo

* Add another echo

* Check status

* Debug

* Resolve conflicts

* Resolve conflicts

* Code review changes

* Review changes

* fix conflicts

* Fix indent

* Add new parameter to define portal landscape region

* Add default value for new param

* Fix test

* Remove example

Co-authored-by: Oliver Feldmann <oliver.feldmann@sap.com>

* Check cache invalidation for html5 apps

* Add nesting

Co-authored-by: Oliver Feldmann <oliver.feldmann@sap.com>

* Add docu for invalidating cache for html5 apps (#2306)

* Add docu for invalidating cache for html5 apps

* Improve content

* Docu review changes

* Remove heading

Co-authored-by: Sarah Lendle <44202907+SarahLendle@users.noreply.github.com>

* Update documentation/docs/steps/neoDeploy.md

Co-authored-by: Sarah Lendle <44202907+SarahLendle@users.noreply.github.com>

Co-authored-by: Sarah Lendle <44202907+SarahLendle@users.noreply.github.com>

Co-authored-by: Oliver Feldmann <oliver.feldmann@sap.com>
Co-authored-by: Sarah Lendle <44202907+SarahLendle@users.noreply.github.com>
This commit is contained in:
Srinikitha Kondreddy
2020-11-09 12:15:00 +01:00
committed by GitHub
parent e859ed3375
commit 0234e4908c
7 changed files with 185 additions and 5 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -54,3 +54,46 @@ steps:
account: <myDeployAccount>
host: hana.example.org
```
## Example for invalidating the cache
Set the parameter `invalidateCache` to `true` to clean up the cache of an SAP Fiori launchpad site by refreshing the content of HTML5 applications deployed in it.
**Note:** This section is only applicable for HTML5 applications accessed through an SAP Fiori launchpad site.
Setting this parameter to `true` requires additional configuration:
### Create an OAuth credential
1. In your subaccount, choose **OAuth**.
![OAuth client creation](../images/oauthClientCreation.png)
2. In the **Subscription** field, select the portal landscape to which you would like to subscribe, for example, `portal/nwc` or `portal/sandbox`.
![Portal subscription](../images/portalSubscription.png)
3. From the drop-down menu in the **Authorization Grant** field, choose **Client Credentials**.
4. In the **Secret** field, enter a user-defined password and save your changes.
5. In Jenkins, create new username/password credentials. As username, use the client ID and as password, use the client secret.
### Configure the site ID
When you're logged in to the portal service, you can retrieve the site ID. Either configure it in your configuration file or set the site as default through the **Site Directory** tile.
If you don't set it as default, configure the parameter `siteId` as follows in your configuration file:
```yaml
steps:
<...>
neoDeploy:
neo:
account: <myDeployAccount>
host: hana.example.org
credentialsId: 'my-credentials-id'
invalidateCache: true
portalLandscape: "cloudnwcportal"
oauthCredentialId: <OAUTH_CREDENTIAL_ID>
siteId: <PORTAL_SITE_ID> # not required, if the default site is already set in the portal service (SAP Cloud Platform)
```