Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Commit

Permalink
#1663 prepared release 0.6.2 (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
bacherfl authored May 4, 2020
1 parent 17c6026 commit c1bed43
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 16 deletions.
31 changes: 23 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,31 +31,46 @@ If you need to access several utility functions:

```go
import {
keptnutils "github.com/keptn/go-utils/pkg/utils"
"github.com/keptn/go-utils/pkg/lib"
}
```

Logging Example:
This module provides you with a convenient `Keptn` helper struct that allows you to access several resources that are relevant within the context of a
Keptn event. The helper struct can be initialized by passing a CloudEvent to the `NewKeptn` function. Example:

```go
keptnutils.Debug(keptncontext, message)
keptnutils.Info(keptncontext, message)
keptnutils.Error(keptncontext, message)
func HandleEvent(event cloudevents.Event) error {
keptnHandler, err := keptn.NewKeptn(&event, keptn.KeptnOpts{})
if err != nil {
return nil, err
}

// get the shipyard file of the project
shipyard, _ := keptnHandler.GetShipyard()

// get a resource within the current context (i.e., project, stage, service) of the event
resourceContent, _ := keptnHandler.GetKeptnResource("resource.yaml")

// send a cloud event
_ = keptnHandler.SendCloudEvent(event)
// ...
}
```

### CloudEvent Data
If you need to access data within CloudEvents:

```go
import {
keptnevents "github.com/keptn/go-utils/pkg/events"
"github.com/keptn/go-utils/pkg/lib"
)
```
Example:
```go
func parseCloudEvent(event cloudevents.Event) (keptnevents.TestFinishedEventData, error) {
eventData := &keptnevents.TestsFinishedEventData{}
eventData := &keptn.TestsFinishedEventData{}
err := event.DataAs(eventData)

return eventData, err
Expand All @@ -67,7 +82,7 @@ If you need to access Models for YAML files:
```go
import {
keptnmodels "github.com/keptn/go-utils/pkg/models"
"github.com/keptn/go-utils/pkg/lib"
)
```
Expand Down
12 changes: 12 additions & 0 deletions releasenotes/releasenotes_V0.6.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Release Notes 0.6.2

## New Features
- Added a helper function to list all projects [#1549](https://github.com/keptn/keptn/issues/1549)
- Retry to send CloudEvents in case of an error [#1279](https://github.com/keptn/keptn/issues/1279)
- Updated URLs of internal Keptn services [1589](https://github.com/keptn/keptn/issues/1589)
- Added helper functions for sending CloudEvents and retrieving service endpoints [#1079](https://github.com/keptn/keptn/issues/1079)
- Refactored and restructured the complete module [#1492](https://github.com/keptn/keptn/issues/1492)

## Fixed Issues

## Known Limitations
7 changes: 0 additions & 7 deletions releasenotes/releasenotes_develop.md

This file was deleted.

2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.6.1
0.6.2

0 comments on commit c1bed43

Please sign in to comment.