Skip to content

Commit

Permalink
docs: deprecate keptnInit function
Browse files Browse the repository at this point in the history
Signed-off-by: Paolo Chila <[email protected]>
  • Loading branch information
pchila authored May 13, 2022
1 parent ecbd794 commit 831fc10
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions FEATURES.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ Each use case consists of multiple stories, however, a story can be part of many

### User Story 3: Create a project with shipyard

**This task is deprecated and will stop working once Keptn requires a git upstream repo when creating a project.**
It is recommended to use the Keptn CLI/API for project creation.

**Goal**: A user should be able to create a project (defined by a shipyard file) and a service.

The current implementation allows to call keptnInit with a project, service and stage, as well as a shipyard file.
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,18 @@ def keptn = new sh.keptn.Keptn()
// Initialize Keptn: "Link" it to your Jenkins Pipeline
// -------------------------------------------
// initialize keptn: will store project, service and stage in a local context file so you don't have to pass it to all other functions
//
// ⚠⚠⚠ keptn.keptnInit function is deprecated and will stop working once Keptn requires a git upstream repo when creating a project.
// It is recommended to use the Keptn CLI/API for project creation.
keptn.keptnInit project:"yourproject", service:"yourservice", stage:"yourstage"
// initialize keptn with Shipyard: if a shipyard file is passed keptnInit will also make sure this project is created in Keptn
// This allows you to automatically create a Keptn project for your Jenkins pipeline w/o having to do anything with Keptn directly
//
// ⚠⚠⚠ keptn.keptnInit function is deprecated and will stop working once Keptn requires a git upstream repo when creating a project.
// It is recommended to use the Keptn CLI/API for project creation.
keptn.keptnInit project:"yourproject", service:"yourservice", stage:"yourstage", shipyard:'shipyard.yaml'
Expand Down
3 changes: 3 additions & 0 deletions src/sh/keptn/Keptn.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ def keptnLoadFromInit(Map args) {
* Stores these values in keptn.init.json and makes sure that the Keptn project, stage and service exists
* If shipyard is specified will create the project with the passed shipyard. If the project already exists it will just return the indicator that the project exists
* If monitoring is specified, e.g: dynatrace, prometheus a configure-monitoring event is sent for this project!
*
* @deprecated This function is deprecated and will stop working once Keptn requires a git upstream repo when creating a project.
*/
@Deprecated
def keptnInit(Map args) {
String keptn_endpoint = args.containsKey("keptn_endpoint") ? args.keptn_endpoint : env.KEPTN_ENDPOINT
String keptn_bridge = args.containsKey("keptn_bridge") ? args.keptn_bridge : env.KEPTN_BRIDGE
Expand Down

0 comments on commit 831fc10

Please sign in to comment.