Skip to content

Commit

Permalink
Merge main into renovate/rollup
Browse files Browse the repository at this point in the history
  • Loading branch information
cultureamp-renovate[bot] authored Dec 20, 2024
2 parents b9ff7fe + 871ed33 commit 2378d9d
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ COPY . ./
# build as a static binary without debug symbols
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \
-ldflags='-w -s -extldflags "-static"' -a \
-o /dist/examplego .
-o /dist/example-go-buildkite-plugin .

# runtime image using static distroless base
# using static nonroot image
# user:group is nobody:nobody, uid:gid = 65534:65534
FROM ${DISTROLESS_IMAGE}

COPY --from=builder /dist/examplego /examplego
COPY --from=builder /dist/example-go-buildkite-plugin /example-go-buildkite-plugin

ENTRYPOINT ["/examplego"]
ENTRYPOINT ["/example-go-buildkite-plugin"]
2 changes: 1 addition & 1 deletion src/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/cultureamp/examplego
module github.com/cultureamp/example-go-buildkite-plugin

go 1.23.2

Expand Down
4 changes: 2 additions & 2 deletions src/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"
"os"

"github.com/cultureamp/examplego/buildkite"
"github.com/cultureamp/examplego/plugin"
"github.com/cultureamp/example-go-buildkite-plugin/buildkite"
"github.com/cultureamp/example-go-buildkite-plugin/plugin"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion src/plugin/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"os"
"testing"

"github.com/cultureamp/examplego/plugin"
"github.com/cultureamp/example-go-buildkite-plugin/plugin"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down
9 changes: 4 additions & 5 deletions src/plugin/example.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ package plugin

import (
"context"
"fmt"

"github.com/cultureamp/examplego/buildkite"
"github.com/cultureamp/example-go-buildkite-plugin/buildkite"
)

type ExamplePlugin struct {
Expand All @@ -21,17 +22,15 @@ func (ep ExamplePlugin) Run(ctx context.Context, fetcher ConfigFetcher, agent Ag
var config Config
err := fetcher.Fetch(&config)
if err != nil {
buildkite.LogFailuref("plugin configuration error: %s\n", err.Error())
return err
return fmt.Errorf("plugin configuration error: %w", err)
}
annotation := config.Message

buildkite.Logf("Annotating with message: %s\n", annotation)

err = agent.Annotate(ctx, annotation, "info", "message")
if err != nil {
buildkite.LogFailuref("buildkite annotation error: %s\n", err.Error())
return err
return fmt.Errorf("buildkite annotation error: %w", err)
}

buildkite.Log("done.")
Expand Down
2 changes: 1 addition & 1 deletion src/plugin/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"testing"

"github.com/cultureamp/examplego/plugin"
"github.com/cultureamp/example-go-buildkite-plugin/plugin"
"github.com/stretchr/testify/assert"
)

Expand Down

0 comments on commit 2378d9d

Please sign in to comment.