Skip to content

Commit

Permalink
upd v2
Browse files Browse the repository at this point in the history
  • Loading branch information
xzyaoi committed Feb 22, 2021
1 parent 29c7318 commit 323b96f
Show file tree
Hide file tree
Showing 314 changed files with 14,137 additions and 20,243 deletions.
15 changes: 0 additions & 15 deletions .deepsource.toml

This file was deleted.

35 changes: 0 additions & 35 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

17 changes: 0 additions & 17 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

13 changes: 0 additions & 13 deletions .github/ISSUE_TEMPLATE/official-model-request.md

This file was deleted.

59 changes: 0 additions & 59 deletions .github/workflows/cmd.yml

This file was deleted.

27 changes: 0 additions & 27 deletions .github/workflows/dashboard.yml

This file was deleted.

51 changes: 0 additions & 51 deletions .github/workflows/discovery.yml

This file was deleted.

19 changes: 0 additions & 19 deletions .semaphore/semaphore.yml

This file was deleted.

8 changes: 0 additions & 8 deletions .whitesource

This file was deleted.

11 changes: 0 additions & 11 deletions SECURITY.md

This file was deleted.

10 changes: 0 additions & 10 deletions components/Makefile

This file was deleted.

10 changes: 7 additions & 3 deletions components/cmd/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
dist/
c.out
tests/
.env
.idea/
aid
tui/blob.go
ent/generated
.vscode/
internal/runtime/docker/blob.go
21 changes: 0 additions & 21 deletions components/cmd/LICENSE

This file was deleted.

37 changes: 22 additions & 15 deletions components/cmd/Makefile
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
# Copyright (c) 2021 Xiaozhe Yao et al.
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
default:
@echo "Make sure you are inside components/cmd. This Makefile is ONLY for CMD"
@echo "==========================================="
@echo "==== This Makefile is for AID TUI Only ===="
@echo "==========================================="
@echo "Usage:"
@echo "\tmake format\t Format all go code"
@echo "\tmake test\t Run Go Test"
@echo "\tmake build \t Build for local arch"
@echo "\tmake xbuild \t Build for different platforms"
@echo "\tmake format\t\t Format all go code"
@echo "\tmake generate-bins\t Ensemble binary assets"
@echo "\tmake generate-ent\t Generate entities"
@echo "\tmake build-cli\t\t Build binary executable"

BUILDTIME := $(shell date +%FT%T%Z)
format:
gofmt -l -s -w **/**/*.go

test:
go test -race -coverprofile c.out -v ./...
rm -rf **/**/logs/

build:
bash ./build.sh
generate-bins:
go-bindata -pkg docker -o internal/runtime/docker/blob.go internal/assets/

xbuild:
bash ./xbuild.sh
generate-ent:
rm -rf ./ent/generated
mkdir ./ent/generated
entc generate ./ent/schema --target ./ent/generated

upload-edge:
bash ./scripts/upload-edge.sh
build-cli:
# make generate-bins
cd tui && go build -ldflags "-s -w -X main.Version="dev" -X main.Build=$(BUILDTIME)" -o aid
cd tui && mv aid ../
1 change: 1 addition & 0 deletions components/cmd/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# AID Command Line Utility @ Next
26 changes: 4 additions & 22 deletions components/cmd/build.sh
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,23 +1,5 @@
#!/bin/bash
package_name="aid"
platforms=("windows/amd64" "darwin/amd64" "linux/amd64" "linux/arm64")
VERSION="$(git describe --tags)"
BUILD="$(date +%FT%T%z)"
for platform in "${platforms[@]}"
do
platform_split=(${platform//\// })
GOOS=${platform_split[0]}
GOARCH=${platform_split[1]}
echo "Building AID Command Line Utility for '$GOOS'/'$GOARCH'..."
output_name=$package_name'-'$GOOS'-'$GOARCH'-'$VERSION
if [ $GOOS = "windows" ]; then
output_name+=".exe"
fi
env CGO_ENABLED=1 GOOS=$GOOS GOARCH=$GOARCH go build -ldflags "-s -w -X main.Version=${VERSION} -X main.Build=${BUILD}" -o 'dist/'$output_name entry/*.go
if [ $? -ne 0 ]; then
echo "An error has occurred! Aborting the script execution..."
exit 1
fi
done
# Copyright (c) 2021 Xiaozhe Yao et al.
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT

echo "Successfully built AID Command Line Utility, please go to components/cmd/dist/"
3 changes: 3 additions & 0 deletions components/cmd/ent/generate.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package ent

//go:generate go run github.com/facebook/ent/cmd/entc generate ./schema
Loading

0 comments on commit 323b96f

Please sign in to comment.