mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-08-12 05:43:34 +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:
|
||||
push:
|
||||
branches:
|
||||
@ -23,8 +23,8 @@ jobs:
|
||||
type=sha
|
||||
type=raw,${{ github.sha }}
|
||||
type=raw,latest
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v1
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
registry: gcr.io
|
||||
username: _json_key
|
||||
@ -35,4 +35,5 @@ jobs:
|
||||
context: .
|
||||
push: true
|
||||
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
|
||||
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
|
||||
@(cd ui; npm i ; npm run build; )
|
||||
@ls -l ui/build
|
||||
|
||||
cli: # build CLI
|
||||
@(cd cli; echo "building cli" )
|
||||
@echo "building cli"; cd cli && $(MAKE) build
|
||||
|
||||
api: ## build API server
|
||||
@(echo "building API server .." )
|
||||
@(cd api; go build -o build/apiserver main.go)
|
||||
@ls -l api/build
|
||||
|
||||
tap: ## build tap binary
|
||||
@(cd tap; go build -o build/tap ./src)
|
||||
@ls -l tap/build
|
||||
#tap: ## build tap binary
|
||||
# @(cd tap; go build -o build/tap ./src)
|
||||
# @ls -l tap/build
|
||||
|
||||
docker: ## build 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
|
||||
|
||||
publish: ## build and publish Mizu docker image & CLI
|
||||
@echo "publishing Docker image .. "
|
||||
push-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
|
||||
@ -52,10 +65,7 @@ clean-api:
|
||||
@(rm -rf api/build ; echo "api cleanup done" )
|
||||
|
||||
clean-cli:
|
||||
@(echo "CLI cleanup - NOT IMPLEMENTED YET " )
|
||||
|
||||
clean-tap:
|
||||
@(cd tap; rm -rf build ; echo "tap cleanup done")
|
||||
@(cd cli; make clean ; echo "CLI cleanup done" )
|
||||
|
||||
clean-docker:
|
||||
@(echo "DOCKER cleanup - NOT IMPLEMENTED YET " )
|
||||
|
40
cli/Makefile
40
cli/Makefile
@ -1,21 +1,27 @@
|
||||
install:
|
||||
go build install mizu.go
|
||||
FOLDER=$(GOOS).$(GOARCH)
|
||||
|
||||
build:
|
||||
go build -o bin/mizu mizu.go
|
||||
.PHONY: help
|
||||
.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 ""
|
||||
GOOS=darwin GOARCH=amd64 go build -o bin/mizu-darwin-amd64 mizu.go
|
||||
GOOS=linux GOARCH=amd64 go build -o bin/mizu-linux-amd64 mizu.go
|
||||
@#GOOS=windows GOARCH=amd64 go build -o bin/mizu-windows-amd64.exe mizu.go
|
||||
@#GOOS=linux GOARCH=386 go build -o bin/mizu-linux-386 mizu.go
|
||||
@#GOOS=windows GOARCH=386 go build -o bin/mizu-windows-386.exe mizu.go
|
||||
@#GOOS=darwin GOARCH=arm64 go build -o bin/mizu-darwin-arm64 mizu.go
|
||||
@#GOOS=linux GOARCH=arm64 go build -o bin/mizu-linux-arm64 mizu.go
|
||||
@#GOOS=windows GOARCH=arm64 go build -o bin/mizu-windows-arm64 mizu.go
|
||||
@$(MAKE) build GOOS=darwin GOARCH=amd64
|
||||
@$(MAKE) build GOOS=linux GOARCH=amd64
|
||||
@# $(MAKE) GOOS=windows GOARCH=amd64
|
||||
@# $(MAKE) GOOS=linux GOARCH=386
|
||||
@# $(MAKE) GOOS=windows GOARCH=386
|
||||
@# $(MAKE) GOOS=darwin GOARCH=arm64
|
||||
@# $(MAKE) GOOS=linux GOARCH=arm64
|
||||
@# $(MAKE) GOOS=windows GOARCH=arm64
|
||||
@echo "---------"
|
||||
@find ./bin -ls
|
||||
|
||||
clean:
|
||||
#go clean
|
||||
rm -f ./bin/*
|
||||
clean: ## clean all build artifacts
|
||||
go clean
|
||||
rm -rf ./bin/*
|
||||
|
Loading…
Reference in New Issue
Block a user