Compare commits

..

No commits in common. "ac4aabede461af7843872e9cadf0716ae82eae2c" and "97d362e5be0b5d349c8c6152d572d51501b95a38" have entirely different histories.

34 changed files with 125 additions and 126 deletions

View File

@ -1,14 +1,14 @@
<p align="center"> <p align="center">
<image src="https://git.front.kjuulh.io/kjuulh/octopush/raw/branch/v0.2/assets/octopush.svg" width="300" height="300"/> <image src="https://git.front.kjuulh.io/kjuulh/kraken/raw/branch/v0.2/assets/kraken.svg" width="300" height="300"/>
</p> </p>
<h1 align="center">Octopush - Your cute action executor</h1> <h1 align="center">Kraken - Your cute action executor</h1>
## Purpose ## Purpose
The goal of this project is to easily do batch changes or queries on a host of The goal of this project is to easily do batch changes or queries on a host of
repositories. In large organisations using multi-repository strategies, it may repositories. In large organisations using multi-repository strategies, it may
be painful to change even small things across many repositories, because there be painful to change even small things across many repositories, because there
are so many of them. Octopush aims to change that. are so many of them. Kraken aims to change that.
**DISCLAIMER:** It is still early days, and the api is subject to change. **DISCLAIMER:** It is still early days, and the api is subject to change.
@ -34,36 +34,36 @@ Refer to [roadmap.md](roadmap.md)
## Installation ## Installation
Octopush comes in two modes. Client or Client -> Server. Octopush can stand alone as Kraken comes in two modes. Client or Client -> Server. Kraken can stand alone as
a client, for smaller and less secure changes. However, for organisations, it a client, for smaller and less secure changes. However, for organisations, it
may be useful to use Octopush in server mode, which supports more features, and may be useful to use Kraken in server mode, which supports more features, and
has extra security built in. has extra security built in.
### Client (CLI) ### Client (CLI)
Download executable from [releases](https://github.com/kjuulh/octopush/releases) Download executable from [releases](https://github.com/kjuulh/kraken/releases)
#### Or Use docker image #### Or Use docker image
```bash ```bash
docker run --rm kasperhermansen/octopushcli:latest version docker run --rm kasperhermansen/krakencli:latest version
``` ```
#### Or Build from source #### Or Build from source
```bash ```bash
git clone https://github.com/kjuulh/octopush.git git clone https://github.com/kjuulh/kraken.git
cd octopush cd kraken
go build cmd/octopush/octopush.go go build cmd/kraken/kraken.go
./octopush version ./kraken version
``` ```
#### Or Build with cuddle #### Or Build with cuddle
```bash ```bash
git clone https://github.com/kjuulh/octopush.git git clone https://github.com/kjuulh/kraken.git
cd octopush cd kraken
cuddle_cli x build_cli cuddle_cli x build_cli
``` ```
@ -73,15 +73,15 @@ cuddle_cli x build_cli
We prefer to run the server directly as a docker image. We prefer to run the server directly as a docker image.
```bash ```bash
docker pull kasperhermansen/octopushserver:latest docker pull kasperhermansen/krakenserver:latest
docker run -p 9090:80 --rm kasperhermansen/octopushserver:latest docker run -p 9090:80 --rm kasperhermansen/krakenserver:latest
``` ```
#### Or Build from source #### Or Build from source
```bash ```bash
git clone https://github.com/kjuulh/octopush.git git clone https://github.com/kjuulh/kraken.git
cd octopush cd kraken
go build cmd/server/server.go go build cmd/server/server.go
./server version ./server version
@ -90,8 +90,8 @@ go build cmd/server/server.go
#### Or Build with cuddle #### Or Build with cuddle
```bash ```bash
git clone https://github.com/kjuulh/octopush.git git clone https://github.com/kjuulh/kraken.git
cd octopush cd kraken
cuddle_cli x build_server cuddle_cli x build_server
``` ```
@ -106,10 +106,10 @@ I will focus on the client here, as the server provides the same features,
though available through the cli, but instead as configuration options (see though available through the cli, but instead as configuration options (see
[CONFIGURATION_SERVER.md](CONFIGURATION_SERVER.md)) [CONFIGURATION_SERVER.md](CONFIGURATION_SERVER.md))
Octopush ships with autocomplete built in (courtesy of spf13/cobra). To add: Kraken ships with autocomplete built in (courtesy of spf13/cobra). To add:
- Bash: `echo 'source <(octopush completion bash)' >> ~/.bashrc` - Bash: `echo 'source <(kraken completion bash)' >> ~/.bashrc`
- Zsh: `echo 'source <(octopush completion zsh)' >> ~/.zshrc` - Zsh: `echo 'source <(kraken completion zsh)' >> ~/.zshrc`
### Creating a new action ### Creating a new action
@ -118,11 +118,11 @@ Creating a new action
```bash ```bash
git init my-actions # should only be done once git init my-actions # should only be done once
cd my-actions cd my-actions
octopush tmpl init write-a-readme --command kraken tmpl init write-a-readme --command
cat write-a-readme/octopush.yml cat write-a-readme/kraken.yml
# Output # Output
# apiVersion: git.front.kjuulh.io/kjuulh/octopush/blob/main/schema/v1 # apiVersion: git.front.kjuulh.io/kjuulh/kraken/blob/main/schema/v1
# name: write-a-readme # name: write-a-readme
# select: # select:
# repositories: [] # repositories: []
@ -131,7 +131,7 @@ cat write-a-readme/octopush.yml
# entry: "main.sh" # entry: "main.sh"
``` ```
Octopush also ships with yaml schema, which should help write the yaml Kraken also ships with yaml schema, which should help write the yaml
configuration. configuration.
#### Add upstream repositories (victims) #### Add upstream repositories (victims)
@ -139,8 +139,8 @@ configuration.
Now add a preferred repository Now add a preferred repository
``` ```
cat << EOF > write-a-readme/octopush.yml cat << EOF > write-a-readme/kraken.yml
apiVersion: git.front.kjuulh.io/kjuulh/octopush/blob/main/schema/v1 apiVersion: git.front.kjuulh.io/kjuulh/kraken/blob/main/schema/v1
name: write-a-readme name: write-a-readme
select: select:
providers: # new providers: # new
@ -158,13 +158,13 @@ on.
Another could be to use Another could be to use
```bash ```bash
cat << EOF > write-a-readme/octopush.yml cat << EOF > write-a-readme/kraken.yml
apiVersion: git.front.kjuulh.io/kjuulh/octopush/blob/main/schema/v1 apiVersion: git.front.kjuulh.io/kjuulh/kraken/blob/main/schema/v1
name: write-a-readme name: write-a-readme
select: select:
repositories: #new repositories: #new
- git@git.front.kjuulh.io:kjuulh/octopush.git #new - git@git.front.kjuulh.io:kjuulh/kraken.git #new
- git@git.front.kjuulh.io:kjuulh/octopush-test.git #new - git@git.front.kjuulh.io:kjuulh/kraken-test.git #new
actions: actions:
- type: shell - type: shell
entry: "main.sh" entry: "main.sh"
@ -179,24 +179,24 @@ for a shared effect.
To run the script use To run the script use
```bash ```bash
octopush process --path "write-a-readme" kraken process --path "write-a-readme"
``` ```
This will cause the octopush process to automatically apply the action on the repo This will cause the kraken process to automatically apply the action on the repo
and open a pr. and open a pr.
### Query repositories ### Query repositories
Octopush can also be used to query. Kraken can also be used to query.
```bash ```bash
cat << EOF > write-a-readme/octopush.yml cat << EOF > write-a-readme/kraken.yml
apiVersion: git.front.kjuulh.io/kjuulh/octopush/blob/main/schema/v1 apiVersion: git.front.kjuulh.io/kjuulh/kraken/blob/main/schema/v1
name: write-a-readme name: write-a-readme
select: select:
repositories: repositories:
- git@git.front.kjuulh.io:kjuulh/octopush.git - git@git.front.kjuulh.io:kjuulh/kraken.git
- git@git.front.kjuulh.io:kjuulh/octopush-test.git - git@git.front.kjuulh.io:kjuulh/kraken-test.git
queries: queries:
- type: grep - type: grep
query: "# README" query: "# README"
@ -210,10 +210,10 @@ tools.
Do note: All actions will be run as dry-run unless `--apply` is added. This is Do note: All actions will be run as dry-run unless `--apply` is added. This is
to help test locally, as well as not cause serious issues. The server to help test locally, as well as not cause serious issues. The server
configuration is pretty much the same, except the command would look like so: configuration is pretty much the same, except the command would look like so:
`octopush server process --path "write-a-readme" --apply`. Octopush will try to `kraken server process --path "write-a-readme" --apply`. Kraken will try to
infer as much as possible, but it may be needed to apply some extra flags to infer as much as possible, but it may be needed to apply some extra flags to
specify upstream repositories and such. Octopush will also help you setup keys and specify upstream repositories and such. Kraken will also help you setup keys and
such on the first run, using `octopush setup` or `octopush server setup`. such on the first run, using `kraken setup` or `kraken server setup`.
## Contributing ## Contributing
@ -223,7 +223,7 @@ are welcome, though they are at your own risk.
### Bugs & features requests ### Bugs & features requests
Please use [issues](https://github.com/kjuulh/octopush/issues) Please use [issues](https://github.com/kjuulh/kraken/issues)
### Development ### Development
@ -234,7 +234,7 @@ outside core maintainers.
Simply: Simply:
```bash ```bash
go run cmd/octopush/octopush.go # CLI go run cmd/kraken/kraken.go # CLI
go run cmd/server/server.go # Server go run cmd/server/server.go # Server
``` ```

View File

@ -1,9 +1,9 @@
apiVersion: git.front.kjuulh.io/kjuulh/octopush/blob/main/schema/v1 apiVersion: git.front.kjuulh.io/kjuulh/kraken/blob/main/schema/v1
name: write-a-readme name: write-a-readme
select: select:
repositories: repositories:
- git@git.front.kjuulh.io:kjuulh/octopush-test.git - git@git.front.kjuulh.io:kjuulh/kraken-test.git
- git@git.front.kjuulh.io:kjuulh/octopush.git - git@git.front.kjuulh.io:kjuulh/kraken.git
# providers: # providers:
# - gitea: https://git.front.kjuulh.io # - gitea: https://git.front.kjuulh.io
# organisation: "cibus" # organisation: "cibus"

View File

@ -1,6 +1,6 @@
FROM debian:bullseye-slim FROM debian:bullseye-slim
# Octopush relies on this path being the specified path # Kraken relies on this path being the specified path
WORKDIR /src/work/ WORKDIR /src/work/
COPY entry.sh /src/script.sh COPY entry.sh /src/script.sh

View File

@ -1,8 +1,8 @@
apiVersion: git.front.kjuulh.io/kjuulh/octopush/blob/main/schema/v1 apiVersion: git.front.kjuulh.io/kjuulh/kraken/blob/main/schema/v1
name: write-a-readme name: write-a-readme
select: select:
repositories: repositories:
- git@git.front.kjuulh.io:kjuulh/octopush-test.git - git@git.front.kjuulh.io:kjuulh/kraken-test.git
# providers: # providers:
# - gitea: https://git.front.kjuulh.io # - gitea: https://git.front.kjuulh.io
# organisation: "cibus" # organisation: "cibus"

View File

@ -1,8 +1,8 @@
apiVersion: git.front.kjuulh.io/kjuulh/octopush/blob/main/schema/v1 apiVersion: git.front.kjuulh.io/kjuulh/kraken/blob/main/schema/v1
name: write-a-readme name: write-a-readme
select: select:
repositories: repositories:
- git@git.front.kjuulh.io:kjuulh/octopush-test.git - git@git.front.kjuulh.io:kjuulh/kraken-test.git
# providers: # providers:
# - gitea: https://git.front.kjuulh.io # - gitea: https://git.front.kjuulh.io
# organisation: "cibus" # organisation: "cibus"

View File

@ -1,4 +1,4 @@
apiVersion: git.front.kjuulh.io/kjuulh/octopush/blob/main/schema/v1 apiVersion: git.front.kjuulh.io/kjuulh/kraken/blob/main/schema/v1
name: write-a-readme name: write-a-readme
select: select:
providers: providers:

View File

@ -1,8 +1,8 @@
apiVersion: git.front.kjuulh.io/kjuulh/octopush/blob/main/schema/v1 apiVersion: git.front.kjuulh.io/kjuulh/kraken/blob/main/schema/v1
name: write-a-readme name: write-a-readme
select: select:
repositories: repositories:
- git@git.front.kjuulh.io:kjuulh/octopush-test.git - git@git.front.kjuulh.io:kjuulh/kraken-test.git
# providers: # providers:
# - gitea: https://git.front.kjuulh.io # - gitea: https://git.front.kjuulh.io
# organisation: "cibus" # organisation: "cibus"

View File

@ -8,7 +8,7 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
func CreateOctopushProcessCmd() *cobra.Command { func CreateKrakenProcessCmd() *cobra.Command {
var ( var (
actionsRepo string actionsRepo string

View File

@ -2,13 +2,13 @@ package commands
import "github.com/spf13/cobra" import "github.com/spf13/cobra"
func CreateOctopushCmd() *cobra.Command { func CreateKrakenCmd() *cobra.Command {
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "octopush", Use: "kraken",
// Run: func(cmd *cobra.Command, args []string) { }, // Run: func(cmd *cobra.Command, args []string) { },
} }
cmd.AddCommand(CreateOctopushProcessCmd()) cmd.AddCommand(CreateKrakenProcessCmd())
return cmd return cmd
} }

View File

@ -3,7 +3,7 @@ package main
import ( import (
"os" "os"
"git.front.kjuulh.io/kjuulh/octopush/cmd/octopush/commands" "git.front.kjuulh.io/kjuulh/kraken/cmd/kraken/commands"
) )
func main() { func main() {
@ -11,7 +11,7 @@ func main() {
} }
func Execute() { func Execute() {
err := commands.CreateOctopushCmd().Execute() err := commands.CreateKrakenCmd().Execute()
if err != nil { if err != nil {
os.Exit(1) os.Exit(1)
} }

View File

@ -7,7 +7,7 @@ import (
func CreateServerCmd(logger *zap.Logger) *cobra.Command { func CreateServerCmd(logger *zap.Logger) *cobra.Command {
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "octopushserver", Use: "krakenserver",
} }
cmd.AddCommand(NewStartServerCommand(logger)) cmd.AddCommand(NewStartServerCommand(logger))

View File

@ -1,7 +1,7 @@
package commands package commands
import ( import (
"git.front.kjuulh.io/kjuulh/octopush/internal/server" "git.front.kjuulh.io/kjuulh/kraken/internal/server"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"go.uber.org/zap" "go.uber.org/zap"
) )
@ -9,7 +9,7 @@ import (
func NewStartServerCommand(logger *zap.Logger) *cobra.Command { func NewStartServerCommand(logger *zap.Logger) *cobra.Command {
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "start", Use: "start",
Short: "Start the octopush server", Short: "Start the kraken server",
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
return server.Start(logger) return server.Start(logger)
}, },

View File

@ -3,8 +3,8 @@ package main
import ( import (
"os" "os"
"git.front.kjuulh.io/kjuulh/octopush/cmd/server/commands" "git.front.kjuulh.io/kjuulh/kraken/cmd/server/commands"
"git.front.kjuulh.io/kjuulh/octopush/internal/logger" "git.front.kjuulh.io/kjuulh/kraken/internal/logger"
"go.uber.org/zap" "go.uber.org/zap"
) )

View File

@ -3,7 +3,7 @@
base: "git@git.front.kjuulh.io:kjuulh/cuddle-go-plan.git" base: "git@git.front.kjuulh.io:kjuulh/cuddle-go-plan.git"
vars: vars:
service: "octopush" service: "kraken"
deployments: "git@git.front.kjuulh.io:kjuulh/deployments.git" deployments: "git@git.front.kjuulh.io:kjuulh/deployments.git"
scripts: scripts:

2
go.mod
View File

@ -1,4 +1,4 @@
module git.front.kjuulh.io/kjuulh/octopush module git.front.kjuulh.io/kjuulh/kraken
go 1.19 go 1.19

View File

@ -7,7 +7,7 @@ import (
"os" "os"
"testing" "testing"
"git.front.kjuulh.io/kjuulh/octopush/internal/server" "git.front.kjuulh.io/kjuulh/kraken/internal/server"
"go.uber.org/zap" "go.uber.org/zap"
) )

View File

@ -9,7 +9,7 @@ import (
"path" "path"
"testing" "testing"
"git.front.kjuulh.io/kjuulh/octopush/internal/services/storage" "git.front.kjuulh.io/kjuulh/kraken/internal/services/storage"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
) )

View File

@ -4,15 +4,15 @@ import (
"context" "context"
"errors" "errors"
"git.front.kjuulh.io/kjuulh/octopush/internal/actions/builders" "git.front.kjuulh.io/kjuulh/kraken/internal/actions/builders"
"git.front.kjuulh.io/kjuulh/octopush/internal/actions/querier" "git.front.kjuulh.io/kjuulh/kraken/internal/actions/querier"
"git.front.kjuulh.io/kjuulh/octopush/internal/schema" "git.front.kjuulh.io/kjuulh/kraken/internal/schema"
"git.front.kjuulh.io/kjuulh/octopush/internal/services/storage" "git.front.kjuulh.io/kjuulh/kraken/internal/services/storage"
"go.uber.org/zap" "go.uber.org/zap"
) )
type Action struct { type Action struct {
Schema *schema.OctopushSchema Schema *schema.KrakenSchema
SchemaPath string SchemaPath string
} }

View File

@ -7,9 +7,9 @@ import (
"path" "path"
"time" "time"
"git.front.kjuulh.io/kjuulh/octopush/internal/schema" "git.front.kjuulh.io/kjuulh/kraken/internal/schema"
"git.front.kjuulh.io/kjuulh/octopush/internal/services/providers" "git.front.kjuulh.io/kjuulh/kraken/internal/services/providers"
"git.front.kjuulh.io/kjuulh/octopush/internal/services/storage" "git.front.kjuulh.io/kjuulh/kraken/internal/services/storage"
"go.uber.org/zap" "go.uber.org/zap"
) )
@ -59,19 +59,19 @@ func (ac *ActionCreator) Prepare(ctx context.Context, ops *ActionCreatorOps) (*A
return nil, fmt.Errorf("path is invalid: %s", ops.Path) return nil, fmt.Errorf("path is invalid: %s", ops.Path)
} }
contents, err := os.ReadFile(path.Join(executorUrl, "octopush.yml")) contents, err := os.ReadFile(path.Join(executorUrl, "kraken.yml"))
if err != nil { if err != nil {
return nil, err return nil, err
} }
octopushSchema, err := schema.Unmarshal(string(contents)) krakenSchema, err := schema.Unmarshal(string(contents))
if err != nil { if err != nil {
return nil, err return nil, err
} }
ac.logger.Debug("Action creator done") ac.logger.Debug("Action creator done")
return &Action{ return &Action{
Schema: octopushSchema, Schema: krakenSchema,
SchemaPath: executorUrl, SchemaPath: executorUrl,
}, nil }, nil
} }

View File

@ -36,7 +36,7 @@ func (g *DockerBuild) Build(ctx context.Context, modulePath, entryPath string) (
return nil, err return nil, err
} }
tag := hex.EncodeToString(b) tag := hex.EncodeToString(b)
buildDockerCmd := fmt.Sprintf("(cd %s; docker build -f %s --tag octopush/%s .)", modulePath, entryPath, tag) buildDockerCmd := fmt.Sprintf("(cd %s; docker build -f %s --tag kraken/%s .)", modulePath, entryPath, tag)
g.logger.Debug("Running command", zap.String("command", buildDockerCmd)) g.logger.Debug("Running command", zap.String("command", buildDockerCmd))
cmd := exec.CommandContext( cmd := exec.CommandContext(
@ -73,7 +73,7 @@ func (g *DockerBuild) Build(ctx context.Context, modulePath, entryPath string) (
ctx, ctx,
"/bin/bash", "/bin/bash",
"-c", "-c",
fmt.Sprintf("docker run --rm -v %s/:/src/work/ octopush/%s", victimPath, tag), fmt.Sprintf("docker run --rm -v %s/:/src/work/ kraken/%s", victimPath, tag),
) )
runDockerWriter := &zapio.Writer{ runDockerWriter := &zapio.Writer{

View File

@ -4,9 +4,9 @@ import (
"context" "context"
"net/http" "net/http"
"git.front.kjuulh.io/kjuulh/octopush/internal/commands" "git.front.kjuulh.io/kjuulh/kraken/internal/commands"
"git.front.kjuulh.io/kjuulh/octopush/internal/serverdeps" "git.front.kjuulh.io/kjuulh/kraken/internal/serverdeps"
"git.front.kjuulh.io/kjuulh/octopush/internal/services/jobs" "git.front.kjuulh.io/kjuulh/kraken/internal/services/jobs"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/google/uuid" "github.com/google/uuid"
"go.uber.org/zap" "go.uber.org/zap"

View File

@ -1,7 +1,7 @@
package api package api
import ( import (
"git.front.kjuulh.io/kjuulh/octopush/internal/serverdeps" "git.front.kjuulh.io/kjuulh/kraken/internal/serverdeps"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"go.uber.org/zap" "go.uber.org/zap"
) )

View File

@ -7,11 +7,11 @@ import (
"sync" "sync"
"time" "time"
"git.front.kjuulh.io/kjuulh/octopush/internal/actions" "git.front.kjuulh.io/kjuulh/kraken/internal/actions"
"git.front.kjuulh.io/kjuulh/octopush/internal/gitproviders" "git.front.kjuulh.io/kjuulh/kraken/internal/gitproviders"
"git.front.kjuulh.io/kjuulh/octopush/internal/schema" "git.front.kjuulh.io/kjuulh/kraken/internal/schema"
"git.front.kjuulh.io/kjuulh/octopush/internal/services/providers" "git.front.kjuulh.io/kjuulh/kraken/internal/services/providers"
"git.front.kjuulh.io/kjuulh/octopush/internal/services/storage" "git.front.kjuulh.io/kjuulh/kraken/internal/services/storage"
giturls "github.com/whilp/git-urls" giturls "github.com/whilp/git-urls"
"go.uber.org/zap" "go.uber.org/zap"
) )
@ -79,7 +79,7 @@ func (pr *ProcessRepos) Process(ctx context.Context, repository string, branch s
return nil return nil
} }
func (pr *ProcessRepos) getRepoUrls(ctx context.Context, schema *schema.OctopushSchema) ([]string, error) { func (pr *ProcessRepos) getRepoUrls(ctx context.Context, schema *schema.KrakenSchema) ([]string, error) {
repoUrls := make([]string, 0) repoUrls := make([]string, 0)
repoUrls = append(repoUrls, schema.Select.Repositories...) repoUrls = append(repoUrls, schema.Select.Repositories...)
@ -231,7 +231,7 @@ func (pr *ProcessRepos) commit(ctx context.Context, area *storage.Area, repo *pr
return err return err
} }
err = pr.gitea.CreatePr(ctx, fmt.Sprintf("%s://%s", "https", url.Host), org, semanticName, head, originHead, "octopush-apply") err = pr.gitea.CreatePr(ctx, fmt.Sprintf("%s://%s", "https", url.Host), org, semanticName, head, originHead, "kraken-apply")
if err != nil { if err != nil {
return err return err
} }

View File

@ -2,7 +2,7 @@ package schema
import "gopkg.in/yaml.v3" import "gopkg.in/yaml.v3"
type OctopushSchema struct { type KrakenSchema struct {
ApiVersion string `yaml:"apiVersion"` ApiVersion string `yaml:"apiVersion"`
Name string `yaml:"name"` Name string `yaml:"name"`
Select struct { Select struct {
@ -22,8 +22,8 @@ type OctopushSchema struct {
} `yaml:"queries"` } `yaml:"queries"`
} }
func Unmarshal(raw string) (*OctopushSchema, error) { func Unmarshal(raw string) (*KrakenSchema, error) {
k := &OctopushSchema{} k := &KrakenSchema{}
err := yaml.Unmarshal([]byte(raw), k) err := yaml.Unmarshal([]byte(raw), k)
if err != nil { if err != nil {
return nil, err return nil, err

View File

@ -7,8 +7,8 @@ import (
"time" "time"
"git.front.kjuulh.io/kjuulh/curre" "git.front.kjuulh.io/kjuulh/curre"
"git.front.kjuulh.io/kjuulh/octopush/internal/api" "git.front.kjuulh.io/kjuulh/kraken/internal/api"
"git.front.kjuulh.io/kjuulh/octopush/internal/serverdeps" "git.front.kjuulh.io/kjuulh/kraken/internal/serverdeps"
ginzap "github.com/gin-contrib/zap" ginzap "github.com/gin-contrib/zap"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"go.uber.org/zap" "go.uber.org/zap"

View File

@ -4,8 +4,8 @@ import (
"context" "context"
"git.front.kjuulh.io/kjuulh/curre" "git.front.kjuulh.io/kjuulh/curre"
"git.front.kjuulh.io/kjuulh/octopush/internal/serverdeps" "git.front.kjuulh.io/kjuulh/kraken/internal/serverdeps"
"git.front.kjuulh.io/kjuulh/octopush/internal/services/signer" "git.front.kjuulh.io/kjuulh/kraken/internal/services/signer"
"go.uber.org/zap" "go.uber.org/zap"
) )

View File

@ -5,7 +5,7 @@ import (
"time" "time"
"git.front.kjuulh.io/kjuulh/curre" "git.front.kjuulh.io/kjuulh/curre"
"git.front.kjuulh.io/kjuulh/octopush/internal/serverdeps" "git.front.kjuulh.io/kjuulh/kraken/internal/serverdeps"
"go.uber.org/zap" "go.uber.org/zap"
) )

View File

@ -1,12 +1,12 @@
package serverdeps package serverdeps
import ( import (
actionc "git.front.kjuulh.io/kjuulh/octopush/internal/actions" actionc "git.front.kjuulh.io/kjuulh/kraken/internal/actions"
"git.front.kjuulh.io/kjuulh/octopush/internal/gitproviders" "git.front.kjuulh.io/kjuulh/kraken/internal/gitproviders"
"git.front.kjuulh.io/kjuulh/octopush/internal/services/actions" "git.front.kjuulh.io/kjuulh/kraken/internal/services/actions"
"git.front.kjuulh.io/kjuulh/octopush/internal/services/providers" "git.front.kjuulh.io/kjuulh/kraken/internal/services/providers"
"git.front.kjuulh.io/kjuulh/octopush/internal/services/signer" "git.front.kjuulh.io/kjuulh/kraken/internal/services/signer"
"git.front.kjuulh.io/kjuulh/octopush/internal/services/storage" "git.front.kjuulh.io/kjuulh/kraken/internal/services/storage"
"go.uber.org/zap" "go.uber.org/zap"
) )
@ -42,7 +42,7 @@ func NewServerDeps(logger *zap.Logger) *ServerDeps {
openPGPConfig := &signer.OpenPgpConfig{ openPGPConfig := &signer.OpenPgpConfig{
PrivateKeyFilePath: "./example/testkey.private.pgp", PrivateKeyFilePath: "./example/testkey.private.pgp",
PrivateKeyPassword: "somepassword", PrivateKeyPassword: "somepassword",
PrivateKeyIdentity: "octopush@kasperhermansen.com", PrivateKeyIdentity: "kraken@kasperhermansen.com",
} }
deps.openPGP = signer.NewOpenPGP(logger.With(zap.Namespace("openpgp")), openPGPConfig) deps.openPGP = signer.NewOpenPGP(logger.With(zap.Namespace("openpgp")), openPGPConfig)

View File

@ -3,7 +3,7 @@ package actions
import ( import (
"context" "context"
"git.front.kjuulh.io/kjuulh/octopush/internal/services/storage" "git.front.kjuulh.io/kjuulh/kraken/internal/services/storage"
"go.uber.org/zap" "go.uber.org/zap"
) )

View File

@ -6,8 +6,8 @@ import (
"fmt" "fmt"
"time" "time"
"git.front.kjuulh.io/kjuulh/octopush/internal/services/signer" "git.front.kjuulh.io/kjuulh/kraken/internal/services/signer"
"git.front.kjuulh.io/kjuulh/octopush/internal/services/storage" "git.front.kjuulh.io/kjuulh/kraken/internal/services/storage"
"github.com/go-git/go-git/v5" "github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5/config" "github.com/go-git/go-git/v5/config"
"github.com/go-git/go-git/v5/plumbing" "github.com/go-git/go-git/v5/plumbing"
@ -206,9 +206,9 @@ func (g *Git) CreateBranch(ctx context.Context, gitRepo *GitRepo) error {
return err return err
} }
refSpec := plumbing.NewBranchReferenceName("octopush-apply") refSpec := plumbing.NewBranchReferenceName("kraken-apply")
err = gitRepo.repo.CreateBranch(&config.Branch{ err = gitRepo.repo.CreateBranch(&config.Branch{
Name: "octopush-apply", Name: "kraken-apply",
Remote: "origin", Remote: "origin",
Merge: refSpec, Merge: refSpec,
Rebase: "", Rebase: "",
@ -227,7 +227,7 @@ func (g *Git) CreateBranch(ctx context.Context, gitRepo *GitRepo) error {
return fmt.Errorf("could not checkout branch: %w", err) return fmt.Errorf("could not checkout branch: %w", err)
} }
remoteRef := plumbing.NewRemoteReferenceName("origin", "octopush-apply") remoteRef := plumbing.NewRemoteReferenceName("origin", "kraken-apply")
ref := plumbing.NewSymbolicReference(refSpec, remoteRef) ref := plumbing.NewSymbolicReference(refSpec, remoteRef)
err = gitRepo.repo.Storer.SetReference(ref) err = gitRepo.repo.Storer.SetReference(ref)
if err != nil { if err != nil {
@ -268,8 +268,8 @@ func (g *Git) Commit(ctx context.Context, gitRepo *GitRepo) error {
_, err = worktree.Commit("some-commit", &git.CommitOptions{ _, err = worktree.Commit("some-commit", &git.CommitOptions{
All: true, All: true,
Author: &object.Signature{Name: "octopush", Email: "octopush@kasperhermansen.com", When: time.Now()}, Author: &object.Signature{Name: "kraken", Email: "kraken@kasperhermansen.com", When: time.Now()},
Committer: &object.Signature{Name: "octopush", Email: "octopush@kasperhermansen.com", When: time.Now()}, Committer: &object.Signature{Name: "kraken", Email: "kraken@kasperhermansen.com", When: time.Now()},
SignKey: g.openPGP.SigningKey, SignKey: g.openPGP.SigningKey,
}) })
if err != nil { if err != nil {

View File

@ -22,7 +22,7 @@ func NewDefaultStorageConfig() (*StorageConfig, error) {
return nil, err return nil, err
} }
return &StorageConfig{ return &StorageConfig{
Path: path.Join(tempDir, "octopush"), Path: path.Join(tempDir, "kraken"),
}, nil }, nil
} }

View File

@ -19,7 +19,7 @@
## Version 0.1 ## Version 0.1
- [x] Setup a way to choose actions and predicates - [x] Setup a way to choose actions and predicates
- [x] Allow instantiation of actions, octopush template repo etc. - [x] Allow instantiation of actions, kraken template repo etc.
- [x] Implement docker action - [x] Implement docker action
- [x] Create pr for gitea provider - [x] Create pr for gitea provider
- [x] Providing query results - [x] Providing query results
@ -28,14 +28,13 @@
## Version 0.2 ## Version 0.2
- [x] Write README - [x] Write README
- [ ] Make select depend on query
- [ ] Make configurable ssh user - [ ] Make configurable ssh user
- [ ] Make configurable gpg keyset - [ ] Make configurable gpg keyset
- [ ] Make configurable git provider - [ ] Make configurable git provider
- [ ] Add github - [ ] Add github
- [ ] Create templating function for easily creating new actions - [ ] Create templating function for easily creating new actions
- [ ] Add way to see progress of runners - [ ] Add way to see progress of runners
- [ ] Implement global .octopush store for easy access to settings - [ ] Implement global .kraken store for easy access to settings
- [ ] Move builders to start instead of every building on every action - [ ] Move builders to start instead of every building on every action
- [ ] Setup releases on github - [ ] Setup releases on github
- [ ] Setup CI - [ ] Setup CI

View File

@ -2,6 +2,6 @@
set -e set -e
git remote add github git@github.com:kjuulh/octopush.git || true git remote add github git@github.com:kjuulh/kraken.git || true
git push -f github main git push -f github main

View File

@ -4,8 +4,8 @@ set -e
current_branch=$(git branch --show-current) current_branch=$(git branch --show-current)
#go run cmd/octopush/octopush.go process --actions-repo "git@git.front.kjuulh.io:kjuulh/octopush.git" --branch "$current_branch" --path "_examples/actions/write_a_readme" #go run cmd/kraken/kraken.go process --actions-repo "git@git.front.kjuulh.io:kjuulh/kraken.git" --branch "$current_branch" --path "_examples/actions/write_a_readme"
go run cmd/octopush/octopush.go process \ go run cmd/kraken/kraken.go process \
--actions-repo "git@git.front.kjuulh.io:kjuulh/octopush.git"\ --actions-repo "git@git.front.kjuulh.io:kjuulh/kraken.git"\
--branch "$current_branch" \ --branch "$current_branch" \
--path "_examples/actions/add_releaserc" --path "_examples/queries/find_semantic"