Skip to content

Commit

Permalink
feat: add make prepare-push
Browse files Browse the repository at this point in the history
Signed-off-by: Abirdcfly <[email protected]>
  • Loading branch information
Abirdcfly committed Nov 16, 2023
1 parent fb4985f commit 7458335
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
19 changes: 18 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -252,4 +252,21 @@ arctl: fmt vet ## Build manager binary.
gql-gen:
@go run github.com/99designs/[email protected] generate
build-graphql-server: gql-gen
@CGO_ENABLED=0 GOOS=linux go build -o bin/graphql-server graphql-server/go-server/main.go
@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
2 changes: 1 addition & 1 deletion charts/arcadia/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 0 additions & 1 deletion charts/arcadia/templates/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -374,4 +374,3 @@ rules:
- get
- patch
- update

2 changes: 1 addition & 1 deletion pkg/scheduler/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 7458335

Please sign in to comment.