45 Commits

Author SHA1 Message Date
1fe8de1424 fix(deps): update serde monorepo to v1.0.218
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
2025-02-20 06:03:12 +00:00
1dada74055 chore(deps): update all dependencies
Some checks failed
continuous-integration/drone/pr Build is failing
continuous-integration/drone/push Build is failing
2024-08-21 21:20:38 +00:00
bb7e0e12f9 fix(deps): update rust crate serde_json to v1.0.117
Some checks failed
continuous-integration/drone/pr Build is failing
continuous-integration/drone/push Build is failing
2024-05-25 18:47:46 +00:00
3e5db1aaab fix(deps): update serde monorepo to v1.0.203
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2024-05-25 18:13:10 +00:00
41d31e7eda fix(deps): update rust crate serde to 1.0.202
Some checks failed
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is failing
2024-05-15 08:16:45 +00:00
7a827fe479 fix(deps): update rust crate serde to 1.0.201
Some checks failed
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is failing
2024-05-08 01:01:08 +00:00
49204abb29 fix(deps): update module github.com/bitfield/script to v0.22.1
Some checks failed
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is failing
2024-05-06 09:16:05 +00:00
931bfa7ae7 fix(deps): update rust crate serde to 1.0.200
Some checks failed
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is failing
2024-05-01 16:56:55 +00:00
f9cc8e99b1 fix(deps): update rust crate serde to 1.0.199
Some checks failed
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is failing
2024-04-27 04:51:30 +00:00
dc6f7872d2 fix(deps): update rust crate reqwest to 0.12.4
Some checks failed
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is failing
2024-04-19 18:12:38 +00:00
e8451f3bfb fix(deps): update rust crate serde to 1.0.198
Some checks failed
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is failing
2024-04-16 21:43:14 +00:00
b8e2a9369c chore(deps): update rust crate async-trait to 0.1.80
Some checks failed
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is failing
2024-04-11 19:21:25 +00:00
2927cfb45e chore(deps): update all dependencies
Some checks failed
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is failing
2024-04-09 18:50:44 +00:00
222db96717 feat: update
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2024-04-09 20:38:09 +02:00
c22a85b97d Update Rust crate serde to 1.0.163
Some checks reported errors
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
continuous-integration/drone Build encountered an error
2023-05-11 20:00:48 +00:00
91334e038c Update Rust crate tokio to 1.28.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-05-10 10:26:54 +00:00
2eb5b7cdba Update Rust crate serde to 1.0.162
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-05-05 08:13:42 +00:00
0126eddfe5 Update all dependencies
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-05-02 19:45:00 +00:00
1b493045d0 Update module github.com/bitfield/script to v0.22.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-04-22 18:46:33 +00:00
61ac6dd614 Update Rust crate tracing-subscriber to 0.3.17
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-04-22 08:16:26 +00:00
d6a8c1251b Update Rust crate clap to 4.2.4
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-04-19 18:42:09 +00:00
b965a4b47e Update Rust crate clap to 4.2.3
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-04-18 21:19:23 +00:00
b43deff8ad Update Rust crate octocrab to 0.20.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-04-17 07:54:46 +00:00
73088892f3 Update Rust crate git2 to 0.17.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-04-16 18:33:51 +00:00
3e17eb5ece Update Rust crate clap to 4.2.2
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-04-13 16:16:29 +00:00
00a827464a Update all dependencies
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-04-11 06:17:05 +00:00
eaaa5557f8 Update Rust crate serde_yaml to 0.9.20
Some checks failed
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is failing
2023-04-05 22:46:56 +00:00
38d2dc932e Update all dependencies
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-04-02 22:37:31 +00:00
ce5efdd6b8 Update all dependencies
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-03-27 16:13:44 +00:00
28a7b6f2ab Update all dependencies
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-03-23 17:41:01 +00:00
b5cbe8d7a9 Update all dependencies
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-03-20 17:40:30 +00:00
53645f6274 Update all dependencies
Some checks failed
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is failing
2023-02-28 14:34:40 +00:00
b2b851a144 Update Rust crate serde to 1.0.152
Some checks failed
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is failing
2022-12-26 18:00:15 +00:00
b7c16b8d61 Update Rust crate clap to 4.0.32
Some checks failed
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is failing
2022-12-22 20:00:46 +00:00
933455d200 Update Rust crate clap to 4.0.31
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2022-12-22 19:23:08 +00:00
5a02f37174 Update Rust crate serde_yaml to 0.9.16
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2022-12-18 17:40:33 +00:00
1f726716e7 Update all dependencies
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2022-12-18 11:18:19 +00:00
3b1b02e681 Update all dependencies
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2022-12-09 16:50:59 +00:00
0dedf9268d added interactive mode (#44)
Co-authored-by: kjuulh <contact@kjuulh.io>
Reviewed-on: #44
2022-12-01 08:51:52 +00:00
c00b3a97d2 feature/dry-run (#43)
Co-authored-by: kjuulh <contact@kjuulh.io>
Reviewed-on: #43
2022-12-01 08:14:01 +00:00
e0d0077109 with dry-run mode (#42)
Co-authored-by: kjuulh <contact@kjuulh.io>
Reviewed-on: #42
2022-12-01 07:44:58 +00:00
ef28a7a248 remove examples
All checks were successful
continuous-integration/drone/push Build is passing
2022-11-27 21:32:45 +01:00
720fb81b1b with version resolver
All checks were successful
continuous-integration/drone/push Build is passing
2022-11-27 21:31:09 +01:00
998375e82a with rm config
All checks were successful
continuous-integration/drone/push Build is passing
2022-11-27 21:27:45 +01:00
50fdefbcd4 with action
All checks were successful
continuous-integration/drone/push Build is passing
2022-11-27 21:25:39 +01:00
32 changed files with 1208 additions and 801 deletions

View File

@@ -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
View 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
View 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

File diff suppressed because it is too large Load Diff

View File

@@ -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"] }

View File

@@ -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
)

View File

@@ -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=

View File

@@ -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)
}
}

View File

@@ -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"

View File

@@ -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" ]

View File

@@ -1,5 +0,0 @@
#!/bin/bash
set -e
echo "# README docker" > README.md

View File

@@ -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
)

View File

@@ -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=

View File

@@ -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

View File

@@ -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
)

View File

@@ -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=

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -10,4 +10,4 @@ gitea_raw_client = { path = "../gitea_raw_client" }
async-trait = { workspace = true }
reqwest = "0.11.13"
reqwest = "0.12.4"

View File

@@ -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"]

View File

@@ -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"] }

View File

@@ -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?;
}
}

View File

@@ -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"] }

View File

@@ -5,3 +5,4 @@ pub mod schema;
pub mod selectors;
mod shell;
pub mod storage;
pub mod ui;

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View 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>;

View 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)
}
}
}
}
}

View File

@@ -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,
})
}

View File

@@ -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