From 745833519eeba880d19b7047ef1ae438ea38a9b7 Mon Sep 17 00:00:00 2001 From: Abirdcfly Date: Thu, 16 Nov 2023 13:29:51 +0800 Subject: [PATCH] feat: add make prepare-push Signed-off-by: Abirdcfly --- Makefile | 19 ++++++++++++++++++- charts/arcadia/Chart.yaml | 2 +- charts/arcadia/templates/rbac.yaml | 1 - pkg/scheduler/job.go | 2 +- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index c6bb577bf..0d3b1de30 100644 --- a/Makefile +++ b/Makefile @@ -252,4 +252,21 @@ arctl: fmt vet ## Build manager binary. gql-gen: @go run github.com/99designs/gqlgen@v0.17.40 generate build-graphql-server: gql-gen - @CGO_ENABLED=0 GOOS=linux go build -o bin/graphql-server graphql-server/go-server/main.go \ No newline at end of file + @CGO_ENABLED=0 GOOS=linux go build -o bin/graphql-server graphql-server/go-server/main.go + +# prepare for git push +.PHONY: prepare-push +config_rule_line_num = $(shell grep -n "rules:" config/rbac/role.yaml | cut -d: -f1) +chart_rule_line_num = $(shell grep -n "rules:" charts/arcadia/templates/rbac.yaml | cut -d: -f1) +prepare-push: manifests generate fmt vet + @echo "install golangci-lint" + @go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest + @echo "run golangci-lint with auto-fix" + @golangci-lint run --fix -v ./... + @echo "copy crds to charts" + @cp config/crd/bases/* charts/arcadia/crds + @echo "copy role to charts" + @sed -n '$(config_rule_line_num),$$p' config/rbac/role.yaml > tmp_role.yaml + @sed -i '' '$(chart_rule_line_num),$$d' charts/arcadia/templates/rbac.yaml + @cat tmp_role.yaml >> charts/arcadia/templates/rbac.yaml + @rm -f tmp_role.yaml diff --git a/charts/arcadia/Chart.yaml b/charts/arcadia/Chart.yaml index e856b3798..0222ceb98 100644 --- a/charts/arcadia/Chart.yaml +++ b/charts/arcadia/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: arcadia description: A Helm chart(KubeBB Component) for KubeAGI Arcadia type: application -version: 0.1.23 +version: 0.1.24 appVersion: "0.0.1" keywords: diff --git a/charts/arcadia/templates/rbac.yaml b/charts/arcadia/templates/rbac.yaml index cf11e8b86..505acbb25 100644 --- a/charts/arcadia/templates/rbac.yaml +++ b/charts/arcadia/templates/rbac.yaml @@ -374,4 +374,3 @@ rules: - get - patch - update - diff --git a/pkg/scheduler/job.go b/pkg/scheduler/job.go index 9511c6b83..6844b9af0 100644 --- a/pkg/scheduler/job.go +++ b/pkg/scheduler/job.go @@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS,