diff --git a/Makefile b/Makefile index 83d71031f5a..45544ca5e8a 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ WIRE_TAGS = "oss" -include local/Makefile include .bingo/Variables.mk -.PHONY: all deps-go deps-js deps build-go build-server build-cli build-js build build-docker-dev build-docker-full lint-go golangci-lint test-go test-js gen-ts test run run-frontend clean devenv devenv-down protobuf drone help +.PHONY: all deps-go deps-js deps build-go build-server build-cli build-js build build-docker-full lint-go golangci-lint test-go test-js gen-ts test run run-frontend clean devenv devenv-down protobuf drone help GO = go GO_FILES ?= ./pkg/... @@ -95,13 +95,6 @@ shellcheck: $(SH_FILES) ## Run checks for shell scripts. ##@ Docker -build-docker-dev: ## Build Docker image for development (fast). - @echo "build development container" - @echo "\033[92mInfo:\033[0m the frontend code is expected to be built already." - $(GO) run build.go -goos linux -pkg-arch amd64 ${OPT} build latest - cp dist/grafana-latest.linux-x64.tar.gz packaging/docker - cd packaging/docker && docker build --tag grafana/grafana:dev . - build-docker-full: ## Build Docker image for development. @echo "build docker container" docker build --tag grafana/grafana:dev . diff --git a/contribute/developer-guide.md b/contribute/developer-guide.md index 1ea45276b16..b00046245fd 100644 --- a/contribute/developer-guide.md +++ b/contribute/developer-guide.md @@ -204,11 +204,6 @@ make build-docker-full The resulting image will be tagged as grafana/grafana:dev. -> **Note:** If you've already set up a local development environment, and you're running a `linux/amd64` machine, you can speed up building the Docker image: - -1. Build the frontend: `go run build.go build-frontend`. -1. Build the Docker image: `make build-docker-dev`. - **Note:** If you are using Docker for macOS, be sure to set the memory limit to be larger than 2 GiB. Otherwise, `grunt build` may fail. The memory limit settings are available under **Docker Desktop** -> **Preferences** -> **Advanced**. ## Troubleshooting diff --git a/pkg/build/cmd.go b/pkg/build/cmd.go index 5817cee0657..bd0128d0cd4 100644 --- a/pkg/build/cmd.go +++ b/pkg/build/cmd.go @@ -5,10 +5,8 @@ import ( "flag" "fmt" "go/build" - "io/ioutil" "log" "os" - "path" "path/filepath" "strconv" "strings" @@ -102,9 +100,6 @@ func RunCmd() int { return logError("error packaging dist directory", err) } - case "latest": - makeLatestDistCopies() - case "clean": clean(opts) @@ -117,35 +112,6 @@ func RunCmd() int { return 0 } -func makeLatestDistCopies() { - files, err := ioutil.ReadDir("dist") - if err != nil { - log.Fatalf("failed to create latest copies. Cannot read from /dist") - } - - latestMapping := map[string]string{ - "_amd64.deb": "dist/grafana_latest_amd64.deb", - ".x86_64.rpm": "dist/grafana-latest-1.x86_64.rpm", - ".linux-amd64.tar.gz": "dist/grafana-latest.linux-x64.tar.gz", - ".linux-amd64-musl.tar.gz": "dist/grafana-latest.linux-x64-musl.tar.gz", - ".linux-armv7.tar.gz": "dist/grafana-latest.linux-armv7.tar.gz", - ".linux-armv7-musl.tar.gz": "dist/grafana-latest.linux-armv7-musl.tar.gz", - ".linux-armv6.tar.gz": "dist/grafana-latest.linux-armv6.tar.gz", - ".linux-arm64.tar.gz": "dist/grafana-latest.linux-arm64.tar.gz", - ".linux-arm64-musl.tar.gz": "dist/grafana-latest.linux-arm64-musl.tar.gz", - } - - for _, file := range files { - for extension, fullName := range latestMapping { - if strings.HasSuffix(file.Name(), extension) { - if _, err := runError("cp", path.Join("dist", file.Name()), fullName); err != nil { - log.Println("error running cp command:", err) - } - } - } - } -} - func yarn(params ...string) { runPrint(`yarn run`, params...) }