Skip to content

Commit

Permalink
chore: namespace from arg
Browse files Browse the repository at this point in the history
  • Loading branch information
acid-chicken committed May 21, 2024
1 parent 7c8c188 commit be1b124
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions charts/hariko/templates/Deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ spec:
- "$(GITHUB_REPOSITORY)"
- "-s"
- "$(GITHUB_WEBHOOK_SECRET)"
- "-n"
- "$(NAMESPACE)"
- "-p"
- "$(PACKAGE_NAME)"
- "-r"
Expand Down Expand Up @@ -56,6 +58,11 @@ spec:
secretKeyRef:
name: hariko
key: github-webhook-secret
- name: NAMESPACE
valueFrom:
secretKeyRef:
name: hariko
key: namespace
- name: PACKAGE_NAME
valueFrom:
secretKeyRef:
Expand Down
4 changes: 3 additions & 1 deletion hariko/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ func newCmd() *cobra.Command {
var githubJobName string
var githubRepository string
var githubWebhookSecret string
var namespace string
var packageName string
var repositoryName string
var repositoryURL string
Expand All @@ -43,6 +44,7 @@ func newCmd() *cobra.Command {
Long: "Hariko watches the GitHub repository and automatically deploys the application to the server.",
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
settings.SetNamespace(namespace)
hook, err := github.New(github.Options.Secret(githubWebhookSecret))
if err != nil {
return err
Expand Down Expand Up @@ -165,6 +167,7 @@ func newCmd() *cobra.Command {
f.StringVarP(&githubJobName, "github-job-name", "j", "", "Job name")
f.StringVarP(&githubRepository, "github-repository", "g", "", "Repository")
f.StringVarP(&githubWebhookSecret, "github-webhook-secret", "s", "", "GitHub webhook secret")
f.StringVarP(&namespace, "namespace", "n", "", "Namespace")
f.StringVarP(&packageName, "package-name", "p", "", "Package name")
f.StringVarP(&repositoryName, "repository-name", "r", "", "Repository name")
f.StringVarP(&repositoryURL, "repository-url", "u", "", "Repository URL")
Expand All @@ -184,7 +187,6 @@ func Execute() {
}

func deploy(packageName string, repositoryName string, repositoryURL string, log io.Writer) (*release.Release, error) {
settings.SetNamespace("misskey")
p := getter.All(settings)
c := repo.Entry{
Name: repositoryName,
Expand Down

0 comments on commit be1b124

Please sign in to comment.