Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/unic/sapcc-toolkit


https://github.com/unic/sapcc-toolkit

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

        

# SAP Commerce Cloud Toolkit

![CI status](https://github.com/unic/sapcc-toolkit/actions/workflows/ci.yaml/badge.svg) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=unic_sapcc-toolkit&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=unic_sapcc-toolkit)

This CLI toolkit provides functionalities to create and monitor builds and deployments within the SAP Commerce Cloud.

## Setup

To set up your SAP CC CLI Toolkit please provide your:

- SAP Commerce Cloud Subscription Code*
- SAP Commerce Cloud API token/key*
- Define a maximum waiting time in minutes for builds (default: 30min)
- Define a maximum waiting time in minutes for deployments (default: 30min)
- Define polling/interval rate in seconds for builds (default: 5sec)
- Define polling/interval rate in seconds for deployments (default: 5sec)
- Enable notification service for MS Teams webhook (default: false)
- Define MS Teams webhook URL (default: empty)

*mandatory

using the file: `/config/application.properties`

```properties
toolkit.subscriptionCode =
toolkit.apiKey =

toolkit.build.maxWaitTime =
toolkit.build.sleepTime =

toolkit.deploy.maxWaitTime =
toolkit.deploy.sleepTime=

toolkit.apiConnectTimeout =
toolkit.apiReadTimeout =

notification.teams.enabled = true/false
notification.teams.webhook.url =
```

## Building

Please use the default Spring boot gradle tasks to build this application:

```shell
./gradlew bootJar
```

## Usage

You can list all current flags and parameters by running the jar with the --help flag:

```shell
java -jar build/libs/sapcc-toolkit-*.jar --help

[...]

usage: sapcc-toolkit
-a,--applicationcode application code
-b,--build Execute build
-c,--buildcode Code of build to deploy
-d,--deploy Execute deployment
-e,--environment environment for deployment
-h,--help print usage help
-n,--name build name
-p,--pidfile process id file
-r,--branch branch to be build
-s,--strategy deployment strategy
-u,--updatemode database update mode for deployment
-y,--async Don't monitor progress
-t,--skipBuildTimeouts Skip build timeouts during build progress monitoring
```

## Examples

### Create a new build of the develop branch (without deployment)

```shell
java -jar build/libs/sapcc-toolkit-*.jar --build
```

### Create a new build of the develop branch but don't wait for it to finish

```shell
java -jar build/libs/sapcc-toolkit-*.jar --build --async
```

### Create a new release build without deployment

```shell
java -jar build/libs/sapcc-toolkit-*.jar --build --branch release/1.6.0 --name release-1.6.0
```

### Create a new develop (default) build and deploy this newly build on d1 without URS

```shell
java -jar build/libs/sapcc-toolkit-*.jar --build --deploy
```

### Create a new develop (default) build and deploy this newly build on d1 without URS and skip build timeouts

```shell
java -jar build/libs/sapcc-toolkit-*.jar --build --deploy --skipBuildTimeouts
```

### Start a new rolling deployment for a given build on d1 without URS

```shell
java -jar build/libs/sapcc-toolkit-*.jar --deploy --buildcode 20211122.1
```

### Start a new rolling deployment for a given build on s1 with URS

```shell
java -jar build/libs/sapcc-toolkit-*.jar --deploy --buildcode 20211122.1 --updatemode UPDATE --environment s1
```

## Publication

## Docker image

A docker image is being build for each build on the main branch. Use it like this:

```shell
docker run -it --rm -v $PWD/config:/config lennartjuetteunic/sapcc-toolkit --build
```

### Maven (Unic internal)

For publishing artifacts we use the [maven-publish](https://docs.gradle.org/current/userguide/publishing_maven.html) plugin. Since the Unic nexus repository is defined unter the name 'unicEcom' you need to set the variables `unicEcomUsername` and `unicEcomPassword`. This can be done in your `~/.gradle/gradle.properties` for example.

```shell
./gradlew publish
```