mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-08-13 06:08:15 +00:00
Add cli publish and rename publish docker flow name (#40)
* new makefiles, build automation * Update main.yml * add git branch to the bucket path * Update main.yml * no message * no message * fix yaml * fix naming * run only on main and develop Co-authored-by: Alex Haiut <alex@up9.com>
This commit is contained in:
parent
2ea8b0dbde
commit
a960022601
19
.github/workflows/publish-cli.yml
vendored
Normal file
19
.github/workflows/publish-cli.yml
vendored
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
name: public-cli
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 'develop'
|
||||||
|
- 'main'
|
||||||
|
jobs:
|
||||||
|
docker:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Set up Cloud SDK
|
||||||
|
uses: google-github-actions/setup-gcloud@master
|
||||||
|
with:
|
||||||
|
service_account_key: ${{ secrets.GCR_JSON_KEY }}
|
||||||
|
export_default_credentials: true
|
||||||
|
- name: Build and Push CLI
|
||||||
|
run: make push-cli
|
@ -1,4 +1,4 @@
|
|||||||
name: ci
|
name: publish-docker
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
@ -36,3 +36,4 @@ jobs:
|
|||||||
push: true
|
push: true
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
|
30
Makefile
30
Makefile
@ -17,30 +17,43 @@ help: ## This help.
|
|||||||
|
|
||||||
# Variables and lists
|
# Variables and lists
|
||||||
TS_SUFFIX="$(shell date '+%s')"
|
TS_SUFFIX="$(shell date '+%s')"
|
||||||
|
GIT_BRANCH="$(shell git branch | grep \* | cut -d ' ' -f2 | tr '[:upper:]' '[:lower:]' | tr '/' '_')"
|
||||||
|
BUCKET_PATH=static.up9.io/mizu/$(GIT_BRANCH)
|
||||||
|
|
||||||
ui: ## build UI
|
ui: ## build UI
|
||||||
@(cd ui; npm i ; npm run build; )
|
@(cd ui; npm i ; npm run build; )
|
||||||
@ls -l ui/build
|
@ls -l ui/build
|
||||||
|
|
||||||
cli: # build CLI
|
cli: # build CLI
|
||||||
@(cd cli; echo "building cli" )
|
@echo "building cli"; cd cli && $(MAKE) build
|
||||||
|
|
||||||
api: ## build API server
|
api: ## build API server
|
||||||
@(echo "building API server .." )
|
@(echo "building API server .." )
|
||||||
@(cd api; go build -o build/apiserver main.go)
|
@(cd api; go build -o build/apiserver main.go)
|
||||||
@ls -l api/build
|
@ls -l api/build
|
||||||
|
|
||||||
tap: ## build tap binary
|
#tap: ## build tap binary
|
||||||
@(cd tap; go build -o build/tap ./src)
|
# @(cd tap; go build -o build/tap ./src)
|
||||||
@ls -l tap/build
|
# @ls -l tap/build
|
||||||
|
|
||||||
docker: ## build Docker image
|
docker: ## build Docker image
|
||||||
@(echo "building docker image" )
|
@(echo "building docker image" )
|
||||||
|
docker build -t up9inc/mizu:latest .
|
||||||
|
#./build-push-featurebranch.sh
|
||||||
|
|
||||||
|
push: push-docker push-cli ## build and publish Mizu docker image & CLI
|
||||||
|
|
||||||
|
push-docker:
|
||||||
|
@echo "publishing Docker image .. "
|
||||||
./build-push-featurebranch.sh
|
./build-push-featurebranch.sh
|
||||||
|
|
||||||
publish: ## build and publish Mizu docker image & CLI
|
push-cli:
|
||||||
@echo "publishing Docker image .. "
|
|
||||||
@echo "publishing CLI .. "
|
@echo "publishing CLI .. "
|
||||||
|
@cd cli; $(MAKE) build-all
|
||||||
|
@echo "publishing file ${OUTPUT_FILE} .."
|
||||||
|
#gsutil mv gs://${BUCKET_PATH}/${OUTPUT_FILE} gs://${BUCKET_PATH}/${OUTPUT_FILE}.${SUFFIX}
|
||||||
|
gsutil cp -r ./cli/bin/* gs://${BUCKET_PATH}/
|
||||||
|
gsutil setmeta -r -h "Cache-Control:public, max-age=30" gs://${BUCKET_PATH}/\*
|
||||||
|
|
||||||
|
|
||||||
clean: clean-ui clean-api clean-cli clean-docker ## Clean all build artifacts
|
clean: clean-ui clean-api clean-cli clean-docker ## Clean all build artifacts
|
||||||
@ -52,10 +65,7 @@ clean-api:
|
|||||||
@(rm -rf api/build ; echo "api cleanup done" )
|
@(rm -rf api/build ; echo "api cleanup done" )
|
||||||
|
|
||||||
clean-cli:
|
clean-cli:
|
||||||
@(echo "CLI cleanup - NOT IMPLEMENTED YET " )
|
@(cd cli; make clean ; echo "CLI cleanup done" )
|
||||||
|
|
||||||
clean-tap:
|
|
||||||
@(cd tap; rm -rf build ; echo "tap cleanup done")
|
|
||||||
|
|
||||||
clean-docker:
|
clean-docker:
|
||||||
@(echo "DOCKER cleanup - NOT IMPLEMENTED YET " )
|
@(echo "DOCKER cleanup - NOT IMPLEMENTED YET " )
|
||||||
|
40
cli/Makefile
40
cli/Makefile
@ -1,21 +1,27 @@
|
|||||||
install:
|
FOLDER=$(GOOS).$(GOARCH)
|
||||||
go build install mizu.go
|
|
||||||
|
|
||||||
build:
|
.PHONY: help
|
||||||
go build -o bin/mizu mizu.go
|
.DEFAULT_GOAL := help
|
||||||
|
|
||||||
build-cr:
|
help: ## This help.
|
||||||
|
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
|
||||||
|
|
||||||
|
build: ## build mizu CLI binary (select platform via GOOS / GOARCH env variables)
|
||||||
|
go build -o bin/$(FOLDER)/mizu mizu.go
|
||||||
|
|
||||||
|
build-all: ## build for all supported platforms
|
||||||
@echo "Compiling for every OS and Platform"
|
@echo "Compiling for every OS and Platform"
|
||||||
@echo ""
|
@$(MAKE) build GOOS=darwin GOARCH=amd64
|
||||||
GOOS=darwin GOARCH=amd64 go build -o bin/mizu-darwin-amd64 mizu.go
|
@$(MAKE) build GOOS=linux GOARCH=amd64
|
||||||
GOOS=linux GOARCH=amd64 go build -o bin/mizu-linux-amd64 mizu.go
|
@# $(MAKE) GOOS=windows GOARCH=amd64
|
||||||
@#GOOS=windows GOARCH=amd64 go build -o bin/mizu-windows-amd64.exe mizu.go
|
@# $(MAKE) GOOS=linux GOARCH=386
|
||||||
@#GOOS=linux GOARCH=386 go build -o bin/mizu-linux-386 mizu.go
|
@# $(MAKE) GOOS=windows GOARCH=386
|
||||||
@#GOOS=windows GOARCH=386 go build -o bin/mizu-windows-386.exe mizu.go
|
@# $(MAKE) GOOS=darwin GOARCH=arm64
|
||||||
@#GOOS=darwin GOARCH=arm64 go build -o bin/mizu-darwin-arm64 mizu.go
|
@# $(MAKE) GOOS=linux GOARCH=arm64
|
||||||
@#GOOS=linux GOARCH=arm64 go build -o bin/mizu-linux-arm64 mizu.go
|
@# $(MAKE) GOOS=windows GOARCH=arm64
|
||||||
@#GOOS=windows GOARCH=arm64 go build -o bin/mizu-windows-arm64 mizu.go
|
@echo "---------"
|
||||||
|
@find ./bin -ls
|
||||||
|
|
||||||
clean:
|
clean: ## clean all build artifacts
|
||||||
#go clean
|
go clean
|
||||||
rm -f ./bin/*
|
rm -rf ./bin/*
|
||||||
|
Loading…
Reference in New Issue
Block a user