Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ help: ## Display this help.
build: fmt vet ## Build dtm & plugins locally.
go mod tidy
mkdir -p .devstream
go build -buildmode=plugin -trimpath -gcflags="all=-N -l" -o .devstream/githubactions-${GOOS}-${GOARCH}_${VERSION}.so ./cmd/githubactions/
go build -buildmode=plugin -trimpath -gcflags="all=-N -l" -o .devstream/githubactions-golang-${GOOS}-${GOARCH}_${VERSION}.so ./cmd/githubactions/golang
go build -buildmode=plugin -trimpath -gcflags="all=-N -l" -o .devstream/githubactions-python-${GOOS}-${GOARCH}_${VERSION}.so ./cmd/githubactions/python
go build -buildmode=plugin -trimpath -gcflags="all=-N -l" -o .devstream/githubactions-nodejs-${GOOS}-${GOARCH}_${VERSION}.so ./cmd/githubactions/nodejs
go build -buildmode=plugin -trimpath -gcflags="all=-N -l" -o .devstream/trello-github-integ-${GOOS}-${GOARCH}_${VERSION}.so ./cmd/trellogithub/
go build -buildmode=plugin -trimpath -gcflags="all=-N -l" -o .devstream/argocd-${GOOS}-${GOARCH}_${VERSION}.so ./cmd/argocd/
go build -buildmode=plugin -trimpath -gcflags="all=-N -l" -o .devstream/argocdapp-${GOOS}-${GOARCH}_${VERSION}.so ./cmd/argocdapp/
Expand Down
4 changes: 3 additions & 1 deletion build/package/build_linux_amd64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ export GOOS=linux
export GOARCH=amd64
export VERSION
go build -trimpath -gcflags="all=-N -l" -o output/dtm-${GOOS}-${GOARCH} ./cmd/devstream/
go build -buildmode=plugin -trimpath -gcflags="all=-N -l" -o output/githubactions-${GOOS}-${GOARCH}_${VERSION}.so ./cmd/githubactions/
go build -buildmode=plugin -trimpath -gcflags="all=-N -l" -o output/githubactions-golang-${GOOS}-${GOARCH}_${VERSION}.so ./cmd/githubactions/golang
go build -buildmode=plugin -trimpath -gcflags="all=-N -l" -o output/githubactions-python-${GOOS}-${GOARCH}_${VERSION}.so ./cmd/githubactions/python
go build -buildmode=plugin -trimpath -gcflags="all=-N -l" -o output/githubactions-nodejs-${GOOS}-${GOARCH}_${VERSION}.so ./cmd/githubactions/nodejs
go build -buildmode=plugin -trimpath -gcflags="all=-N -l" -o output/trello-github-integ-${GOOS}-${GOARCH}_${VERSION}.so ./cmd/trellogithub/
go build -buildmode=plugin -trimpath -gcflags="all=-N -l" -o output/argocd-${GOOS}-${GOARCH}_${VERSION}.so ./cmd/argocd/
go build -buildmode=plugin -trimpath -gcflags="all=-N -l" -o output/argocdapp-${GOOS}-${GOARCH}_${VERSION}.so ./cmd/argocdapp/
Expand Down
12 changes: 6 additions & 6 deletions cmd/githubactions/main.go → cmd/githubactions/golang/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,33 @@ package main

import (
"github.com/merico-dev/stream/internal/pkg/log"
"github.com/merico-dev/stream/internal/pkg/plugin/githubactions"
"github.com/merico-dev/stream/internal/pkg/plugin/githubactions/golang"
)

// NAME is the name of this DevStream plugin.
const NAME = "githubactions"
const NAME = "githubactions-golang"

// Plugin is the type used by DevStream core. It's a string.
type Plugin string

// Install implements the installation of some GitHub Actions workflows.
func (p Plugin) Install(options *map[string]interface{}) (bool, error) {
return githubactions.Install(options)
return golang.Install(options)
}

// Reinstall implements the installation of some GitHub Actions workflows.
func (p Plugin) Reinstall(options *map[string]interface{}) (bool, error) {
return githubactions.Reinstall(options)
return golang.Reinstall(options)
}

// Uninstall implements the installation of some GitHub Actions workflows.
func (p Plugin) Uninstall(options *map[string]interface{}) (bool, error) {
return githubactions.Uninstall(options)
return golang.Uninstall(options)
}

// IsHealthy implements the healthy check of GitHub Actions workflows.
func (p Plugin) IsHealthy(options *map[string]interface{}) (bool, error) {
return githubactions.IsHealthy(options)
return golang.IsHealthy(options)
}

// DevStreamPlugin is the exported variable used by the DevStream core.
Expand Down
39 changes: 39 additions & 0 deletions cmd/githubactions/nodejs/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package main

import (
"github.com/merico-dev/stream/internal/pkg/log"
"github.com/merico-dev/stream/internal/pkg/plugin/githubactions/nodejs"
)

// NAME is the name of this DevStream plugin.
const NAME = "githubactions-nodejs"

// Plugin is the type used by DevStream core. It's a string.
type Plugin string

// Install implements the installation of some GitHub Actions workflows.
func (p Plugin) Install(options *map[string]interface{}) (bool, error) {
return nodejs.Install(options)
}

// Reinstall implements the installation of some GitHub Actions workflows.
func (p Plugin) Reinstall(options *map[string]interface{}) (bool, error) {
return nodejs.Reinstall(options)
}

// Uninstall implements the installation of some GitHub Actions workflows.
func (p Plugin) Uninstall(options *map[string]interface{}) (bool, error) {
return nodejs.Uninstall(options)
}

// IsHealthy implements the healthy check of GitHub Actions workflows.
func (p Plugin) IsHealthy(options *map[string]interface{}) (bool, error) {
return nodejs.IsHealthy(options)
}

// DevStreamPlugin is the exported variable used by the DevStream core.
var DevStreamPlugin Plugin

func main() {
log.Infof("%T: %s is a plugin for DevStream. Use it with DevStream.\n", NAME, DevStreamPlugin)
}
39 changes: 39 additions & 0 deletions cmd/githubactions/python/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package main

import (
"github.com/merico-dev/stream/internal/pkg/log"
"github.com/merico-dev/stream/internal/pkg/plugin/githubactions/python"
)

// NAME is the name of this DevStream plugin.
const NAME = "githubactions-python"

// Plugin is the type used by DevStream core. It's a string.
type Plugin string

// Install implements the installation of some GitHub Actions workflows.
func (p Plugin) Install(options *map[string]interface{}) (bool, error) {
return python.Install(options)
}

// Reinstall implements the installation of some GitHub Actions workflows.
func (p Plugin) Reinstall(options *map[string]interface{}) (bool, error) {
return python.Reinstall(options)
}

// Uninstall implements the installation of some GitHub Actions workflows.
func (p Plugin) Uninstall(options *map[string]interface{}) (bool, error) {
return python.Uninstall(options)
}

// IsHealthy implements the healthy check of GitHub Actions workflows.
func (p Plugin) IsHealthy(options *map[string]interface{}) (bool, error) {
return python.IsHealthy(options)
}

// DevStreamPlugin is the exported variable used by the DevStream core.
var DevStreamPlugin Plugin

func main() {
log.Infof("%T: %s is a plugin for DevStream. Use it with DevStream.\n", NAME, DevStreamPlugin)
}
2 changes: 1 addition & 1 deletion examples/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ tools:
image_repo: ironcore864/golang-demo
- name: golang-demo-app
plugin:
kind: githubactions
kind: githubactions-golang
version: 0.0.2
options:
owner: ironcore864
Expand Down
7 changes: 7 additions & 0 deletions internal/pkg/plugin/githubactions/common.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package githubactions

import "fmt"

func GetLanguage(l *Language) string {
return fmt.Sprintf("%s-%s", l.Name, l.Version)
}
Loading