Makefile: Force use drone-cli 1.4.0 version (#40385)

* Force use drone-cli 1.4.0

* Small modifications to prevent null generation

* Sign drone

* Use bingo to declare drone-cli version

* Update message in Makefile

* Update to latest grabpl version
This commit is contained in:
Dimitris Sotirakis 2021-10-14 17:02:45 +03:00 committed by GitHub
parent 534e6b3f5a
commit 89e7a56714
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 1790 additions and 2001 deletions

View File

@ -1,4 +1,4 @@
# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.4.3. DO NOT EDIT.
# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.5.1. DO NOT EDIT.
# All tools are designed to be build inside $GOBIN.
BINGO_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
GOPATH ?= $(shell go env GOPATH)
@ -7,16 +7,22 @@ GO ?= $(shell which go)
# Below generated variables ensure that every time a tool under each variable is invoked, the correct version
# will be used; reinstalling only if needed.
# For example for wire variable:
# For example for drone variable:
#
# In your main Makefile (for non array binaries):
#
#include .bingo/Variables.mk # Assuming -dir was set to .bingo .
#
#command: $(WIRE)
# @echo "Running wire"
# @$(WIRE) <flags/args..>
#command: $(DRONE)
# @echo "Running drone"
# @$(DRONE) <flags/args..>
#
DRONE := $(GOBIN)/drone-v1.4.0
$(DRONE): $(BINGO_DIR)/drone.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/drone-v1.4.0"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=drone.mod -o=$(GOBIN)/drone-v1.4.0 "github.com/drone/drone-cli/drone"
WIRE := $(GOBIN)/wire-v0.5.0
$(WIRE): $(BINGO_DIR)/wire.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.

7
.bingo/drone.mod Normal file
View File

@ -0,0 +1,7 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.17
replace github.com/docker/docker => github.com/docker/engine v17.12.0-ce-rc1.0.20200309214505-aa6a9891b09c+incompatible
require github.com/drone/drone-cli v1.4.0 // drone

View File

@ -1,4 +1,4 @@
# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.4.3. DO NOT EDIT.
# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.5.1. DO NOT EDIT.
# All tools are designed to be build inside $GOBIN.
# Those variables will work only until 'bingo get' was invoked, or if tools were installed via Makefile's Variables.mk.
GOBIN=${GOBIN:=$(go env GOBIN)}
@ -8,5 +8,7 @@ if [ -z "$GOBIN" ]; then
fi
DRONE="${GOBIN}/drone-v1.4.0"
WIRE="${GOBIN}/wire-v0.5.0"

3731
.drone.yml

File diff suppressed because it is too large Load Diff

View File

@ -15,6 +15,9 @@ SH_FILES ?= $(shell find ./scripts -name *.sh)
all: deps build
drone-version:
DRONE_VERSION := $(shell drone -v | cut -d' ' -f3)
##@ Dependencies
deps-go: ## Install backend dependencies.
@ -151,9 +154,12 @@ clean: ## Clean up intermediate build artifacts.
# Use this make target to regenerate the configuration YAML files when
# you modify starlark files.
drone:
drone starlark
drone lint
drone --server https://drone.grafana.net sign --save grafana/grafana
@if [ "$(DRONE_VERSION)" != "1.4.0" ]; then\
echo "WARN: You are using drone-cli ${DRONE_VERSION}. Please update your LOCAL version to 1.4.0. Using latest bingo version...";\
fi
$(DRONE) starlark --format
$(DRONE) lint .drone.yml
$(DRONE) --server https://drone.grafana.net sign --save grafana/grafana
help: ## Display this help.
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)

View File

@ -113,7 +113,6 @@ def get_steps(edition, ver_mode):
package_step(edition=edition, ver_mode=ver_mode),
e2e_tests_server_step(edition=edition),
e2e_tests_step(edition=edition, tries=3),
build_storybook_step(edition=edition, ver_mode=ver_mode),
copy_packages_for_docker_step(),
build_docker_images_step(edition=edition, ver_mode=ver_mode, publish=should_publish),
build_docker_images_step(edition=edition, ver_mode=ver_mode, ubuntu=True, publish=should_publish),
@ -121,6 +120,10 @@ def get_steps(edition, ver_mode):
mysql_integration_tests_step(),
])
build_storybook = build_storybook_step(edition=edition, ver_mode=ver_mode)
if build_storybook:
steps.append(build_storybook)
if include_enterprise2:
steps.extend([redis_integration_tests_step(), memcached_integration_tests_step()])
@ -128,10 +131,12 @@ def get_steps(edition, ver_mode):
steps.append(upload_cdn_step(edition=edition))
steps.append(upload_packages_step(edition=edition, ver_mode=ver_mode))
if should_publish:
steps.extend([
publish_storybook_step(edition=edition, ver_mode=ver_mode),
release_npm_packages_step(edition=edition, ver_mode=ver_mode),
])
publish_step = publish_storybook_step(edition=edition, ver_mode=ver_mode)
release_npm_step = release_npm_packages_step(edition=edition, ver_mode=ver_mode)
if publish_step:
steps.append(publish_step)
if release_npm_step:
steps.append(release_npm_step)
windows_steps = get_windows_steps(edition=edition, ver_mode=ver_mode)
if include_enterprise2:
@ -143,7 +148,9 @@ def get_steps(edition, ver_mode):
upload_cdn_step(edition=edition2),
])
if should_upload:
steps.append(upload_packages_step(edition=edition2, ver_mode=ver_mode))
step = upload_packages_step(edition=edition2, ver_mode=ver_mode)
if step:
steps.append(step)
return steps, windows_steps

View File

@ -1,6 +1,6 @@
load('scripts/drone/vault.star', 'from_secret', 'github_token', 'pull_secret', 'drone_token')
grabpl_version = '2.5.1'
grabpl_version = '2.5.2'
build_image = 'grafana/build-container:1.4.3'
publish_image = 'grafana/grafana-ci-deploy:1.3.1'
grafana_docker_image = 'grafana/drone-grafana-docker:0.3.2'