Skip to content

Commit 0e4ed8e

Browse files
authored
chore(plugins): enable smtp and dependency-track (#251)
Signed-off-by: Miguel Martinez Trivino <[email protected]>
1 parent fc76074 commit 0e4ed8e

File tree

7 files changed

+101
-0
lines changed

7 files changed

+101
-0
lines changed

Diff for: .goreleaser.yml

+18
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,22 @@ builds:
5050
hooks:
5151
post:
5252
- upx "{{ .Path }}"
53+
- binary: chainloop-plugin-smtp
54+
id: chainloop-plugin-smtp
55+
main: ./app/controlplane/plugins/core/smtp/v1/cmd
56+
targets:
57+
- linux_amd64
58+
hooks:
59+
post:
60+
- upx "{{ .Path }}"
61+
- binary: chainloop-plugin-dependency-track
62+
id: chainloop-plugin-dependency-track
63+
main: ./app/controlplane/plugins/core/dependency-track/v1/cmd
64+
targets:
65+
- linux_amd64
66+
hooks:
67+
post:
68+
- upx "{{ .Path }}"
5369
archives:
5470
- builds:
5571
- cli
@@ -85,6 +101,8 @@ dockers:
85101
ids:
86102
- control-plane
87103
- chainloop-plugin-discord-webhook
104+
- chainloop-plugin-smtp
105+
- chainloop-plugin-dependency-track
88106
image_templates:
89107
- "ghcr.io/chainloop-dev/chainloop/control-plane:{{ .Tag }}"
90108
- "ghcr.io/chainloop-dev/chainloop/control-plane:latest"

Diff for: app/controlplane/Dockerfile.goreleaser

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ COPY ./control-plane /
99
# NOTE: they are built by go-releaser in the builds section
1010
# Make sure to update it acordingly if you add more plugins
1111
COPY ./chainloop-plugin-discord-webhook /plugins/
12+
COPY ./chainloop-plugin-dependency-track /plugins/
13+
COPY ./chainloop-plugin-smtp /plugins/
1214
# tmp is required for the plugins to run
1315
COPY --from=builder /tmp /tmp
1416

Diff for: app/controlplane/plugins/core/Makefile

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Find plugins subdirectories that have a makefile
2+
SUBDIRS := $(patsubst %Makefile,%,$(wildcard */v1/Makefile))
3+
4+
TARGETS := build
5+
6+
.SECONDEXPANSION:
7+
8+
$(TARGETS): %: subdirs
9+
10+
subdirs: $(SUBDIRS)
11+
12+
$(SUBDIRS):
13+
$(MAKE) -C $@ $(MAKECMDGOALS)
14+
15+
.PHONY: subdirs $(SUBDIRS) $(TARGETS)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
MKFILE_PATH := $(lastword $(MAKEFILE_LIST))
2+
include ../../common.mk
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Copyright 2023 The Chainloop Authors.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
package main
16+
17+
import (
18+
"log"
19+
20+
dependencytrack "github.com/chainloop-dev/chainloop/app/controlplane/plugins/core/dependency-track/v1"
21+
"github.com/chainloop-dev/chainloop/app/controlplane/plugins/sdk/v1/plugin"
22+
)
23+
24+
// Plugin entrypoint
25+
func main() {
26+
if err := plugin.Serve(&plugin.ServeOpts{
27+
Factory: dependencytrack.New,
28+
}); err != nil {
29+
log.Fatal(err)
30+
}
31+
}

Diff for: app/controlplane/plugins/core/smtp/v1/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
MKFILE_PATH := $(lastword $(MAKEFILE_LIST))
2+
include ../../common.mk

Diff for: app/controlplane/plugins/core/smtp/v1/cmd/main.go

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Copyright 2023 The Chainloop Authors.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
package main
16+
17+
import (
18+
"log"
19+
20+
"github.com/chainloop-dev/chainloop/app/controlplane/plugins/core/smtp/v1"
21+
"github.com/chainloop-dev/chainloop/app/controlplane/plugins/sdk/v1/plugin"
22+
)
23+
24+
// Plugin entrypoint
25+
func main() {
26+
if err := plugin.Serve(&plugin.ServeOpts{
27+
Factory: smtp.New,
28+
}); err != nil {
29+
log.Fatal(err)
30+
}
31+
}

0 commit comments

Comments
 (0)