From 01e57ec116e9f6a614244915882aa61095bc8928 Mon Sep 17 00:00:00 2001 From: Djeeberjr Date: Thu, 9 Sep 2021 22:47:48 +0200 Subject: [PATCH] added makefile --- Makefile | 34 ++++++++++++++++++++++++++++++++++ build.sh | 14 -------------- 2 files changed, 34 insertions(+), 14 deletions(-) create mode 100644 Makefile delete mode 100755 build.sh diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a67aae4 --- /dev/null +++ b/Makefile @@ -0,0 +1,34 @@ +BINARY_NAME=s3Browser + +build-web: + yarn --cwd s3browser-frontend run build + +build-backend: + cd s3browser-backend && go build -o "../${BINARY_NAME}" -tags prod ./cmd/s3Browser.go + +cp-static: + cp -r s3browser-frontend/build s3browser-backend/internal/static + +build: build-web cp-static build-backend + +clean: + rm -rf s3browser-frontend/build + rm -rf s3browser-backend/internal/static + rm -f ${BINARY_NAME} + cd s3browser-backend && go clean + +deps: + yarn --cwd s3browser-frontend install + cd s3browser-backend && go mod download + +dev-backend: + cd s3browser-backend && go run ./cmd/s3Browser.go + +dev-web: + yarn --cwd s3browser-frontend run start + +gen-schema-download: + yarn --cwd s3browser-frontend run graphql:download + +gen-schema: + yarn --cwd s3browser-frontend run graphql:gen diff --git a/build.sh b/build.sh deleted file mode 100755 index 45c0778..0000000 --- a/build.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env sh - -set -e - -# Build frontend -yarn --cwd s3browser-frontend run build - -# copy fontend build to backend for embeding - -cp -r s3browser-frontend/build s3browser-backend/internal/static - -# Build backend -cd s3browser-backend -go build -o s3browser -tags prod ./cmd/s3Browser.go