Compare commits
45 Commits
v0.3
...
1fe8de1424
Author | SHA1 | Date | |
---|---|---|---|
1fe8de1424 | |||
1dada74055 | |||
bb7e0e12f9 | |||
3e5db1aaab | |||
41d31e7eda | |||
7a827fe479 | |||
49204abb29 | |||
931bfa7ae7 | |||
f9cc8e99b1 | |||
dc6f7872d2 | |||
e8451f3bfb | |||
b8e2a9369c | |||
2927cfb45e | |||
222db96717
|
|||
c22a85b97d | |||
91334e038c | |||
2eb5b7cdba | |||
0126eddfe5 | |||
1b493045d0 | |||
61ac6dd614 | |||
d6a8c1251b | |||
b965a4b47e | |||
b43deff8ad | |||
73088892f3 | |||
3e17eb5ece | |||
00a827464a | |||
eaaa5557f8 | |||
38d2dc932e | |||
ce5efdd6b8 | |||
28a7b6f2ab | |||
b5cbe8d7a9 | |||
53645f6274 | |||
b2b851a144 | |||
b7c16b8d61 | |||
933455d200 | |||
5a02f37174 | |||
1f726716e7 | |||
3b1b02e681 | |||
0dedf9268d | |||
c00b3a97d2 | |||
e0d0077109 | |||
ef28a7a248
|
|||
720fb81b1b
|
|||
998375e82a
|
|||
50fdefbcd4
|
@@ -1,5 +1,2 @@
|
||||
kind: template
|
||||
load: bust_rustbin_default_template.yaml
|
||||
name: octopush
|
||||
data:
|
||||
binName: octopush
|
||||
load: cuddle-rust-cli-plan.yaml
|
||||
|
31
.github/release-drafter.yml
vendored
Normal file
31
.github/release-drafter.yml
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
name-template: "v$RESOLVED_VERSION 🌈"
|
||||
tag-template: "v$RESOLVED_VERSION"
|
||||
categories:
|
||||
- title: "🚀 Features"
|
||||
labels:
|
||||
- "feature"
|
||||
- "enhancement"
|
||||
- title: "🐛 Bug Fixes"
|
||||
labels:
|
||||
- "fix"
|
||||
- "bugfix"
|
||||
- "bug"
|
||||
- title: "🧰 Maintenance"
|
||||
label: "chore"
|
||||
change-template: "- $TITLE @$AUTHOR (#$NUMBER)"
|
||||
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
|
||||
version-resolver:
|
||||
major:
|
||||
labels:
|
||||
- "major"
|
||||
minor:
|
||||
labels:
|
||||
- "minor"
|
||||
patch:
|
||||
labels:
|
||||
- "patch"
|
||||
default: patch
|
||||
template: |
|
||||
## Changes
|
||||
|
||||
$CHANGES
|
25
.github/workflows/release-drafter.yml
vendored
Normal file
25
.github/workflows/release-drafter.yml
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
name: Release Drafter
|
||||
|
||||
on:
|
||||
push:
|
||||
# branches to consider in the event; optional, defaults to all
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
types: [opened, reopened, synchronize]
|
||||
pull_request_target:
|
||||
types: [opened, reopened, synchronize]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
update_release_draft:
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: release-drafter/release-drafter@v6
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
1514
Cargo.lock
generated
1514
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
11
Cargo.toml
11
Cargo.toml
@@ -7,6 +7,7 @@ edition = "2021"
|
||||
|
||||
[workspace]
|
||||
members = [
|
||||
".",
|
||||
"crates/octopush_cli",
|
||||
"crates/octopush_infra",
|
||||
"crates/octopush_core",
|
||||
@@ -15,10 +16,10 @@ members = [
|
||||
]
|
||||
|
||||
[workspace.dependencies]
|
||||
eyre = { version = "0.6.8" }
|
||||
async-trait = "0.1.58"
|
||||
tokio = { version = "1.21.2", features = ["full", "test-util"] }
|
||||
tracing = { version = "0.1.37", features = ["log"] }
|
||||
eyre = { version = "0.6.12" }
|
||||
async-trait = "0.1.80"
|
||||
tokio = { version = "1.37.0", features = ["full", "test-util"] }
|
||||
tracing = { version = "0.1.40", features = ["log"] }
|
||||
|
||||
[dependencies]
|
||||
octopush_cli = { path = "crates/octopush_cli" }
|
||||
@@ -27,5 +28,5 @@ eyre = { workspace = true }
|
||||
tokio = { workspace = true }
|
||||
tracing = { workspace = true }
|
||||
|
||||
tracing-subscriber = { version = "0.3.16", features = ["json", "env-filter"] }
|
||||
tracing-subscriber = { version = "0.3.18", features = ["json", "env-filter"] }
|
||||
dotenv = { version = "0.15.0", features = ["clap", "cli"] }
|
||||
|
@@ -1,11 +0,0 @@
|
||||
module write_a_readme
|
||||
|
||||
go 1.19
|
||||
|
||||
require github.com/bitfield/script v0.21.3
|
||||
|
||||
require (
|
||||
bitbucket.org/creachadair/shell v0.0.7 // indirect
|
||||
github.com/itchyny/gojq v0.12.7 // indirect
|
||||
github.com/itchyny/timefmt-go v0.1.3 // indirect
|
||||
)
|
@@ -1,28 +0,0 @@
|
||||
bitbucket.org/creachadair/shell v0.0.7 h1:Z96pB6DkSb7F3Y3BBnJeOZH2gazyMTWlvecSD4vDqfk=
|
||||
bitbucket.org/creachadair/shell v0.0.7/go.mod h1:oqtXSSvSYr4624lnnabXHaBsYW6RD80caLi2b3hJk0U=
|
||||
github.com/bitfield/script v0.20.2 h1:4DexsRtBILVMEn3EZwHbtJdDqdk43sXI8gM3F04JXgs=
|
||||
github.com/bitfield/script v0.20.2/go.mod h1:l3AZPVAtKQrL03bwh7nlNTUtgrgSWurpJSbtqspYrOA=
|
||||
github.com/bitfield/script v0.21.0 h1:/OMglZmed2JyzLkmxYvZQMWs18XjPZxDB/0ht0pxrBk=
|
||||
github.com/bitfield/script v0.21.0/go.mod h1:l3AZPVAtKQrL03bwh7nlNTUtgrgSWurpJSbtqspYrOA=
|
||||
github.com/bitfield/script v0.21.1 h1:k3vYchaqnEPrQ/AS8VFJADM2/B6RbGT75Q3Eago9AHU=
|
||||
github.com/bitfield/script v0.21.1/go.mod h1:l3AZPVAtKQrL03bwh7nlNTUtgrgSWurpJSbtqspYrOA=
|
||||
github.com/bitfield/script v0.21.2 h1:YoubIUrBWeKKvp3+Ig7laCIyL4++JRs9k2EA3P5f34M=
|
||||
github.com/bitfield/script v0.21.2/go.mod h1:l3AZPVAtKQrL03bwh7nlNTUtgrgSWurpJSbtqspYrOA=
|
||||
github.com/bitfield/script v0.21.3 h1:M67zRsHvm2XEmUXaKRfr2+VrX9rSFmKt2Nfu+PIueCw=
|
||||
github.com/bitfield/script v0.21.3/go.mod h1:l3AZPVAtKQrL03bwh7nlNTUtgrgSWurpJSbtqspYrOA=
|
||||
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o=
|
||||
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
|
||||
github.com/itchyny/gojq v0.12.7 h1:hYPTpeWfrJ1OT+2j6cvBScbhl0TkdwGM4bc66onUSOQ=
|
||||
github.com/itchyny/gojq v0.12.7/go.mod h1:ZdvNHVlzPgUf8pgjnuDTmGfHA/21KoutQUJ3An/xNuw=
|
||||
github.com/itchyny/timefmt-go v0.1.3 h1:7M3LGVDsqcd0VZH2U+x393obrzZisp7C0uEe921iRkU=
|
||||
github.com/itchyny/timefmt-go v0.1.3/go.mod h1:0osSSCQSASBJMsIZnhAaF1C2fCBTJZXrnj37mG8/c+A=
|
||||
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
|
||||
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
|
||||
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
@@ -1,25 +0,0 @@
|
||||
package main
|
||||
|
||||
import "github.com/bitfield/script"
|
||||
|
||||
func main() {
|
||||
|
||||
releaseRc := `
|
||||
branches:
|
||||
- "main"
|
||||
- "v0.x"
|
||||
|
||||
plugins:
|
||||
- "@semantic-release/commit-analyzer"
|
||||
- "@semantic-release/release-notes-generator"
|
||||
- "@semantic-release/changelog"
|
||||
- "@semantic-release/git"
|
||||
`
|
||||
|
||||
_, err := script.
|
||||
Echo(releaseRc).
|
||||
WriteFile(".releaserc.yml")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
@@ -1,12 +0,0 @@
|
||||
apiVersion: action
|
||||
name: write-a-readme
|
||||
select:
|
||||
repositories:
|
||||
- git@git.front.kjuulh.io:kjuulh/octopush-test.git
|
||||
#- git@git.front.kjuulh.io:kjuulh/octopush.git
|
||||
# providers:
|
||||
# - gitea: https://git.front.kjuulh.io
|
||||
# organisation: "cibus"
|
||||
actions:
|
||||
- type: go
|
||||
entry: "main.go"
|
@@ -1,8 +0,0 @@
|
||||
FROM debian:bullseye-slim
|
||||
|
||||
# Octopush relies on this path being the specified path
|
||||
WORKDIR /src/work/
|
||||
|
||||
COPY entry.sh /src/script.sh
|
||||
|
||||
CMD [ "/src/script.sh" ]
|
@@ -1,5 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
echo "# README docker" > README.md
|
@@ -1,11 +0,0 @@
|
||||
module write_a_readme
|
||||
|
||||
go 1.19
|
||||
|
||||
require github.com/bitfield/script v0.21.3
|
||||
|
||||
require (
|
||||
bitbucket.org/creachadair/shell v0.0.7 // indirect
|
||||
github.com/itchyny/gojq v0.12.7 // indirect
|
||||
github.com/itchyny/timefmt-go v0.1.3 // indirect
|
||||
)
|
@@ -1,24 +0,0 @@
|
||||
bitbucket.org/creachadair/shell v0.0.7 h1:Z96pB6DkSb7F3Y3BBnJeOZH2gazyMTWlvecSD4vDqfk=
|
||||
bitbucket.org/creachadair/shell v0.0.7/go.mod h1:oqtXSSvSYr4624lnnabXHaBsYW6RD80caLi2b3hJk0U=
|
||||
github.com/bitfield/script v0.20.2 h1:4DexsRtBILVMEn3EZwHbtJdDqdk43sXI8gM3F04JXgs=
|
||||
github.com/bitfield/script v0.20.2/go.mod h1:l3AZPVAtKQrL03bwh7nlNTUtgrgSWurpJSbtqspYrOA=
|
||||
github.com/bitfield/script v0.21.0/go.mod h1:l3AZPVAtKQrL03bwh7nlNTUtgrgSWurpJSbtqspYrOA=
|
||||
github.com/bitfield/script v0.21.1/go.mod h1:l3AZPVAtKQrL03bwh7nlNTUtgrgSWurpJSbtqspYrOA=
|
||||
github.com/bitfield/script v0.21.2/go.mod h1:l3AZPVAtKQrL03bwh7nlNTUtgrgSWurpJSbtqspYrOA=
|
||||
github.com/bitfield/script v0.21.3/go.mod h1:l3AZPVAtKQrL03bwh7nlNTUtgrgSWurpJSbtqspYrOA=
|
||||
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o=
|
||||
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
|
||||
github.com/itchyny/gojq v0.12.7 h1:hYPTpeWfrJ1OT+2j6cvBScbhl0TkdwGM4bc66onUSOQ=
|
||||
github.com/itchyny/gojq v0.12.7/go.mod h1:ZdvNHVlzPgUf8pgjnuDTmGfHA/21KoutQUJ3An/xNuw=
|
||||
github.com/itchyny/timefmt-go v0.1.3 h1:7M3LGVDsqcd0VZH2U+x393obrzZisp7C0uEe921iRkU=
|
||||
github.com/itchyny/timefmt-go v0.1.3/go.mod h1:0osSSCQSASBJMsIZnhAaF1C2fCBTJZXrnj37mG8/c+A=
|
||||
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
|
||||
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
|
||||
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
@@ -1,11 +0,0 @@
|
||||
apiVersion: git.front.kjuulh.io/kjuulh/octopush/blob/main/schema/v1
|
||||
name: write-a-readme
|
||||
select:
|
||||
repositories:
|
||||
- git@git.front.kjuulh.io:kjuulh/octopush-test.git
|
||||
# providers:
|
||||
# - gitea: https://git.front.kjuulh.io
|
||||
# organisation: "cibus"
|
||||
actions:
|
||||
- type: docker-build
|
||||
entry: Dockerfile
|
@@ -2,10 +2,11 @@ module write_a_readme
|
||||
|
||||
go 1.19
|
||||
|
||||
require github.com/bitfield/script v0.21.3
|
||||
require github.com/bitfield/script v0.22.1
|
||||
|
||||
require (
|
||||
bitbucket.org/creachadair/shell v0.0.7 // indirect
|
||||
github.com/itchyny/gojq v0.12.7 // indirect
|
||||
github.com/itchyny/timefmt-go v0.1.3 // indirect
|
||||
github.com/itchyny/gojq v0.12.13 // indirect
|
||||
github.com/itchyny/timefmt-go v0.1.5 // indirect
|
||||
mvdan.cc/sh/v3 v3.7.0 // indirect
|
||||
)
|
||||
|
@@ -10,19 +10,56 @@ github.com/bitfield/script v0.21.2 h1:YoubIUrBWeKKvp3+Ig7laCIyL4++JRs9k2EA3P5f34
|
||||
github.com/bitfield/script v0.21.2/go.mod h1:l3AZPVAtKQrL03bwh7nlNTUtgrgSWurpJSbtqspYrOA=
|
||||
github.com/bitfield/script v0.21.3 h1:M67zRsHvm2XEmUXaKRfr2+VrX9rSFmKt2Nfu+PIueCw=
|
||||
github.com/bitfield/script v0.21.3/go.mod h1:l3AZPVAtKQrL03bwh7nlNTUtgrgSWurpJSbtqspYrOA=
|
||||
github.com/bitfield/script v0.21.4 h1:XPMD/ti7pa9KW1aPMq7Hfh+mVznQdlqxkbiZSM2lnbE=
|
||||
github.com/bitfield/script v0.21.4/go.mod h1:l3AZPVAtKQrL03bwh7nlNTUtgrgSWurpJSbtqspYrOA=
|
||||
github.com/bitfield/script v0.22.0 h1:LA7QHuEsXMPD52YLtxWrlqCCy+9FOpzNYfsRHC5Gsrc=
|
||||
github.com/bitfield/script v0.22.0/go.mod h1:ms4w+9B8f2/W0mbsgWDVTtl7K94bYuZc3AunnJC4Ebs=
|
||||
github.com/bitfield/script v0.22.1 h1:DphxoC5ssYciwd0ZS+N0Xae46geAD/0mVWh6a2NUxM4=
|
||||
github.com/bitfield/script v0.22.1/go.mod h1:fv+6x4OzVsRs6qAlc7wiGq8fq1b5orhtQdtW0dwjUHI=
|
||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
|
||||
github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
|
||||
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o=
|
||||
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
|
||||
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/renameio/v2 v2.0.0/go.mod h1:BtmJXm5YlszgC+TD4HOEEUFgkJP3nLxehU6hfe7jRt4=
|
||||
github.com/itchyny/gojq v0.12.7 h1:hYPTpeWfrJ1OT+2j6cvBScbhl0TkdwGM4bc66onUSOQ=
|
||||
github.com/itchyny/gojq v0.12.7/go.mod h1:ZdvNHVlzPgUf8pgjnuDTmGfHA/21KoutQUJ3An/xNuw=
|
||||
github.com/itchyny/gojq v0.12.12 h1:x+xGI9BXqKoJQZkr95ibpe3cdrTbY8D9lonrK433rcA=
|
||||
github.com/itchyny/gojq v0.12.12/go.mod h1:j+3sVkjxwd7A7Z5jrbKibgOLn0ZfLWkV+Awxr/pyzJE=
|
||||
github.com/itchyny/gojq v0.12.13 h1:IxyYlHYIlspQHHTE0f3cJF0NKDMfajxViuhBLnHd/QU=
|
||||
github.com/itchyny/gojq v0.12.13/go.mod h1:JzwzAqenfhrPUuwbmEz3nu3JQmFLlQTQMUcOdnu/Sf4=
|
||||
github.com/itchyny/timefmt-go v0.1.3 h1:7M3LGVDsqcd0VZH2U+x393obrzZisp7C0uEe921iRkU=
|
||||
github.com/itchyny/timefmt-go v0.1.3/go.mod h1:0osSSCQSASBJMsIZnhAaF1C2fCBTJZXrnj37mG8/c+A=
|
||||
github.com/itchyny/timefmt-go v0.1.5 h1:G0INE2la8S6ru/ZI5JecgyzbbJNs5lG1RcBqa7Jm6GE=
|
||||
github.com/itchyny/timefmt-go v0.1.5/go.mod h1:nEP7L+2YmAbT2kZ2HfSs1d8Xtw9LY8D2stDBckWakZ8=
|
||||
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
|
||||
github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
|
||||
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
|
||||
github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
|
||||
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
|
||||
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
||||
github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
|
||||
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
|
||||
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
|
||||
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
mvdan.cc/editorconfig v0.2.0/go.mod h1:lvnnD3BNdBYkhq+B4uBuFFKatfp02eB6HixDvEz91C0=
|
||||
mvdan.cc/sh/v3 v3.6.0 h1:gtva4EXJ0dFNvl5bHjcUEvws+KRcDslT8VKheTYkbGU=
|
||||
mvdan.cc/sh/v3 v3.6.0/go.mod h1:U4mhtBLZ32iWhif5/lD+ygy1zrgaQhUu+XFy7C8+TTA=
|
||||
mvdan.cc/sh/v3 v3.7.0 h1:lSTjdP/1xsddtaKfGg7Myu7DnlHItd3/M2tomOcNNBg=
|
||||
mvdan.cc/sh/v3 v3.7.0/go.mod h1:K2gwkaesF/D7av7Kxl0HbF5kGOd2ArupNTX3X44+8l8=
|
||||
|
@@ -1,12 +1,12 @@
|
||||
apiVersion: action
|
||||
name: write-a-readme
|
||||
select:
|
||||
github:
|
||||
repositories:
|
||||
- kjuulh/octopush-test
|
||||
push:
|
||||
pull-request:
|
||||
name: "write a readme"
|
||||
# github:
|
||||
# repositories:
|
||||
# - kjuulh/octopush-test
|
||||
# push:
|
||||
# pull-request:
|
||||
# name: "write a readme"
|
||||
|
||||
gitea:
|
||||
repositories:
|
||||
@@ -15,12 +15,12 @@ select:
|
||||
pull-request:
|
||||
name: "write a readme"
|
||||
|
||||
git:
|
||||
repositories:
|
||||
- git@git.front.kjuulh.io:kjuulh/octopush-test.git
|
||||
push:
|
||||
branch:
|
||||
name: "write a readme"
|
||||
# git:
|
||||
# repositories:
|
||||
# - git@git.front.kjuulh.io:kjuulh/octopush-test.git
|
||||
# push:
|
||||
# branch:
|
||||
# name: "write a readme"
|
||||
action:
|
||||
type: go
|
||||
entry: "main.go"
|
||||
|
@@ -1,9 +0,0 @@
|
||||
apiVersion: git.front.kjuulh.io/kjuulh/octopush/blob/main/schema/v1
|
||||
name: write-a-readme
|
||||
select:
|
||||
providers:
|
||||
- gitea: https://git.front.kjuulh.io
|
||||
organisation: "cibus"
|
||||
queries:
|
||||
- type: grep
|
||||
query: "releaser"
|
@@ -1,11 +0,0 @@
|
||||
apiVersion: git.front.kjuulh.io/kjuulh/octopush/blob/main/schema/v1
|
||||
name: write-a-readme
|
||||
select:
|
||||
repositories:
|
||||
- git@git.front.kjuulh.io:kjuulh/octopush-test.git
|
||||
# providers:
|
||||
# - gitea: https://git.front.kjuulh.io
|
||||
# organisation: "cibus"
|
||||
queries:
|
||||
- type: grep
|
||||
query: "# README"
|
@@ -10,4 +10,4 @@ gitea_raw_client = { path = "../gitea_raw_client" }
|
||||
|
||||
async-trait = { workspace = true }
|
||||
|
||||
reqwest = "0.11.13"
|
||||
reqwest = "0.12.4"
|
||||
|
@@ -10,8 +10,8 @@ edition = "2018"
|
||||
serde = "^1.0"
|
||||
serde_derive = "^1.0"
|
||||
serde_json = "^1.0"
|
||||
url = "^2.3"
|
||||
uuid = { version = "^1.2", features = ["serde"] }
|
||||
url = "^2.5"
|
||||
uuid = { version = "^1.8", features = ["serde"] }
|
||||
[dependencies.reqwest]
|
||||
version = "^0.11"
|
||||
version = "^0.12"
|
||||
features = ["json", "multipart"]
|
||||
|
@@ -13,4 +13,4 @@ eyre = { workspace = true }
|
||||
tracing = { workspace = true }
|
||||
tokio = { workspace = true }
|
||||
|
||||
clap = { version = "4.0.27", features = ["env"] }
|
||||
clap = { version = "4.5.4", features = ["env"] }
|
||||
|
@@ -58,6 +58,23 @@ pub fn execute_cmd() -> Command {
|
||||
.env("GITHUB_USERNAME")
|
||||
.required(false),
|
||||
)
|
||||
.arg(
|
||||
Arg::new("dry-run")
|
||||
.long("dry-run")
|
||||
.action(ArgAction::Set)
|
||||
.env("OCTOPUSH_DRY_RUN")
|
||||
.default_value("true")
|
||||
.required(false),
|
||||
)
|
||||
.arg(
|
||||
Arg::new("interactive")
|
||||
.long("interactive")
|
||||
.short('i')
|
||||
.action(ArgAction::Set)
|
||||
.env("OCTOPUSH_INTERACTIVE")
|
||||
.default_value("false")
|
||||
.required(false),
|
||||
)
|
||||
}
|
||||
|
||||
pub async fn execute_subcommand(args: &ArgMatches) -> eyre::Result<()> {
|
||||
@@ -71,6 +88,19 @@ pub async fn execute_subcommand(args: &ArgMatches) -> eyre::Result<()> {
|
||||
|
||||
let github_http_token = args.get_one::<String>("github-api-token");
|
||||
let github_username = args.get_one::<String>("github-username");
|
||||
let dryrun: bool = args
|
||||
.get_one::<String>("dry-run")
|
||||
.ok_or(eyre::anyhow!("--dry-run is required"))?
|
||||
.parse()?;
|
||||
|
||||
let interactive: bool = args
|
||||
.get_one::<String>("interactive")
|
||||
.ok_or(eyre::anyhow!("--interactive is required"))?
|
||||
.parse()?;
|
||||
|
||||
if dryrun {
|
||||
tracing::info!("running in dry-run mode");
|
||||
}
|
||||
|
||||
let service_register = ServiceRegister::new(
|
||||
LocalGitProviderOptions { http_auth: None },
|
||||
@@ -107,21 +137,21 @@ pub async fn execute_subcommand(args: &ArgMatches) -> eyre::Result<()> {
|
||||
if let Some(git) = &select.git {
|
||||
service_register
|
||||
.git_selector
|
||||
.run(git, &action_path, &action)
|
||||
.run(git, &action_path, &action, dryrun, interactive)
|
||||
.await?;
|
||||
}
|
||||
|
||||
if let Some(gitea) = &select.gitea {
|
||||
service_register
|
||||
.gitea_selector
|
||||
.run(gitea, &action_path, &action)
|
||||
.run(gitea, &action_path, &action, dryrun, interactive)
|
||||
.await?;
|
||||
}
|
||||
|
||||
if let Some(github) = &select.github {
|
||||
service_register
|
||||
.github_selector
|
||||
.run(github, &action_path, &action)
|
||||
.run(github, &action_path, &action, dryrun, interactive)
|
||||
.await?;
|
||||
}
|
||||
}
|
||||
|
@@ -15,10 +15,10 @@ tracing = { workspace = true }
|
||||
|
||||
rand = "0.8.5"
|
||||
hex = "0.4.3"
|
||||
git2 = { version = "0.15.0", features = [
|
||||
git2 = { version = "0.19.0", features = [
|
||||
"vendored-libgit2",
|
||||
"vendored-openssl",
|
||||
] }
|
||||
serde = { version = "1.0.147", features = ["derive"] }
|
||||
serde_yaml = "0.9.14"
|
||||
octocrab = { version = "0.17.0", features = ["futures-core", "futures-util"] }
|
||||
serde = { version = "1.0.202", features = ["derive"] }
|
||||
serde_yaml = "0.9.34+deprecated"
|
||||
octocrab = { version = "0.39.0", features = ["futures-core", "futures-util"] }
|
||||
|
@@ -5,3 +5,4 @@ pub mod schema;
|
||||
pub mod selectors;
|
||||
mod shell;
|
||||
pub mod storage;
|
||||
pub mod ui;
|
||||
|
@@ -6,22 +6,32 @@ use crate::{
|
||||
executor::executor::DynExecutor,
|
||||
git::DynGitProvider,
|
||||
schema::models::{Action, Git},
|
||||
ui::DynUI,
|
||||
};
|
||||
|
||||
pub struct GitSelector {
|
||||
git_provider: DynGitProvider,
|
||||
executor: DynExecutor,
|
||||
ui: DynUI,
|
||||
}
|
||||
|
||||
impl GitSelector {
|
||||
pub fn new(git_provider: DynGitProvider, executor: DynExecutor) -> Self {
|
||||
pub fn new(git_provider: DynGitProvider, executor: DynExecutor, ui: DynUI) -> Self {
|
||||
Self {
|
||||
git_provider,
|
||||
executor,
|
||||
ui,
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn run(&self, git: &Git, action_path: &PathBuf, action: &Action) -> eyre::Result<()> {
|
||||
pub async fn run(
|
||||
&self,
|
||||
git: &Git,
|
||||
action_path: &PathBuf,
|
||||
action: &Action,
|
||||
dryrun: bool,
|
||||
interactive: bool,
|
||||
) -> eyre::Result<()> {
|
||||
tracing::info!("fetching repos");
|
||||
for repo in &git.repositories {
|
||||
let gp = self.git_provider.clone();
|
||||
@@ -36,6 +46,14 @@ impl GitSelector {
|
||||
|
||||
self.executor.execute(&path, action_path, action).await?;
|
||||
|
||||
if dryrun {
|
||||
continue;
|
||||
}
|
||||
|
||||
if interactive {
|
||||
self.ui.confirm().await?;
|
||||
}
|
||||
|
||||
if let Some(push) = &git.push {
|
||||
self.git_provider
|
||||
.push_branch(repo, &push.branch.name)
|
||||
|
@@ -6,12 +6,14 @@ use crate::{
|
||||
executor::executor::DynExecutor,
|
||||
git::{gitea::DynGiteaProvider, DynGitProvider},
|
||||
schema::models::{Action, Gitea},
|
||||
ui::DynUI,
|
||||
};
|
||||
|
||||
pub struct GiteaSelector {
|
||||
gitea_provider: DynGiteaProvider,
|
||||
git_provider: DynGitProvider,
|
||||
executor: DynExecutor,
|
||||
ui: DynUI,
|
||||
}
|
||||
|
||||
impl GiteaSelector {
|
||||
@@ -19,11 +21,13 @@ impl GiteaSelector {
|
||||
gitea_provider: DynGiteaProvider,
|
||||
git_provider: DynGitProvider,
|
||||
executor: DynExecutor,
|
||||
ui: DynUI,
|
||||
) -> Self {
|
||||
Self {
|
||||
gitea_provider,
|
||||
git_provider,
|
||||
executor,
|
||||
ui,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,6 +36,8 @@ impl GiteaSelector {
|
||||
git: &Gitea,
|
||||
action_path: &PathBuf,
|
||||
action: &Action,
|
||||
dryrun: bool,
|
||||
interactive: bool,
|
||||
) -> eyre::Result<()> {
|
||||
tracing::info!("fetching repos");
|
||||
for repo in &git.repositories {
|
||||
@@ -47,6 +53,14 @@ impl GiteaSelector {
|
||||
|
||||
self.executor.execute(&path, action_path, action).await?;
|
||||
|
||||
if dryrun {
|
||||
continue;
|
||||
}
|
||||
|
||||
if interactive {
|
||||
self.ui.confirm().await?;
|
||||
}
|
||||
|
||||
if let Some(push) = &git.push {
|
||||
self.git_provider
|
||||
.push_branch(repo, &push.pull_request.name)
|
||||
|
@@ -6,12 +6,14 @@ use crate::{
|
||||
executor::executor::DynExecutor,
|
||||
git::{github::DynGitHubProvider, DynGitProvider},
|
||||
schema::models::{Action, GitHub},
|
||||
ui::DynUI,
|
||||
};
|
||||
|
||||
pub struct GitHubSelector {
|
||||
github_provider: DynGitHubProvider,
|
||||
git_provider: DynGitProvider,
|
||||
executor: DynExecutor,
|
||||
ui: DynUI,
|
||||
}
|
||||
|
||||
impl GitHubSelector {
|
||||
@@ -19,11 +21,13 @@ impl GitHubSelector {
|
||||
github_provider: DynGitHubProvider,
|
||||
git_provider: DynGitProvider,
|
||||
executor: DynExecutor,
|
||||
ui: DynUI,
|
||||
) -> Self {
|
||||
Self {
|
||||
github_provider,
|
||||
git_provider,
|
||||
executor,
|
||||
ui,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,6 +36,8 @@ impl GitHubSelector {
|
||||
git: &GitHub,
|
||||
action_path: &PathBuf,
|
||||
action: &Action,
|
||||
dryrun: bool,
|
||||
interactive: bool,
|
||||
) -> eyre::Result<()> {
|
||||
tracing::info!("fetching repos");
|
||||
for repo in &git.repositories {
|
||||
@@ -47,6 +53,14 @@ impl GitHubSelector {
|
||||
|
||||
self.executor.execute(&path, action_path, action).await?;
|
||||
|
||||
if dryrun {
|
||||
continue;
|
||||
}
|
||||
|
||||
if interactive {
|
||||
self.ui.confirm().await?;
|
||||
}
|
||||
|
||||
if let Some(push) = &git.push {
|
||||
self.git_provider
|
||||
.push_branch(repo, &push.pull_request.name)
|
||||
|
12
crates/octopush_core/src/ui/mod.rs
Normal file
12
crates/octopush_core/src/ui/mod.rs
Normal file
@@ -0,0 +1,12 @@
|
||||
pub mod terminal_ui;
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
use async_trait::async_trait;
|
||||
|
||||
#[async_trait]
|
||||
pub trait UI {
|
||||
async fn confirm(&self) -> eyre::Result<()>;
|
||||
}
|
||||
|
||||
pub type DynUI = Arc<dyn UI + Send + Sync>;
|
47
crates/octopush_core/src/ui/terminal_ui.rs
Normal file
47
crates/octopush_core/src/ui/terminal_ui.rs
Normal file
@@ -0,0 +1,47 @@
|
||||
use std::{
|
||||
io::{self, Write},
|
||||
process::exit,
|
||||
};
|
||||
|
||||
use async_trait::async_trait;
|
||||
|
||||
use super::UI;
|
||||
|
||||
pub struct TerminalUI {}
|
||||
|
||||
impl TerminalUI {
|
||||
pub fn new() -> Self {
|
||||
Self {}
|
||||
}
|
||||
|
||||
pub async fn query_console(&self) -> eyre::Result<()> {
|
||||
print!("Continue? ([Y]es/[N]o): ");
|
||||
std::io::stdout().lock().flush()?;
|
||||
let mut input = String::new();
|
||||
let _ = io::stdin().read_line(&mut input)?;
|
||||
|
||||
if input.to_lowercase().starts_with("y") {
|
||||
return Ok(());
|
||||
} else if input.to_lowercase().starts_with("n") {
|
||||
exit(0)
|
||||
} else {
|
||||
Err(eyre::anyhow!("input not valid"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl UI for TerminalUI {
|
||||
async fn confirm(&self) -> eyre::Result<()> {
|
||||
match self.query_console().await {
|
||||
Ok(_) => Ok(()),
|
||||
Err(e) => {
|
||||
if e.to_string().starts_with("input not valid") {
|
||||
self.query_console().await
|
||||
} else {
|
||||
Err(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -22,6 +22,7 @@ use octopush_core::{
|
||||
git_selector::GitSelector, gitea_selector::GiteaSelector, github_selector::GitHubSelector,
|
||||
},
|
||||
storage::{local::LocalStorageEngine, DynStorageEngine},
|
||||
ui::{terminal_ui::TerminalUI, DynUI},
|
||||
};
|
||||
|
||||
pub struct ServiceRegister {
|
||||
@@ -35,6 +36,7 @@ pub struct ServiceRegister {
|
||||
pub gitea_selector: Arc<GiteaSelector>,
|
||||
pub github_provider: DynGitHubProvider,
|
||||
pub github_selector: Arc<GitHubSelector>,
|
||||
pub ui: DynUI,
|
||||
}
|
||||
|
||||
impl ServiceRegister {
|
||||
@@ -57,11 +59,19 @@ impl ServiceRegister {
|
||||
storage_engine.clone(),
|
||||
gitea_client.clone(),
|
||||
));
|
||||
let git_selector = Arc::new(GitSelector::new(git_provider.clone(), executor.clone()));
|
||||
|
||||
let ui = Arc::new(TerminalUI::new());
|
||||
|
||||
let git_selector = Arc::new(GitSelector::new(
|
||||
git_provider.clone(),
|
||||
executor.clone(),
|
||||
ui.clone(),
|
||||
));
|
||||
let gitea_selector = Arc::new(GiteaSelector::new(
|
||||
gitea_provider.clone(),
|
||||
git_provider.clone(),
|
||||
executor.clone(),
|
||||
ui.clone(),
|
||||
));
|
||||
let github_client = Arc::new(DefaultGitHubClient::new(&github_client_options)?);
|
||||
let github_provider = Arc::new(DefaultGitHubProvider::new(
|
||||
@@ -73,6 +83,7 @@ impl ServiceRegister {
|
||||
github_provider.clone(),
|
||||
git_provider.clone(),
|
||||
executor.clone(),
|
||||
ui.clone(),
|
||||
));
|
||||
|
||||
Ok(Self {
|
||||
@@ -86,6 +97,7 @@ impl ServiceRegister {
|
||||
gitea_selector,
|
||||
github_provider,
|
||||
github_selector,
|
||||
ui,
|
||||
})
|
||||
}
|
||||
|
||||
|
22
cuddle.yaml
22
cuddle.yaml
@@ -1,13 +1,21 @@
|
||||
# yaml-language-server: $schema=https://git.front.kjuulh.io/kjuulh/cuddle/raw/branch/main/schemas/base.json
|
||||
|
||||
base: "git@git.front.kjuulh.io:kjuulh/cuddle-rust-plan.git"
|
||||
base: "git@git.front.kjuulh.io:kjuulh/cuddle-rust-cli-plan.git"
|
||||
|
||||
vars:
|
||||
service: "octopush"
|
||||
deployments: "git@git.front.kjuulh.io:kjuulh/deployments.git"
|
||||
registry: kasperhermansen
|
||||
|
||||
clusters:
|
||||
clank-prod:
|
||||
replicas: "3"
|
||||
namespace: prod
|
||||
|
||||
|
||||
deployment:
|
||||
registry: git@git.front.kjuulh.io:kjuulh/clank-clusters
|
||||
env:
|
||||
prod:
|
||||
clusters:
|
||||
- clank-prod
|
||||
|
||||
scripts:
|
||||
push_github:
|
||||
type: shell
|
||||
run:
|
||||
type: shell
|
||||
|
Reference in New Issue
Block a user