From 77d69a9954ec8873cedbfb9b7d267d5f6b039730 Mon Sep 17 00:00:00 2001 From: Michel Vocks Date: Tue, 26 Jun 2018 17:12:13 +0200 Subject: [PATCH] Prepared gaia for first release and added new steps to make file --- .gitignore | 2 ++ Makefile | 23 ++++++++++++++++++----- cmd/gaia/main.go | 12 ++++++++++++ frontend/build/webpack.dev.conf.js | 2 +- frontend/build/webpack.prod.conf.js | 2 +- frontend/client/assets/favicon.ico | Bin 0 -> 15086 bytes gaia.go | 2 ++ handlers/User.go | 7 ++----- handlers/handler.go | 27 ++++++++++++++++++++++++--- 9 files changed, 62 insertions(+), 15 deletions(-) create mode 100644 frontend/client/assets/favicon.ico diff --git a/.gitignore b/.gitignore index c28723a9..67b8bb3d 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,8 @@ *.so *.dylib *.db +rice-box.go +gaia-linux-amd64 # Test binary, build with `go test -c` *.test diff --git a/Makefile b/Makefile index 17a36525..52f859cb 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,20 @@ -default: run +default: dev -build: ./cmd/gaia/main.go - go install ./cmd/gaia/ +dev: + go run ./cmd/gaia/main.go -homepath=${PWD}/tmp -dev true -run: build - gaia -homepath=${PWD}/tmp \ No newline at end of file +compile_frontend: + cd ./frontend && \ + rm -rf dist && \ + npm install && \ + npm run build + +static_assets: + go get github.com/GeertJohan/go.rice && \ + go get github.com/GeertJohan/go.rice/rice && \ + cd ./handlers && \ + rm -f rice-box.go && \ + rice embed-go + +release: compile_frontend static_assets + env GOOS=linux GOARCH=amd64 go build -o gaia-linux-amd64 ./cmd/gaia/main.go \ No newline at end of file diff --git a/cmd/gaia/main.go b/cmd/gaia/main.go index 1cba1020..690949d0 100644 --- a/cmd/gaia/main.go +++ b/cmd/gaia/main.go @@ -2,6 +2,7 @@ package main import ( "flag" + "fmt" "os" "path/filepath" @@ -19,6 +20,9 @@ var ( ) const ( + // Version is the current version of gaia. + Version = "0.1.1" + dataFolder = "data" pipelinesFolder = "pipelines" workspaceFolder = "workspace" @@ -31,6 +35,8 @@ func init() { flag.StringVar(&gaia.Cfg.ListenPort, "port", "8080", "Listen port for gaia") flag.StringVar(&gaia.Cfg.HomePath, "homepath", "", "Path to the gaia home folder") flag.IntVar(&gaia.Cfg.Workers, "workers", 2, "Number of workers gaia will use to execute pipelines in parallel") + flag.BoolVar(&gaia.Cfg.DevMode, "dev", false, "If true, gaia will be started in development mode. Don't use this in production!") + flag.BoolVar(&gaia.Cfg.VersionSwitch, "version", false, "If true, will print the version and immediately exit") // Default values gaia.Cfg.Bolt.Mode = 0600 @@ -40,6 +46,12 @@ func main() { // Parse command line flgs flag.Parse() + // Check version switch + if gaia.Cfg.VersionSwitch { + fmt.Printf("Gaia Version: V%s\n", Version) + os.Exit(0) + } + // Initialize shared logger gaia.Cfg.Logger = hclog.New(&hclog.LoggerOptions{ Level: hclog.Trace, diff --git a/frontend/build/webpack.dev.conf.js b/frontend/build/webpack.dev.conf.js index 38908de3..0a626587 100755 --- a/frontend/build/webpack.dev.conf.js +++ b/frontend/build/webpack.dev.conf.js @@ -36,7 +36,7 @@ module.exports = merge(baseWebpackConfig, { filename: 'index.html', template: 'index.html', inject: true, - favicon: 'client/assets/logo.png' + favicon: 'client/assets/favicon.ico' }) ] }) diff --git a/frontend/build/webpack.prod.conf.js b/frontend/build/webpack.prod.conf.js index 1077fc53..a099bfa6 100755 --- a/frontend/build/webpack.prod.conf.js +++ b/frontend/build/webpack.prod.conf.js @@ -57,7 +57,7 @@ const webpackConfig = merge(baseWebpackConfig, { : config.build.index, template: 'index.html', inject: true, - favicon: 'client/assets/logo.png', + favicon: 'client/assets/favicon.ico', minify: { removeComments: true, collapseWhitespace: true, diff --git a/frontend/client/assets/favicon.ico b/frontend/client/assets/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..08a348a9852070ce1f5a2b23420d4594bf2ea850 GIT binary patch literal 15086 zcmeHO30PBC_77TX)wXKuUX?{bkS!#Tu!ki9k^mtKy9)}+BJPSJDyR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