From 745e97087d93f5bbed63f33266929df8f4b17869 Mon Sep 17 00:00:00 2001 From: Jo Date: Fri, 23 Aug 2024 18:40:11 +0200 Subject: [PATCH] Revert "Chore: Update go-jose v2 to v3 and retryable http" (#92370) * Revert "Chore: Update go-jose v2 to v3 and retryable http (#92116)" This reverts commit 3b10249060f08a87bfe71a80e8afd74f59f3b6c5. * recommit jose upgrade * fix swagger gen * openapi3-gen * openapi3-gen --- .bingo/Variables.mk | 6 +- .bingo/golangci-lint.mod | 2 +- .bingo/golangci-lint.sum | 45 - .bingo/variables.env | 2 +- .drone.yml | 5149 ++++++++++++++++++++++++++++++- .golangci.toml | 6 +- Dockerfile | 124 +- go.mod | 2 +- go.sum | 6 - go.work | 2 +- pkg/build/go.mod | 4 +- pkg/util/xorm/go.mod | 2 +- public/api-enterprise-spec.json | 6 +- public/api-merged.json | 6 +- public/openapi3.json | 6 +- scripts/drone/variables.star | 2 +- 16 files changed, 5156 insertions(+), 214 deletions(-) diff --git a/.bingo/Variables.mk b/.bingo/Variables.mk index a8a67dd3c95..fe40fe333d8 100644 --- a/.bingo/Variables.mk +++ b/.bingo/Variables.mk @@ -35,11 +35,11 @@ $(DRONE): $(BINGO_DIR)/drone.mod @echo "(re)installing $(GOBIN)/drone-v1.5.0" @cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=drone.mod -o=$(GOBIN)/drone-v1.5.0 "github.com/drone/drone-cli/drone" -GOLANGCI_LINT := $(GOBIN)/golangci-lint-v1.60.1 +GOLANGCI_LINT := $(GOBIN)/golangci-lint-v1.59.1 $(GOLANGCI_LINT): $(BINGO_DIR)/golangci-lint.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)/golangci-lint-v1.60.1" - @cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=golangci-lint.mod -o=$(GOBIN)/golangci-lint-v1.60.1 "github.com/golangci/golangci-lint/cmd/golangci-lint" + @echo "(re)installing $(GOBIN)/golangci-lint-v1.59.1" + @cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=golangci-lint.mod -o=$(GOBIN)/golangci-lint-v1.59.1 "github.com/golangci/golangci-lint/cmd/golangci-lint" JB := $(GOBIN)/jb-v0.5.1 $(JB): $(BINGO_DIR)/jb.mod diff --git a/.bingo/golangci-lint.mod b/.bingo/golangci-lint.mod index 1f1b91adea6..f86371c323d 100644 --- a/.bingo/golangci-lint.mod +++ b/.bingo/golangci-lint.mod @@ -2,4 +2,4 @@ module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT go 1.22.5 -require github.com/golangci/golangci-lint v1.60.1 // cmd/golangci-lint +require github.com/golangci/golangci-lint v1.59.1 // cmd/golangci-lint diff --git a/.bingo/golangci-lint.sum b/.bingo/golangci-lint.sum index 70ab132f90a..8c66f1145de 100644 --- a/.bingo/golangci-lint.sum +++ b/.bingo/golangci-lint.sum @@ -187,20 +187,14 @@ github.com/Antonboom/nilnil v0.1.9 h1:eKFMejSxPSA9eLSensFmjW2XTgTwJMjZ8hUHtV4s/S github.com/Antonboom/nilnil v0.1.9/go.mod h1:iGe2rYwCq5/Me1khrysB4nwI7swQvjclR8/YRPl5ihQ= github.com/Antonboom/testifylint v1.3.1 h1:Uam4q1Q+2b6H7gvk9RQFw6jyVDdpzIirFOOrbs14eG4= github.com/Antonboom/testifylint v1.3.1/go.mod h1:NV0hTlteCkViPW9mSR4wEMfwp+Hs1T3dY60bkvSfhpM= -github.com/Antonboom/testifylint v1.4.3 h1:ohMt6AHuHgttaQ1xb6SSnxCeK4/rnK7KKzbvs7DmEck= -github.com/Antonboom/testifylint v1.4.3/go.mod h1:+8Q9+AOLsz5ZiQiiYujJKs9mNz398+M6UgslP4qgJLA= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak= github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0= github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= -github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c h1:pxW6RcqyfI9/kWtOwnv/G+AzdKuy2ZrqINhenH4HyNs= -github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/Crocmagnon/fatcontext v0.2.2 h1:OrFlsDdOj9hW/oBEJBNSuH7QWf+E9WPVHw+x52bXVbk= github.com/Crocmagnon/fatcontext v0.2.2/go.mod h1:WSn/c/+MMNiD8Pri0ahRj0o9jVpeowzavOQplBJw6u0= -github.com/Crocmagnon/fatcontext v0.4.0 h1:4ykozu23YHA0JB6+thiuEv7iT6xq995qS1vcuWZq0tg= -github.com/Crocmagnon/fatcontext v0.4.0/go.mod h1:ZtWrXkgyfsYPzS6K3O88va6t2GEglG93vnII/F94WC0= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 h1:sHglBQTwgx+rWPdisA5ynNEsoARbiCBOyGcJM4/OzsM= github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= @@ -208,8 +202,6 @@ github.com/GaijinEntertainment/go-exhaustruct/v2 v2.3.0 h1:+r1rSv4gvYn0wmRjC8X7I github.com/GaijinEntertainment/go-exhaustruct/v2 v2.3.0/go.mod h1:b3g59n2Y+T5xmcxJL+UEG2f8cQploZm1mR/v6BW0mU0= github.com/GaijinEntertainment/go-exhaustruct/v3 v3.2.0 h1:sATXp1x6/axKxz2Gjxv8MALP0bXaNRfQinEwyfMcx8c= github.com/GaijinEntertainment/go-exhaustruct/v3 v3.2.0/go.mod h1:Nl76DrGNJTA1KJ0LePKBw/vznBX1EHbAZX8mwjR82nI= -github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.0 h1:/fTUt5vmbkAcMBt4YQiuC23cV0kEsN1MVMNqeOW43cU= -github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.0/go.mod h1:ONJg5sxcbsdQQ4pOW8TGdTidT2TMAUy/2Xhr8mrYaao= github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c/go.mod h1:X0CRv0ky0k6m906ixxpzmDRLvX58TFUKS2eePweuyxk= github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= @@ -274,8 +266,6 @@ github.com/bombsimon/wsl/v3 v3.4.0 h1:RkSxjT3tmlptwfgEgTgU+KYKLI35p/tviNXNXiL2aN github.com/bombsimon/wsl/v3 v3.4.0/go.mod h1:KkIB+TXkqy6MvK9BDZVbZxKNYsE1/oLRJbIFtf14qqo= github.com/bombsimon/wsl/v4 v4.2.1 h1:Cxg6u+XDWff75SIFFmNsqnIOgob+Q9hG6y/ioKbRFiM= github.com/bombsimon/wsl/v4 v4.2.1/go.mod h1:Xu/kDxGZTofQcDGCtQe9KCzhHphIe0fDuyWTxER9Feo= -github.com/bombsimon/wsl/v4 v4.4.1 h1:jfUaCkN+aUpobrMO24zwyAMwMAV5eSziCkOKEauOLdw= -github.com/bombsimon/wsl/v4 v4.4.1/go.mod h1:Xu/kDxGZTofQcDGCtQe9KCzhHphIe0fDuyWTxER9Feo= github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= github.com/breml/bidichk v0.2.3 h1:qe6ggxpTfA8E75hdjWPZ581sY3a2lnl0IRxLQFelECI= github.com/breml/bidichk v0.2.3/go.mod h1:8u2C6DnAy0g2cEq+k/A2+tr9O1s+vHGxWn0LTc70T2A= @@ -340,7 +330,6 @@ github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSV github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cristalhq/acmd v0.12.0/go.mod h1:LG5oa43pE/BbxtfMoImHCQN++0Su7dzipdgBjMCBVDQ= github.com/curioswitch/go-reassign v0.2.0 h1:G9UZyOcpk/d7Gd6mqYgd8XYWFMw/znxwGDUstnC9DIo= @@ -454,8 +443,6 @@ github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MG github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= -github.com/gofrs/flock v0.12.1 h1:MTLVXXHf8ekldpJk3AKicLij9MdwOWkZ+a/jHHZby9E= -github.com/gofrs/flock v0.12.1/go.mod h1:9zxTsyu5xtJ9DK+1tFZyibEV7y3uwDxPPfbxeeHCoD0= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= @@ -507,8 +494,6 @@ github.com/golangci/golangci-lint v1.51.2 h1:yIcsT1X9ZYHdSpeWXRT1ORC/FPGSqDHbHsu github.com/golangci/golangci-lint v1.51.2/go.mod h1:KH9Q7/3glwpYSknxUgUyLlAv46A8fsSKo1hH2wDvkr8= github.com/golangci/golangci-lint v1.59.1 h1:CRRLu1JbhK5avLABFJ/OHVSQ0Ie5c4ulsOId1h3TTks= github.com/golangci/golangci-lint v1.59.1/go.mod h1:jX5Oif4C7P0j9++YB2MMJmoNrb01NJ8ITqKWNLewThg= -github.com/golangci/golangci-lint v1.60.1 h1:DRKNqNTQRLBJZ1il5u4fvgLQCjQc7QFs0DbhksJtVJE= -github.com/golangci/golangci-lint v1.60.1/go.mod h1:jDIPN1rYaIA+ijp9OZcUmUCoQOtZ76pOlFbi15FlLJY= github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0 h1:MfyDlzVjl1hoaPzPD4Gpb/QgoRfSBR0jdhwGyAWwMSA= github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0/go.mod h1:66R6K6P6VWk9I95jvqGxkqJxVWGFy9XlDwLwVz1RCFg= github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca h1:kNY3/svz5T29MYHubXix4aDDuE3RWHkPvopM/EDv/MA= @@ -663,8 +648,6 @@ github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af h1:KA9B github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af/go.mod h1:HEWGJkRDzjJY2sqdDwxccsGicWEf9BQOZsq2tV+xzM0= github.com/jjti/go-spancheck v0.6.1 h1:ZK/wE5Kyi1VX3PJpUO2oEgeoI4FWOUm7Shb2Gbv5obI= github.com/jjti/go-spancheck v0.6.1/go.mod h1:vF1QkOO159prdo6mHRxak2CpzDpHAfKiPUDP/NeRnX8= -github.com/jjti/go-spancheck v0.6.2 h1:iYtoxqPMzHUPp7St+5yA8+cONdyXD3ug6KK15n7Pklk= -github.com/jjti/go-spancheck v0.6.2/go.mod h1:+X7lvIrR5ZdUTkxFYqzJ0abr8Sb5LOo80uOhWNqIrYA= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jmoiron/sqlx v1.3.5/go.mod h1:nRVWtLre0KfCLJvgxzCsLVMogSvQ1zNJtpYr2Ccp0mQ= @@ -779,8 +762,6 @@ github.com/mgechev/revive v1.2.5 h1:UF9AR8pOAuwNmhXj2odp4mxv9Nx2qUIwVz8ZsU+Mbec= github.com/mgechev/revive v1.2.5/go.mod h1:nFOXent79jMTISAfOAasKfy0Z2Ejq0WX7Qn/KAdYopI= github.com/mgechev/revive v1.3.7 h1:502QY0vQGe9KtYJ9FpxMz9rL+Fc/P13CI5POL4uHCcE= github.com/mgechev/revive v1.3.7/go.mod h1:RJ16jUbF0OWC3co/+XTxmFNgEpUPwnnA0BRllX2aDNA= -github.com/mgechev/revive v1.3.9 h1:18Y3R4a2USSBF+QZKFQwVkBROUda7uoBlkEuBD+YD1A= -github.com/mgechev/revive v1.3.9/go.mod h1:+uxEIr5UH0TjXWHTno3xh4u7eg6jDpXKzQccA9UGhHU= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/miekg/pkcs11 v1.0.3/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8/go.mod h1:mC1jAcsrzbxHt8iiaC+zU4b1ylILSosueou12R++wfY= @@ -804,8 +785,6 @@ github.com/moricho/tparallel v0.2.1 h1:95FytivzT6rYzdJLdtfn6m1bfFJylOJK41+lgv/EH github.com/moricho/tparallel v0.2.1/go.mod h1:fXEIZxG2vdfl0ZF8b42f5a78EhjjD5mX8qUplsoSU4k= github.com/moricho/tparallel v0.3.1 h1:fQKD4U1wRMAYNngDonW5XupoB/ZGJHdpzrWqgyg9krA= github.com/moricho/tparallel v0.3.1/go.mod h1:leENX2cUv7Sv2qDgdi0D0fCftN8fRC67Bcn8pqzeYNI= -github.com/moricho/tparallel v0.3.2 h1:odr8aZVFA3NZrNybggMkYO3rgPRcqjeQUlBBFVxKHTI= -github.com/moricho/tparallel v0.3.2/go.mod h1:OQ+K3b4Ln3l2TZveGCywybl68glfLEwFGqvnjok8b+U= github.com/mozilla/scribe v0.0.0-20180711195314-fb71baf557c1/go.mod h1:FIczTrinKo8VaLxe6PWTPEXRXDIHz2QAwiaBaP5/4a8= github.com/mozilla/tls-observatory v0.0.0-20210609171429-7bc42856d2e5/go.mod h1:FUqVoUPHSEdDR0MnFM3Dh8AU0pZHLXUD127SAJGER/s= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -865,8 +844,6 @@ github.com/polyfloyd/go-errorlint v1.1.0 h1:VKoEFg5yxSgJ2yFPVhxW7oGz+f8/OVcuMeNv github.com/polyfloyd/go-errorlint v1.1.0/go.mod h1:Uss7Bc/izYG0leCMRx3WVlrpqWedSZk7V/FUQW6VJ6U= github.com/polyfloyd/go-errorlint v1.5.2 h1:SJhVik3Umsjh7mte1vE0fVZ5T1gznasQG3PV7U5xFdA= github.com/polyfloyd/go-errorlint v1.5.2/go.mod h1:sH1QC1pxxi0fFecsVIzBmxtrgd9IF/SkJpA6wqyKAJs= -github.com/polyfloyd/go-errorlint v1.6.0 h1:tftWV9DE7txiFzPpztTAwyoRLKNj9gpVm2cg8/OwcYY= -github.com/polyfloyd/go-errorlint v1.6.0/go.mod h1:HR7u8wuP1kb1NeN1zqTd1ZMlqUKPPHF+Id4vIPvDqVw= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U= @@ -923,8 +900,6 @@ github.com/ryancurrah/gomodguard v1.3.0 h1:q15RT/pd6UggBXVBuLps8BXRvl5GPBcwVA7BJ github.com/ryancurrah/gomodguard v1.3.0/go.mod h1:ggBxb3luypPEzqVtq33ee7YSN35V28XeGnid8dnni50= github.com/ryancurrah/gomodguard v1.3.2 h1:CuG27ulzEB1Gu5Dk5gP8PFxSOZ3ptSdP5iI/3IXxM18= github.com/ryancurrah/gomodguard v1.3.2/go.mod h1:LqdemiFomEjcxOqirbQCb3JFvSxH2JUYMerTFd3sF2o= -github.com/ryancurrah/gomodguard v1.3.3 h1:eiSQdJVNr9KTNxY2Niij8UReSwR8Xrte3exBrAZfqpg= -github.com/ryancurrah/gomodguard v1.3.3/go.mod h1:rsKQjj4l3LXe8N344Ow7agAy5p9yjsWOtRzUMYmA0QY= github.com/ryanrolds/sqlclosecheck v0.4.0 h1:i8SX60Rppc1wRuyQjMciLqIzV3xnoHB7/tXbr6RGYNI= github.com/ryanrolds/sqlclosecheck v0.4.0/go.mod h1:TBRRjzL31JONc9i4XMinicuo+s+E8yKZ5FN8X3G6CKQ= github.com/ryanrolds/sqlclosecheck v0.5.1 h1:dibWW826u0P8jNLsLN+En7+RqWWTYrjCB9fJfSfdyCU= @@ -941,8 +916,6 @@ github.com/sashamelentyev/usestdlibvars v1.23.0 h1:01h+/2Kd+NblNItNeux0veSL5cBF1 github.com/sashamelentyev/usestdlibvars v1.23.0/go.mod h1:YPwr/Y1LATzHI93CqoPUN/2BzGQ/6N/cl/KwgR0B/aU= github.com/sashamelentyev/usestdlibvars v1.26.0 h1:LONR2hNVKxRmzIrZR0PhSF3mhCAzvnr+DcUiHgREfXE= github.com/sashamelentyev/usestdlibvars v1.26.0/go.mod h1:9nl0jgOfHKWNFS43Ojw0i7aRoS4j6EBye3YBhmAIRF8= -github.com/sashamelentyev/usestdlibvars v1.27.0 h1:t/3jZpSXtRPRf2xr0m63i32ZrusyurIGT9E5wAvXQnI= -github.com/sashamelentyev/usestdlibvars v1.27.0/go.mod h1:9nl0jgOfHKWNFS43Ojw0i7aRoS4j6EBye3YBhmAIRF8= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/securego/gosec/v2 v2.15.0 h1:v4Ym7FF58/jlykYmmhZ7mTm7FQvN/setNm++0fgIAtw= github.com/securego/gosec/v2 v2.15.0/go.mod h1:VOjTrZOkUtSDt2QLSJmQBMWnvwiQPEjg0l+5juIqGk8= @@ -972,8 +945,6 @@ github.com/sivchari/nosnakecase v1.7.0 h1:7QkpWIRMe8x25gckkFd2A5Pi6Ymo0qgr4JrhGt github.com/sivchari/nosnakecase v1.7.0/go.mod h1:CwDzrzPea40/GB6uynrNLiorAlgFRvRbFSgJx2Gs+QY= github.com/sivchari/tenv v1.7.1 h1:PSpuD4bu6fSmtWMxSGWcvqUUgIn7k3yOJhOIzVWn8Ak= github.com/sivchari/tenv v1.7.1/go.mod h1:64yStXKSOxDfX47NlhVwND4dHwfZDdbp2Lyl018Icvg= -github.com/sivchari/tenv v1.10.0 h1:g/hzMA+dBCKqGXgW8AV/1xIWhAvDrx0zFKNR48NFMg0= -github.com/sivchari/tenv v1.10.0/go.mod h1:tdY24masnVoZFxYrHv/nD6Tc8FbkEtAQEEziXpyMgqY= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/sonatard/noctx v0.0.1 h1:VC1Qhl6Oxx9vvWo3UDgrGXYCeKCe3Wbw7qAWL6FrmTY= github.com/sonatard/noctx v0.0.1/go.mod h1:9D2D/EoULe8Yy2joDHJj7bv3sZoq9AaSb8B4lqBjiZI= @@ -992,8 +963,6 @@ github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA= github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= -github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= -github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= @@ -1071,8 +1040,6 @@ github.com/uudashr/gocognit v1.0.6 h1:2Cgi6MweCsdB6kpcVQp7EW4U23iBFQWfTXiWlyp842 github.com/uudashr/gocognit v1.0.6/go.mod h1:nAIUuVBnYU7pcninia3BHOvQkpQCeO76Uscky5BOwcY= github.com/uudashr/gocognit v1.1.2 h1:l6BAEKJqQH2UpKAPKdMfZf5kE4W/2xk8pfU1OVLvniI= github.com/uudashr/gocognit v1.1.2/go.mod h1:aAVdLURqcanke8h3vg35BC++eseDm66Z7KmchI5et4k= -github.com/uudashr/gocognit v1.1.3 h1:l+a111VcDbKfynh+airAy/DJQKaXh2m9vkoysMPSZyM= -github.com/uudashr/gocognit v1.1.3/go.mod h1:aKH8/e8xbTRBwjbCkwZ8qt4l2EpKXl31KMHgSS+lZ2U= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasthttp v1.30.0/go.mod h1:2rsYD01CKFrjjsvFxx75KlEUNpWNBY9JWD3K/7o2Cus= github.com/valyala/quicktemplate v1.7.0/go.mod h1:sqKJnoaOF88V07vkO+9FL8fb9uZg/VPSJnLYn+LmLk8= @@ -1113,8 +1080,6 @@ go-simpler.org/musttag v0.12.2 h1:J7lRc2ysXOq7eM8rwaTYnNrHd5JwjppzB6mScysB2Cs= go-simpler.org/musttag v0.12.2/go.mod h1:uN1DVIasMTQKk6XSik7yrJoEysGtR2GRqvWnI9S7TYM= go-simpler.org/sloglint v0.7.1 h1:qlGLiqHbN5islOxjeLXoPtUdZXb669RW+BDQ+xOSNoU= go-simpler.org/sloglint v0.7.1/go.mod h1:OlaVDRh/FKKd4X4sIMbsz8st97vomydceL146Fthh/c= -go-simpler.org/sloglint v0.7.2 h1:Wc9Em/Zeuu7JYpl+oKoYOsQSy2X560aVueCW/m6IijY= -go-simpler.org/sloglint v0.7.2/go.mod h1:US+9C80ppl7VsThQclkM7BkCHQAzuz8kHLsW3ppuluo= go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= go.etcd.io/etcd v0.0.0-20200513171258-e048e166ab9c/go.mod h1:xCI7ZzBfRuGgBXyXO6yfWfDmlWd35khcWpUa4L0xI/k= go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= @@ -1207,8 +1172,6 @@ golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= -golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1279,8 +1242,6 @@ golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= -golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1344,8 +1305,6 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM= -golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/telemetry v0.0.0-20240521205824-bda55230c457/go.mod h1:pRgIJT+bRLFKnoM1ldnzKoxTIn14Yxz928LQRYYgIN0= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1455,8 +1414,6 @@ golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= -golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= -golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1603,8 +1560,6 @@ honnef.co/go/tools v0.4.2 h1:6qXr+R5w+ktL5UkwEbPp+fEvfyoMPche6GkOpGHZcLc= honnef.co/go/tools v0.4.2/go.mod h1:36ZgoUOrqOk1GxwHhyryEkq8FQWkUO2xGuSMhUCcdvA= honnef.co/go/tools v0.4.7 h1:9MDAWxMoSnB6QoSqiVr7P5mtkT9pOc1kSxchzPCnqJs= honnef.co/go/tools v0.4.7/go.mod h1:+rnGS1THNh8zMwnd2oVOTL9QF6vmfyG6ZXBULae2uc0= -honnef.co/go/tools v0.5.0 h1:29uoiIormS3Z6R+t56STz/oI4v+mB51TSmEOdJPgRnE= -honnef.co/go/tools v0.5.0/go.mod h1:e9irvo83WDG9/irijV44wr3tbhcFeRnfpVlRqVwpzMs= lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= modernc.org/cc/v3 v3.40.0/go.mod h1:/bTg4dnWkSXowUO6ssQKnOV0yMVxDYNIsIrzqTFDGH0= modernc.org/ccgo/v3 v3.16.13/go.mod h1:2Quk+5YgpImhPjv2Qsob1DnZ/4som1lJTodubIcoUkY= diff --git a/.bingo/variables.env b/.bingo/variables.env index 7d52d8c32ac..1666905f40c 100644 --- a/.bingo/variables.env +++ b/.bingo/variables.env @@ -14,7 +14,7 @@ CUE="${GOBIN}/cue-v0.5.0-beta.2" DRONE="${GOBIN}/drone-v1.5.0" -GOLANGCI_LINT="${GOBIN}/golangci-lint-v1.60.1" +GOLANGCI_LINT="${GOBIN}/golangci-lint-v1.59.1" JB="${GOBIN}/jb-v0.5.1" diff --git a/.drone.yml b/.drone.yml index cfd8dad0e9b..63a5a99981e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,168 +1,5149 @@ --- -{"kind": "pipeline", "type": "docker", "name": "pr-verify-drone", "trigger": {"event": ["pull_request"], "paths": {"exclude": ["docs/**", "*.md"], "include": ["scripts/drone/**", ".drone.yml", ".drone.star"]}}, "services": [], "steps": [{"name": "identify-runner", "image": "alpine:3.19.1", "commands": ["echo $DRONE_RUNNER_NAME"]}, {"name": "compile-build-cmd", "image": "golang:1.23.0-alpine", "commands": ["go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd"], "depends_on": [], "environment": {"CGO_ENABLED": 0}}, {"name": "lint-drone", "image": "byrnedo/alpine-curl:0.1.8", "commands": ["./bin/build verify-drone"], "depends_on": ["compile-build-cmd"]}], "clone": {"retries": 3}, "volumes": [{"name": "docker", "host": {"path": "/var/run/docker.sock"}}], "depends_on": [], "image_pull_secrets": ["gcr", "gar"], "environment": {"EDITION": "oss"}, "platform": {"os": "linux", "arch": "amd64"}, "node": {"type": "no-parallel"}} +clone: + retries: 3 +depends_on: [] +environment: + EDITION: oss +image_pull_secrets: +- gcr +- gar +kind: pipeline +name: pr-verify-drone +node: + type: no-parallel +platform: + arch: amd64 + os: linux +services: [] +steps: +- commands: + - echo $DRONE_RUNNER_NAME + image: alpine:3.19.1 + name: identify-runner +- commands: + - go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd + depends_on: [] + environment: + CGO_ENABLED: 0 + image: golang:1.22.5-alpine + name: compile-build-cmd +- commands: + - ./bin/build verify-drone + depends_on: + - compile-build-cmd + image: byrnedo/alpine-curl:0.1.8 + name: lint-drone +trigger: + event: + - pull_request + paths: + exclude: + - docs/** + - '*.md' + include: + - scripts/drone/** + - .drone.yml + - .drone.star +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker --- -{"kind": "pipeline", "type": "docker", "name": "pr-verify-starlark", "trigger": {"event": ["pull_request"], "paths": {"exclude": ["docs/**", "*.md"], "include": ["scripts/drone/**", ".drone.star"]}}, "services": [], "steps": [{"name": "identify-runner", "image": "alpine:3.19.1", "commands": ["echo $DRONE_RUNNER_NAME"]}, {"name": "compile-build-cmd", "image": "golang:1.23.0-alpine", "commands": ["go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd"], "depends_on": [], "environment": {"CGO_ENABLED": 0}}, {"name": "lint-starlark", "image": "golang:1.23.0-alpine", "commands": ["go install github.com/bazelbuild/buildtools/buildifier@latest", "buildifier --lint=warn -mode=check -r ."], "depends_on": ["compile-build-cmd"]}], "clone": {"retries": 3}, "volumes": [{"name": "docker", "host": {"path": "/var/run/docker.sock"}}], "depends_on": [], "image_pull_secrets": ["gcr", "gar"], "environment": {"EDITION": "oss"}, "platform": {"os": "linux", "arch": "amd64"}, "node": {"type": "no-parallel"}} +clone: + retries: 3 +depends_on: [] +environment: + EDITION: oss +image_pull_secrets: +- gcr +- gar +kind: pipeline +name: pr-verify-starlark +node: + type: no-parallel +platform: + arch: amd64 + os: linux +services: [] +steps: +- commands: + - echo $DRONE_RUNNER_NAME + image: alpine:3.19.1 + name: identify-runner +- commands: + - go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd + depends_on: [] + environment: + CGO_ENABLED: 0 + image: golang:1.22.5-alpine + name: compile-build-cmd +- commands: + - go install github.com/bazelbuild/buildtools/buildifier@latest + - buildifier --lint=warn -mode=check -r . + depends_on: + - compile-build-cmd + image: golang:1.22.5-alpine + name: lint-starlark +trigger: + event: + - pull_request + paths: + exclude: + - docs/** + - '*.md' + include: + - scripts/drone/** + - .drone.star +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker --- -{"kind": "pipeline", "type": "docker", "name": "pr-test-frontend", "trigger": {"event": ["pull_request"], "paths": {"exclude": ["docs/**", "*.md", "pkg/**", "packaging/**", "go.sum", "go.mod"], "include": []}}, "services": [], "steps": [{"name": "identify-runner", "image": "alpine:3.19.1", "commands": ["echo $DRONE_RUNNER_NAME"]}, {"name": "yarn-install", "image": "node:20.9.0-alpine", "commands": ["yarn install --immutable"], "depends_on": []}, {"name": "betterer-frontend", "image": "node:20.9.0-alpine", "depends_on": ["yarn-install"], "commands": ["apk add --update git bash", "yarn betterer ci"]}, {"name": "clone-enterprise", "image": "alpine/git:2.40.1", "environment": {"GITHUB_TOKEN": {"from_secret": "github_token"}}, "commands": ["apk add --update curl jq bash", "is_fork=$(curl \"https://$GITHUB_TOKEN@api.github.com/repos/grafana/grafana/pulls/$DRONE_PULL_REQUEST\" | jq .head.repo.fork)", "if [ \"$is_fork\" != false ]; then return 1; fi", "git clone \"https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git\" ../grafana-enterprise", "cd ../grafana-enterprise", "if git checkout ${DRONE_SOURCE_BRANCH}; then echo \"checked out ${DRONE_SOURCE_BRANCH}\"; elif git checkout ${DRONE_TARGET_BRANCH}; then echo \"git checkout ${DRONE_TARGET_BRANCH}\"; else git checkout main; fi", "cd ../", "ln -s src grafana", "cd ./grafana-enterprise", "./build.sh"], "failure": "ignore"}, {"name": "test-frontend", "image": "node:20.9.0-alpine", "environment": {"TEST_MAX_WORKERS": "50%"}, "depends_on": ["yarn-install"], "commands": ["yarn run ci:test-frontend"]}], "clone": {"retries": 3}, "volumes": [{"name": "docker", "host": {"path": "/var/run/docker.sock"}}], "depends_on": [], "image_pull_secrets": ["gcr", "gar"], "environment": {"EDITION": "oss"}, "platform": {"os": "linux", "arch": "amd64"}, "node": {"type": "no-parallel"}} +clone: + retries: 3 +depends_on: [] +environment: + EDITION: oss +image_pull_secrets: +- gcr +- gar +kind: pipeline +name: pr-test-frontend +node: + type: no-parallel +platform: + arch: amd64 + os: linux +services: [] +steps: +- commands: + - echo $DRONE_RUNNER_NAME + image: alpine:3.19.1 + name: identify-runner +- commands: + - yarn install --immutable + depends_on: [] + image: node:20.9.0-alpine + name: yarn-install +- commands: + - apk add --update git bash + - yarn betterer ci + depends_on: + - yarn-install + image: node:20.9.0-alpine + name: betterer-frontend +- commands: + - apk add --update curl jq bash + - is_fork=$(curl "https://$GITHUB_TOKEN@api.github.com/repos/grafana/grafana/pulls/$DRONE_PULL_REQUEST" + | jq .head.repo.fork) + - if [ "$is_fork" != false ]; then return 1; fi + - git clone "https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git" + ../grafana-enterprise + - cd ../grafana-enterprise + - if git checkout ${DRONE_SOURCE_BRANCH}; then echo "checked out ${DRONE_SOURCE_BRANCH}"; + elif git checkout ${DRONE_TARGET_BRANCH}; then echo "git checkout ${DRONE_TARGET_BRANCH}"; + else git checkout main; fi + - cd ../ + - ln -s src grafana + - cd ./grafana-enterprise + - ./build.sh + environment: + GITHUB_TOKEN: + from_secret: github_token + failure: ignore + image: alpine/git:2.40.1 + name: clone-enterprise +- commands: + - yarn run ci:test-frontend + depends_on: + - yarn-install + environment: + TEST_MAX_WORKERS: 50% + image: node:20.9.0-alpine + name: test-frontend +trigger: + event: + - pull_request + paths: + exclude: + - docs/** + - '*.md' + - pkg/** + - packaging/** + - go.sum + - go.mod + include: [] +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker --- -{"kind": "pipeline", "type": "docker", "name": "pr-lint-frontend", "trigger": {"event": ["pull_request"], "paths": {"exclude": ["docs/**", "*.md", "pkg/**", "packaging/**", "go.sum", "go.mod"], "include": []}}, "services": [], "steps": [{"name": "clone-enterprise", "image": "alpine/git:2.40.1", "environment": {"GITHUB_TOKEN": {"from_secret": "github_token"}}, "commands": ["apk add --update curl jq bash", "is_fork=$(curl \"https://$GITHUB_TOKEN@api.github.com/repos/grafana/grafana/pulls/$DRONE_PULL_REQUEST\" | jq .head.repo.fork)", "if [ \"$is_fork\" != false ]; then return 1; fi", "git clone \"https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git\" ../grafana-enterprise", "cd ../grafana-enterprise", "if git checkout ${DRONE_SOURCE_BRANCH}; then echo \"checked out ${DRONE_SOURCE_BRANCH}\"; elif git checkout ${DRONE_TARGET_BRANCH}; then echo \"git checkout ${DRONE_TARGET_BRANCH}\"; else git checkout main; fi", "cd ../", "ln -s src grafana", "cd ./grafana-enterprise", "./build.sh"], "failure": "ignore"}, {"name": "identify-runner", "image": "alpine:3.19.1", "commands": ["echo $DRONE_RUNNER_NAME"]}, {"name": "yarn-install", "image": "node:20.9.0-alpine", "commands": ["yarn install --immutable"], "depends_on": []}, {"name": "lint-frontend", "image": "node:20.9.0-alpine", "environment": {"TEST_MAX_WORKERS": "50%"}, "depends_on": ["yarn-install"], "commands": ["yarn run prettier:check", "yarn run lint", "yarn run typecheck"]}, {"name": "verify-i18n", "image": "node:20.9.0-alpine", "depends_on": ["yarn-install"], "commands": ["apk add --update git", "yarn run i18n:extract || (echo \"\nExtraction failed. Make sure that you have no dynamic translation phrases, such as 't(\\`preferences.theme.\\$${themeID}\\`, themeName)' and that no translation key is used twice. Search the output for '[warning]' to find the offending file.\" \u0026\u0026 false)", "\n file_diff=$(git diff --dirstat public/locales)\n if [ -n \"$file_diff\" ]; then\n echo $file_diff\n echo \"\nTranslation extraction has not been committed. Please run 'yarn i18n:extract', commit the changes and push again.\"\n exit 1\n fi\n ", "yarn run i18n:compile"]}], "clone": {"retries": 3}, "volumes": [{"name": "docker", "host": {"path": "/var/run/docker.sock"}}], "depends_on": [], "image_pull_secrets": ["gcr", "gar"], "environment": {"EDITION": "oss"}, "platform": {"os": "linux", "arch": "amd64"}, "node": {"type": "no-parallel"}} +clone: + retries: 3 +depends_on: [] +environment: + EDITION: oss +image_pull_secrets: +- gcr +- gar +kind: pipeline +name: pr-lint-frontend +node: + type: no-parallel +platform: + arch: amd64 + os: linux +services: [] +steps: +- commands: + - apk add --update curl jq bash + - is_fork=$(curl "https://$GITHUB_TOKEN@api.github.com/repos/grafana/grafana/pulls/$DRONE_PULL_REQUEST" + | jq .head.repo.fork) + - if [ "$is_fork" != false ]; then return 1; fi + - git clone "https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git" + ../grafana-enterprise + - cd ../grafana-enterprise + - if git checkout ${DRONE_SOURCE_BRANCH}; then echo "checked out ${DRONE_SOURCE_BRANCH}"; + elif git checkout ${DRONE_TARGET_BRANCH}; then echo "git checkout ${DRONE_TARGET_BRANCH}"; + else git checkout main; fi + - cd ../ + - ln -s src grafana + - cd ./grafana-enterprise + - ./build.sh + environment: + GITHUB_TOKEN: + from_secret: github_token + failure: ignore + image: alpine/git:2.40.1 + name: clone-enterprise +- commands: + - echo $DRONE_RUNNER_NAME + image: alpine:3.19.1 + name: identify-runner +- commands: + - yarn install --immutable + depends_on: [] + image: node:20.9.0-alpine + name: yarn-install +- commands: + - yarn run prettier:check + - yarn run lint + - yarn run typecheck + depends_on: + - yarn-install + environment: + TEST_MAX_WORKERS: 50% + image: node:20.9.0-alpine + name: lint-frontend +- commands: + - apk add --update git + - |- + yarn run i18n:extract || (echo " + Extraction failed. Make sure that you have no dynamic translation phrases, such as 't(\`preferences.theme.\$${themeID}\`, themeName)' and that no translation key is used twice. Search the output for '[warning]' to find the offending file." && false) + - "\n file_diff=$(git diff --dirstat public/locales)\n if + [ -n \"$file_diff\" ]; then\n echo $file_diff\n echo + \"\nTranslation extraction has not been committed. Please run 'yarn i18n:extract', + commit the changes and push again.\"\n exit 1\n fi\n + \ " + - yarn run i18n:compile + depends_on: + - yarn-install + image: node:20.9.0-alpine + name: verify-i18n +trigger: + event: + - pull_request + paths: + exclude: + - docs/** + - '*.md' + - pkg/** + - packaging/** + - go.sum + - go.mod + include: [] +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker --- -{"kind": "pipeline", "type": "docker", "name": "pr-test-backend", "trigger": {"event": ["pull_request"], "paths": {"exclude": ["docs/**", "*.md"], "include": ["pkg/**", "packaging/**", ".drone.yml", "conf/**", "go.sum", "go.mod", "public/app/plugins/**/plugin.json", "docs/sources/setup-grafana/configure-grafana/feature-toggles/**", "devenv/**"]}}, "services": [], "steps": [{"name": "clone-enterprise", "image": "alpine/git:2.40.1", "environment": {"GITHUB_TOKEN": {"from_secret": "github_token"}}, "commands": ["apk add --update curl jq bash", "is_fork=$(curl \"https://$GITHUB_TOKEN@api.github.com/repos/grafana/grafana/pulls/$DRONE_PULL_REQUEST\" | jq .head.repo.fork)", "if [ \"$is_fork\" != false ]; then return 1; fi", "git clone \"https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git\" ../grafana-enterprise", "cd ../grafana-enterprise", "if git checkout ${DRONE_SOURCE_BRANCH}; then echo \"checked out ${DRONE_SOURCE_BRANCH}\"; elif git checkout ${DRONE_TARGET_BRANCH}; then echo \"git checkout ${DRONE_TARGET_BRANCH}\"; else git checkout main; fi", "cd ../", "ln -s src grafana", "cd ./grafana-enterprise", "./build.sh"], "failure": "ignore"}, {"name": "identify-runner", "image": "alpine:3.19.1", "commands": ["echo $DRONE_RUNNER_NAME"]}, {"name": "verify-gen-cue", "image": "golang:1.23.0-alpine", "depends_on": [], "commands": ["# It is required that code generated from Thema/CUE be committed and in sync with its inputs.", "# The following command will fail if running code generators produces any diff in output.", "apk add --update make", "CODEGEN_VERIFY=1 make gen-cue"]}, {"name": "verify-gen-jsonnet", "image": "golang:1.23.0-alpine", "depends_on": [], "commands": ["# It is required that generated jsonnet is committed and in sync with its inputs.", "# The following command will fail if running code generators produces any diff in output.", "apk add --update make", "CODEGEN_VERIFY=1 make gen-jsonnet"]}, {"name": "wire-install", "image": "golang:1.23.0-alpine", "commands": ["apk add --update make", "make gen-go"], "depends_on": ["verify-gen-cue"]}, {"name": "test-backend", "image": "golang:1.23.0-alpine", "depends_on": ["wire-install"], "commands": ["apk add --update build-base shared-mime-info shared-mime-info-lang", "go list -f '{{.Dir}}/...' -m | xargs go test -tags requires_buildifer -short -covermode=atomic -timeout=5m"]}, {"name": "test-backend-integration", "image": "golang:1.23.0-alpine", "depends_on": ["wire-install"], "commands": ["apk add --update build-base", "go test -count=1 -covermode=atomic -timeout=5m -run '^TestIntegration' $(find ./pkg -type f -name '*_test.go' -exec grep -l '^func TestIntegration' '{}' '+' | grep -o '\\(.*\\)/' | sort -u)"]}], "clone": {"retries": 3}, "volumes": [{"name": "docker", "host": {"path": "/var/run/docker.sock"}}], "depends_on": [], "image_pull_secrets": ["gcr", "gar"], "environment": {"EDITION": "oss"}, "platform": {"os": "linux", "arch": "amd64"}, "node": {"type": "no-parallel"}} +clone: + retries: 3 +depends_on: [] +environment: + EDITION: oss +image_pull_secrets: +- gcr +- gar +kind: pipeline +name: pr-test-backend +node: + type: no-parallel +platform: + arch: amd64 + os: linux +services: [] +steps: +- commands: + - apk add --update curl jq bash + - is_fork=$(curl "https://$GITHUB_TOKEN@api.github.com/repos/grafana/grafana/pulls/$DRONE_PULL_REQUEST" + | jq .head.repo.fork) + - if [ "$is_fork" != false ]; then return 1; fi + - git clone "https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git" + ../grafana-enterprise + - cd ../grafana-enterprise + - if git checkout ${DRONE_SOURCE_BRANCH}; then echo "checked out ${DRONE_SOURCE_BRANCH}"; + elif git checkout ${DRONE_TARGET_BRANCH}; then echo "git checkout ${DRONE_TARGET_BRANCH}"; + else git checkout main; fi + - cd ../ + - ln -s src grafana + - cd ./grafana-enterprise + - ./build.sh + environment: + GITHUB_TOKEN: + from_secret: github_token + failure: ignore + image: alpine/git:2.40.1 + name: clone-enterprise +- commands: + - echo $DRONE_RUNNER_NAME + image: alpine:3.19.1 + name: identify-runner +- commands: + - '# It is required that code generated from Thema/CUE be committed and in sync + with its inputs.' + - '# The following command will fail if running code generators produces any diff + in output.' + - apk add --update make + - CODEGEN_VERIFY=1 make gen-cue + depends_on: [] + image: golang:1.22.5-alpine + name: verify-gen-cue +- commands: + - '# It is required that generated jsonnet is committed and in sync with its inputs.' + - '# The following command will fail if running code generators produces any diff + in output.' + - apk add --update make + - CODEGEN_VERIFY=1 make gen-jsonnet + depends_on: [] + image: golang:1.22.5-alpine + name: verify-gen-jsonnet +- commands: + - apk add --update make + - make gen-go + depends_on: + - verify-gen-cue + image: golang:1.22.5-alpine + name: wire-install +- commands: + - apk add --update build-base shared-mime-info shared-mime-info-lang + - go list -f '{{.Dir}}/...' -m | xargs go test -tags requires_buildifer -short -covermode=atomic + -timeout=5m + depends_on: + - wire-install + image: golang:1.22.5-alpine + name: test-backend +- commands: + - apk add --update build-base + - go test -count=1 -covermode=atomic -timeout=5m -run '^TestIntegration' $(find + ./pkg -type f -name '*_test.go' -exec grep -l '^func TestIntegration' '{}' '+' + | grep -o '\(.*\)/' | sort -u) + depends_on: + - wire-install + image: golang:1.22.5-alpine + name: test-backend-integration +trigger: + event: + - pull_request + paths: + exclude: + - docs/** + - '*.md' + include: + - pkg/** + - packaging/** + - .drone.yml + - conf/** + - go.sum + - go.mod + - public/app/plugins/**/plugin.json + - docs/sources/setup-grafana/configure-grafana/feature-toggles/** + - devenv/** +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker --- -{"kind": "pipeline", "type": "docker", "name": "pr-lint-backend", "trigger": {"event": ["pull_request"], "paths": {"exclude": ["docs/**", "*.md"], "include": ["pkg/**", "packaging/**", ".drone.yml", "conf/**", "go.sum", "go.mod", "public/app/plugins/**/plugin.json", "devenv/**", ".bingo/**"]}}, "services": [], "steps": [{"name": "identify-runner", "image": "alpine:3.19.1", "commands": ["echo $DRONE_RUNNER_NAME"]}, {"name": "compile-build-cmd", "image": "golang:1.23.0-alpine", "commands": ["go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd"], "depends_on": [], "environment": {"CGO_ENABLED": 0}}, {"name": "clone-enterprise", "image": "alpine/git:2.40.1", "environment": {"GITHUB_TOKEN": {"from_secret": "github_token"}}, "commands": ["apk add --update curl jq bash", "is_fork=$(curl \"https://$GITHUB_TOKEN@api.github.com/repos/grafana/grafana/pulls/$DRONE_PULL_REQUEST\" | jq .head.repo.fork)", "if [ \"$is_fork\" != false ]; then return 1; fi", "git clone \"https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git\" ../grafana-enterprise", "cd ../grafana-enterprise", "if git checkout ${DRONE_SOURCE_BRANCH}; then echo \"checked out ${DRONE_SOURCE_BRANCH}\"; elif git checkout ${DRONE_TARGET_BRANCH}; then echo \"git checkout ${DRONE_TARGET_BRANCH}\"; else git checkout main; fi", "cd ../", "ln -s src grafana", "cd ./grafana-enterprise", "./build.sh"], "failure": "ignore"}, {"name": "wire-install", "image": "golang:1.23.0-alpine", "commands": ["apk add --update make", "make gen-go"], "depends_on": []}, {"name": "lint-backend", "image": "golang:1.23.0-alpine", "environment": {"CGO_ENABLED": "1"}, "depends_on": ["wire-install"], "commands": ["apk add --update make build-base", "make lint-go"]}, {"name": "validate-modfile", "image": "golang:1.23.0-alpine", "commands": ["go run scripts/modowners/modowners.go check go.mod"]}, {"name": "validate-openapi-spec", "image": "golang:1.23.0-alpine", "commands": ["apk add --update make", "make swagger-validate"]}], "clone": {"retries": 3}, "volumes": [{"name": "docker", "host": {"path": "/var/run/docker.sock"}}], "depends_on": [], "image_pull_secrets": ["gcr", "gar"], "environment": {"EDITION": "oss"}, "platform": {"os": "linux", "arch": "amd64"}, "node": {"type": "no-parallel"}} +clone: + retries: 3 +depends_on: [] +environment: + EDITION: oss +image_pull_secrets: +- gcr +- gar +kind: pipeline +name: pr-lint-backend +node: + type: no-parallel +platform: + arch: amd64 + os: linux +services: [] +steps: +- commands: + - echo $DRONE_RUNNER_NAME + image: alpine:3.19.1 + name: identify-runner +- commands: + - go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd + depends_on: [] + environment: + CGO_ENABLED: 0 + image: golang:1.22.5-alpine + name: compile-build-cmd +- commands: + - apk add --update curl jq bash + - is_fork=$(curl "https://$GITHUB_TOKEN@api.github.com/repos/grafana/grafana/pulls/$DRONE_PULL_REQUEST" + | jq .head.repo.fork) + - if [ "$is_fork" != false ]; then return 1; fi + - git clone "https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git" + ../grafana-enterprise + - cd ../grafana-enterprise + - if git checkout ${DRONE_SOURCE_BRANCH}; then echo "checked out ${DRONE_SOURCE_BRANCH}"; + elif git checkout ${DRONE_TARGET_BRANCH}; then echo "git checkout ${DRONE_TARGET_BRANCH}"; + else git checkout main; fi + - cd ../ + - ln -s src grafana + - cd ./grafana-enterprise + - ./build.sh + environment: + GITHUB_TOKEN: + from_secret: github_token + failure: ignore + image: alpine/git:2.40.1 + name: clone-enterprise +- commands: + - apk add --update make + - make gen-go + depends_on: [] + image: golang:1.22.5-alpine + name: wire-install +- commands: + - apk add --update make build-base + - make lint-go + depends_on: + - wire-install + environment: + CGO_ENABLED: "1" + image: golang:1.22.5-alpine + name: lint-backend +- commands: + - go run scripts/modowners/modowners.go check go.mod + image: golang:1.22.5-alpine + name: validate-modfile +- commands: + - apk add --update make + - make swagger-validate + image: golang:1.22.5-alpine + name: validate-openapi-spec +trigger: + event: + - pull_request + paths: + exclude: + - docs/** + - '*.md' + include: + - pkg/** + - packaging/** + - .drone.yml + - conf/** + - go.sum + - go.mod + - public/app/plugins/**/plugin.json + - devenv/** + - .bingo/** +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker --- -{"kind": "pipeline", "type": "docker", "name": "pr-build-e2e", "trigger": {"event": ["pull_request"], "paths": {"exclude": ["*.md", "docs/**", "latest.json"]}}, "services": [], "steps": [{"name": "identify-runner", "image": "alpine:3.19.1", "commands": ["echo $DRONE_RUNNER_NAME"]}, {"name": "grabpl", "image": "byrnedo/alpine-curl:0.1.8", "commands": ["mkdir -p bin", "curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.50/grabpl", "chmod +x bin/grabpl"]}, {"name": "compile-build-cmd", "image": "golang:1.23.0-alpine", "commands": ["go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd"], "depends_on": [], "environment": {"CGO_ENABLED": 0}}, {"name": "verify-gen-cue", "image": "golang:1.23.0-alpine", "depends_on": [], "commands": ["# It is required that code generated from Thema/CUE be committed and in sync with its inputs.", "# The following command will fail if running code generators produces any diff in output.", "apk add --update make", "CODEGEN_VERIFY=1 make gen-cue"]}, {"name": "verify-gen-jsonnet", "image": "golang:1.23.0-alpine", "depends_on": [], "commands": ["# It is required that generated jsonnet is committed and in sync with its inputs.", "# The following command will fail if running code generators produces any diff in output.", "apk add --update make", "CODEGEN_VERIFY=1 make gen-jsonnet"]}, {"name": "wire-install", "image": "golang:1.23.0-alpine", "commands": ["apk add --update make", "make gen-go"], "depends_on": ["verify-gen-cue"]}, {"name": "yarn-install", "image": "node:20.9.0-alpine", "commands": ["yarn install --immutable"], "depends_on": []}, {"name": "build-frontend-packages", "image": "node:20.9.0-alpine", "environment": {"NODE_OPTIONS": "--max_old_space_size=8192"}, "depends_on": ["yarn-install"], "commands": ["apk add --update jq bash", "yarn packages:build", "yarn packages:pack", "./scripts/validate-npm-packages.sh"]}, {"name": "trigger-enterprise-downstream", "image": "grafana/drone-downstream", "settings": {"server": "https://drone.grafana.net", "token": {"from_secret": "drone_token"}, "repositories": ["grafana/grafana-enterprise@${DRONE_SOURCE_BRANCH}"], "params": ["SOURCE_BUILD_NUMBER=${DRONE_COMMIT}", "SOURCE_COMMIT=${DRONE_COMMIT}", "OSS_PULL_REQUEST=${DRONE_PULL_REQUEST}"]}, "failure": "ignore"}, {"name": "rgm-package", "image": "grafana/grafana-build:main", "pull": "always", "depends_on": ["yarn-install"], "commands": ["/src/grafana-build artifacts -a targz:grafana:linux/amd64 -a targz:grafana:linux/arm64 -a targz:grafana:linux/arm/v7 --go-version=1.23.0 --yarn-cache=$$YARN_CACHE_FOLDER --build-id=$$DRONE_BUILD_NUMBER --grafana-dir=$$PWD > packages.txt"], "volumes": [{"name": "docker", "path": "/var/run/docker.sock"}]}, {"name": "grafana-server", "image": "alpine:3.19.1", "detach": true, "depends_on": ["rgm-package"], "environment": {"GF_SERVER_HTTP_PORT": "3001", "GF_SERVER_ROUTER_LOGGING": "1", "GF_APP_MODE": "development"}, "commands": ["apk add --update tar bash", "mkdir grafana", "tar --strip-components=1 -xvf ./dist/*amd64.tar.gz -C grafana", "cp -r devenv scripts tools grafana && cd grafana && ./scripts/grafana-server/start-server"]}, {"name": "end-to-end-tests-dashboards-suite", "image": "cypress/included:13.1.0", "depends_on": ["grafana-server"], "environment": {"HOST": "grafana-server"}, "commands": ["./bin/build e2e-tests --port 3001 --suite dashboards-suite"]}, {"name": "end-to-end-tests-smoke-tests-suite", "image": "cypress/included:13.1.0", "depends_on": ["grafana-server"], "environment": {"HOST": "grafana-server"}, "commands": ["./bin/build e2e-tests --port 3001 --suite smoke-tests-suite"]}, {"name": "end-to-end-tests-panels-suite", "image": "cypress/included:13.1.0", "depends_on": ["grafana-server"], "environment": {"HOST": "grafana-server"}, "commands": ["./bin/build e2e-tests --port 3001 --suite panels-suite"]}, {"name": "end-to-end-tests-various-suite", "image": "cypress/included:13.1.0", "depends_on": ["grafana-server"], "environment": {"HOST": "grafana-server"}, "commands": ["./bin/build e2e-tests --port 3001 --suite various-suite"]}, {"name": "end-to-end-tests-cloud-plugins-suite-azure", "image": "us-docker.pkg.dev/grafanalabs-dev/cloud-data-sources/e2e-13.1.0:1.0.0", "depends_on": ["grafana-server"], "environment": {"CYPRESS_CI": "true", "HOST": "grafana-server", "GITHUB_TOKEN": {"from_secret": "github_token"}, "AZURE_SP_APP_ID": {"from_secret": "azure_sp_app_id"}, "AZURE_SP_PASSWORD": {"from_secret": "azure_sp_app_pw"}, "AZURE_TENANT": {"from_secret": "azure_tenant"}}, "commands": ["cd /", "./cpp-e2e/scripts/ci-run.sh azure ${DRONE_SOURCE_BRANCH}"], "when": {"repo": ["grafana/grafana"], "paths": {"include": ["pkg/tsdb/azuremonitor/**", "public/app/plugins/datasource/azuremonitor/**", "e2e/cloud-plugins-suite/azure-monitor.spec.ts"]}}}, {"name": "e2e-tests-artifacts-upload", "image": "google/cloud-sdk:431.0.0", "depends_on": ["end-to-end-tests-dashboards-suite", "end-to-end-tests-panels-suite", "end-to-end-tests-smoke-tests-suite", "end-to-end-tests-various-suite"], "failure": "ignore", "when": {"status": ["success", "failure"]}, "environment": {"GCP_GRAFANA_UPLOAD_ARTIFACTS_KEY": {"from_secret": "gcp_upload_artifacts_key"}, "E2E_TEST_ARTIFACTS_BUCKET": "releng-pipeline-artifacts-dev", "GITHUB_TOKEN": {"from_secret": "github_token"}}, "commands": ["apt-get update", "apt-get install -yq zip", "printenv GCP_GRAFANA_UPLOAD_ARTIFACTS_KEY > /tmp/gcpkey_upload_artifacts.json", "gcloud auth activate-service-account --key-file=/tmp/gcpkey_upload_artifacts.json", "find ./e2e -type f -name \"*spec.ts.mp4\" | zip e2e/videos.zip -@", "gsutil cp e2e/videos.zip gs://$${E2E_TEST_ARTIFACTS_BUCKET}/${DRONE_BUILD_NUMBER}/artifacts/videos/videos.zip", "export E2E_ARTIFACTS_VIDEO_ZIP=https://storage.googleapis.com/$${E2E_TEST_ARTIFACTS_BUCKET}/${DRONE_BUILD_NUMBER}/artifacts/videos/videos.zip", "echo \"E2E Test artifacts uploaded to: $${E2E_ARTIFACTS_VIDEO_ZIP}\"", "curl -X POST https://api.github.com/repos/${DRONE_REPO}/statuses/${DRONE_COMMIT_SHA} -H \"Authorization: token $${GITHUB_TOKEN}\" -d \"{\\\"state\\\":\\\"success\\\",\\\"target_url\\\":\\\"$${E2E_ARTIFACTS_VIDEO_ZIP}\\\", \\\"description\\\": \\\"Click on the details to download e2e recording videos\\\", \\\"context\\\": \\\"e2e_artifacts\\\"}\""]}, {"name": "build-storybook", "image": "node:20.9.0-alpine", "depends_on": ["rgm-package", "build-frontend-packages"], "environment": {"NODE_OPTIONS": "--max_old_space_size=4096"}, "commands": ["yarn storybook:build", "./bin/build verify-storybook"], "when": {"paths": {"include": ["packages/grafana-ui/**"]}}}, {"name": "test-a11y-frontend", "image": "grafana/docker-puppeteer:1.1.0", "depends_on": ["grafana-server"], "environment": {"GRAFANA_MISC_STATS_API_KEY": {"from_secret": "grafana_misc_stats_api_key"}, "HOST": "grafana-server", "PORT": 3001}, "failure": "always", "commands": ["npx wait-on@7.0.1 http://$HOST:$PORT", "pa11y-ci --config .pa11yci-pr.conf.js"]}, {"name": "rgm-build-docker", "image": "grafana/grafana-build:main", "pull": "always", "commands": ["docker run --privileged --rm tonistiigi/binfmt --install all", "/src/grafana-build artifacts -a docker:grafana:linux/amd64 -a docker:grafana:linux/amd64:ubuntu -a docker:grafana:linux/arm64 -a docker:grafana:linux/arm64:ubuntu -a docker:grafana:linux/arm/v7 -a docker:grafana:linux/arm/v7:ubuntu --yarn-cache=$$YARN_CACHE_FOLDER --build-id=$$DRONE_BUILD_NUMBER --go-version=1.23.0 --ubuntu-base=ubuntu:22.04 --alpine-base=alpine:3.19.1 --tag-format='{{ .version_base }}-{{ .buildID }}-{{ .arch }}' --grafana-dir=$$PWD --ubuntu-tag-format='{{ .version_base }}-{{ .buildID }}-ubuntu-{{ .arch }}' > docker.txt", "find ./dist -name '*docker*.tar.gz' -type f | xargs -n1 docker load -i"], "volumes": [{"name": "docker", "path": "/var/run/docker.sock"}], "depends_on": ["yarn-install"]}, {"name": "publish-images-grafana", "image": "google/cloud-sdk:431.0.0", "environment": {"DOCKER_USER": {"from_secret": "docker_username"}, "DOCKER_PASSWORD": {"from_secret": "docker_password"}, "GITHUB_APP_ID": {"from_secret": "delivery-bot-app-id"}, "GITHUB_APP_INSTALLATION_ID": {"from_secret": "delivery-bot-app-installation-id"}, "GITHUB_APP_PRIVATE_KEY": {"from_secret": "delivery-bot-app-private-key"}}, "commands": ["./bin/grabpl artifacts docker publish --dockerhub-repo grafana/grafana"], "depends_on": ["rgm-build-docker"], "volumes": [{"name": "docker", "path": "/var/run/docker.sock"}], "failure": "ignore"}], "clone": {"retries": 3}, "volumes": [{"name": "docker", "host": {"path": "/var/run/docker.sock"}}], "depends_on": [], "image_pull_secrets": ["gcr", "gar"], "environment": {"EDITION": "oss"}, "platform": {"os": "linux", "arch": "amd64"}, "node": {"type": "no-parallel"}} +clone: + retries: 3 +depends_on: [] +environment: + EDITION: oss +image_pull_secrets: +- gcr +- gar +kind: pipeline +name: pr-build-e2e +node: + type: no-parallel +platform: + arch: amd64 + os: linux +services: [] +steps: +- commands: + - echo $DRONE_RUNNER_NAME + image: alpine:3.19.1 + name: identify-runner +- commands: + - mkdir -p bin + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.50/grabpl + - chmod +x bin/grabpl + image: byrnedo/alpine-curl:0.1.8 + name: grabpl +- commands: + - go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd + depends_on: [] + environment: + CGO_ENABLED: 0 + image: golang:1.22.5-alpine + name: compile-build-cmd +- commands: + - '# It is required that code generated from Thema/CUE be committed and in sync + with its inputs.' + - '# The following command will fail if running code generators produces any diff + in output.' + - apk add --update make + - CODEGEN_VERIFY=1 make gen-cue + depends_on: [] + image: golang:1.22.5-alpine + name: verify-gen-cue +- commands: + - '# It is required that generated jsonnet is committed and in sync with its inputs.' + - '# The following command will fail if running code generators produces any diff + in output.' + - apk add --update make + - CODEGEN_VERIFY=1 make gen-jsonnet + depends_on: [] + image: golang:1.22.5-alpine + name: verify-gen-jsonnet +- commands: + - apk add --update make + - make gen-go + depends_on: + - verify-gen-cue + image: golang:1.22.5-alpine + name: wire-install +- commands: + - yarn install --immutable + depends_on: [] + image: node:20.9.0-alpine + name: yarn-install +- commands: + - apk add --update jq bash + - yarn packages:build + - yarn packages:pack + - ./scripts/validate-npm-packages.sh + depends_on: + - yarn-install + environment: + NODE_OPTIONS: --max_old_space_size=8192 + image: node:20.9.0-alpine + name: build-frontend-packages +- failure: ignore + image: grafana/drone-downstream + name: trigger-enterprise-downstream + settings: + params: + - SOURCE_BUILD_NUMBER=${DRONE_COMMIT} + - SOURCE_COMMIT=${DRONE_COMMIT} + - OSS_PULL_REQUEST=${DRONE_PULL_REQUEST} + repositories: + - grafana/grafana-enterprise@${DRONE_SOURCE_BRANCH} + server: https://drone.grafana.net + token: + from_secret: drone_token +- commands: + - /src/grafana-build artifacts -a targz:grafana:linux/amd64 -a targz:grafana:linux/arm64 + -a targz:grafana:linux/arm/v7 --go-version=1.22.5 --yarn-cache=$$YARN_CACHE_FOLDER + --build-id=$$DRONE_BUILD_NUMBER --grafana-dir=$$PWD > packages.txt + depends_on: + - yarn-install + image: grafana/grafana-build:main + name: rgm-package + pull: always + volumes: + - name: docker + path: /var/run/docker.sock +- commands: + - apk add --update tar bash + - mkdir grafana + - tar --strip-components=1 -xvf ./dist/*amd64.tar.gz -C grafana + - cp -r devenv scripts tools grafana && cd grafana && ./scripts/grafana-server/start-server + depends_on: + - rgm-package + detach: true + environment: + GF_APP_MODE: development + GF_SERVER_HTTP_PORT: "3001" + GF_SERVER_ROUTER_LOGGING: "1" + image: alpine:3.19.1 + name: grafana-server +- commands: + - ./bin/build e2e-tests --port 3001 --suite dashboards-suite + depends_on: + - grafana-server + environment: + HOST: grafana-server + image: cypress/included:13.1.0 + name: end-to-end-tests-dashboards-suite +- commands: + - ./bin/build e2e-tests --port 3001 --suite smoke-tests-suite + depends_on: + - grafana-server + environment: + HOST: grafana-server + image: cypress/included:13.1.0 + name: end-to-end-tests-smoke-tests-suite +- commands: + - ./bin/build e2e-tests --port 3001 --suite panels-suite + depends_on: + - grafana-server + environment: + HOST: grafana-server + image: cypress/included:13.1.0 + name: end-to-end-tests-panels-suite +- commands: + - ./bin/build e2e-tests --port 3001 --suite various-suite + depends_on: + - grafana-server + environment: + HOST: grafana-server + image: cypress/included:13.1.0 + name: end-to-end-tests-various-suite +- commands: + - cd / + - ./cpp-e2e/scripts/ci-run.sh azure ${DRONE_SOURCE_BRANCH} + depends_on: + - grafana-server + environment: + AZURE_SP_APP_ID: + from_secret: azure_sp_app_id + AZURE_SP_PASSWORD: + from_secret: azure_sp_app_pw + AZURE_TENANT: + from_secret: azure_tenant + CYPRESS_CI: "true" + GITHUB_TOKEN: + from_secret: github_token + HOST: grafana-server + image: us-docker.pkg.dev/grafanalabs-dev/cloud-data-sources/e2e-13.1.0:1.0.0 + name: end-to-end-tests-cloud-plugins-suite-azure + when: + paths: + include: + - pkg/tsdb/azuremonitor/** + - public/app/plugins/datasource/azuremonitor/** + - e2e/cloud-plugins-suite/azure-monitor.spec.ts + repo: + - grafana/grafana +- commands: + - apt-get update + - apt-get install -yq zip + - printenv GCP_GRAFANA_UPLOAD_ARTIFACTS_KEY > /tmp/gcpkey_upload_artifacts.json + - gcloud auth activate-service-account --key-file=/tmp/gcpkey_upload_artifacts.json + - find ./e2e -type f -name "*spec.ts.mp4" | zip e2e/videos.zip -@ + - gsutil cp e2e/videos.zip gs://$${E2E_TEST_ARTIFACTS_BUCKET}/${DRONE_BUILD_NUMBER}/artifacts/videos/videos.zip + - export E2E_ARTIFACTS_VIDEO_ZIP=https://storage.googleapis.com/$${E2E_TEST_ARTIFACTS_BUCKET}/${DRONE_BUILD_NUMBER}/artifacts/videos/videos.zip + - 'echo "E2E Test artifacts uploaded to: $${E2E_ARTIFACTS_VIDEO_ZIP}"' + - 'curl -X POST https://api.github.com/repos/${DRONE_REPO}/statuses/${DRONE_COMMIT_SHA} + -H "Authorization: token $${GITHUB_TOKEN}" -d "{\"state\":\"success\",\"target_url\":\"$${E2E_ARTIFACTS_VIDEO_ZIP}\", + \"description\": \"Click on the details to download e2e recording videos\", \"context\": + \"e2e_artifacts\"}"' + depends_on: + - end-to-end-tests-dashboards-suite + - end-to-end-tests-panels-suite + - end-to-end-tests-smoke-tests-suite + - end-to-end-tests-various-suite + environment: + E2E_TEST_ARTIFACTS_BUCKET: releng-pipeline-artifacts-dev + GCP_GRAFANA_UPLOAD_ARTIFACTS_KEY: + from_secret: gcp_upload_artifacts_key + GITHUB_TOKEN: + from_secret: github_token + failure: ignore + image: google/cloud-sdk:431.0.0 + name: e2e-tests-artifacts-upload + when: + status: + - success + - failure +- commands: + - yarn storybook:build + - ./bin/build verify-storybook + depends_on: + - rgm-package + - build-frontend-packages + environment: + NODE_OPTIONS: --max_old_space_size=4096 + image: node:20.9.0-alpine + name: build-storybook + when: + paths: + include: + - packages/grafana-ui/** +- commands: + - npx wait-on@7.0.1 http://$HOST:$PORT + - pa11y-ci --config .pa11yci-pr.conf.js + depends_on: + - grafana-server + environment: + GRAFANA_MISC_STATS_API_KEY: + from_secret: grafana_misc_stats_api_key + HOST: grafana-server + PORT: 3001 + failure: always + image: grafana/docker-puppeteer:1.1.0 + name: test-a11y-frontend +- commands: + - docker run --privileged --rm tonistiigi/binfmt --install all + - /src/grafana-build artifacts -a docker:grafana:linux/amd64 -a docker:grafana:linux/amd64:ubuntu + -a docker:grafana:linux/arm64 -a docker:grafana:linux/arm64:ubuntu -a docker:grafana:linux/arm/v7 + -a docker:grafana:linux/arm/v7:ubuntu --yarn-cache=$$YARN_CACHE_FOLDER --build-id=$$DRONE_BUILD_NUMBER + --go-version=1.22.5 --ubuntu-base=ubuntu:22.04 --alpine-base=alpine:3.19.1 --tag-format='{{ + .version_base }}-{{ .buildID }}-{{ .arch }}' --grafana-dir=$$PWD --ubuntu-tag-format='{{ + .version_base }}-{{ .buildID }}-ubuntu-{{ .arch }}' > docker.txt + - find ./dist -name '*docker*.tar.gz' -type f | xargs -n1 docker load -i + depends_on: + - yarn-install + image: grafana/grafana-build:main + name: rgm-build-docker + pull: always + volumes: + - name: docker + path: /var/run/docker.sock +- commands: + - ./bin/grabpl artifacts docker publish --dockerhub-repo grafana/grafana + depends_on: + - rgm-build-docker + environment: + DOCKER_PASSWORD: + from_secret: docker_password + DOCKER_USER: + from_secret: docker_username + GITHUB_APP_ID: + from_secret: delivery-bot-app-id + GITHUB_APP_INSTALLATION_ID: + from_secret: delivery-bot-app-installation-id + GITHUB_APP_PRIVATE_KEY: + from_secret: delivery-bot-app-private-key + failure: ignore + image: google/cloud-sdk:431.0.0 + name: publish-images-grafana + volumes: + - name: docker + path: /var/run/docker.sock +trigger: + event: + - pull_request + paths: + exclude: + - '*.md' + - docs/** + - latest.json +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker --- -{"kind": "pipeline", "type": "docker", "name": "pr-integration-tests", "trigger": {"event": ["pull_request"], "paths": {"exclude": ["docs/**", "*.md"], "include": ["pkg/**", "packaging/**", ".drone.yml", "conf/**", "go.sum", "go.mod", "public/app/plugins/**/plugin.json"]}}, "services": [{"name": "postgres", "image": "postgres:12.3-alpine", "environment": {"POSTGRES_USER": "grafanatest", "POSTGRES_PASSWORD": "grafanatest", "POSTGRES_DB": "grafanatest", "PGDATA": "/var/lib/postgresql/data/pgdata"}, "volumes": [{"name": "postgres", "path": "/var/lib/postgresql/data/pgdata"}]}, {"name": "mysql57", "image": "mysql:5.7.39", "environment": {"MYSQL_ROOT_PASSWORD": "rootpass", "MYSQL_DATABASE": "grafana_tests", "MYSQL_USER": "grafana", "MYSQL_PASSWORD": "password"}, "volumes": [{"name": "mysql57", "path": "/var/lib/mysql"}], "commands": ["docker-entrypoint.sh mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci"]}, {"name": "mysql80", "image": "mysql:8.0.32", "environment": {"MYSQL_ROOT_PASSWORD": "rootpass", "MYSQL_DATABASE": "grafana_tests", "MYSQL_USER": "grafana", "MYSQL_PASSWORD": "password"}, "volumes": [{"name": "mysql80", "path": "/var/lib/mysql"}], "commands": ["docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password"]}, {"name": "mimir_backend", "image": "us.gcr.io/kubernetes-dev/mimir:gotjosh-state-config-grafana-663a0ae78", "environment": {}, "commands": ["/bin/mimir -target=backend"]}, {"name": "redis", "image": "redis:6.2.11-alpine", "environment": {}}, {"name": "memcached", "image": "memcached:1.6.9-alpine", "environment": {}}], "steps": [{"name": "clone-enterprise", "image": "alpine/git:2.40.1", "environment": {"GITHUB_TOKEN": {"from_secret": "github_token"}}, "commands": ["apk add --update curl jq bash", "is_fork=$(curl \"https://$GITHUB_TOKEN@api.github.com/repos/grafana/grafana/pulls/$DRONE_PULL_REQUEST\" | jq .head.repo.fork)", "if [ \"$is_fork\" != false ]; then return 1; fi", "git clone \"https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git\" ../grafana-enterprise", "cd ../grafana-enterprise", "if git checkout ${DRONE_SOURCE_BRANCH}; then echo \"checked out ${DRONE_SOURCE_BRANCH}\"; elif git checkout ${DRONE_TARGET_BRANCH}; then echo \"git checkout ${DRONE_TARGET_BRANCH}\"; else git checkout main; fi", "cd ../", "ln -s src grafana", "cd ./grafana-enterprise", "./build.sh"], "failure": "ignore"}, {"name": "grabpl", "image": "byrnedo/alpine-curl:0.1.8", "commands": ["mkdir -p bin", "curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.50/grabpl", "chmod +x bin/grabpl"]}, {"name": "compile-build-cmd", "image": "golang:1.23.0-alpine", "commands": ["go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd"], "depends_on": [], "environment": {"CGO_ENABLED": 0}}, {"name": "identify-runner", "image": "alpine:3.19.1", "commands": ["echo $DRONE_RUNNER_NAME"]}, {"name": "verify-gen-cue", "image": "golang:1.23.0-alpine", "depends_on": [], "commands": ["# It is required that code generated from Thema/CUE be committed and in sync with its inputs.", "# The following command will fail if running code generators produces any diff in output.", "apk add --update make", "CODEGEN_VERIFY=1 make gen-cue"]}, {"name": "verify-gen-jsonnet", "image": "golang:1.23.0-alpine", "depends_on": [], "commands": ["# It is required that generated jsonnet is committed and in sync with its inputs.", "# The following command will fail if running code generators produces any diff in output.", "apk add --update make", "CODEGEN_VERIFY=1 make gen-jsonnet"]}, {"name": "wire-install", "image": "golang:1.23.0-alpine", "commands": ["apk add --update make", "make gen-go"], "depends_on": ["verify-gen-cue"]}, {"name": "wait-for-postgres", "image": "jwilder/dockerize:0.6.1", "commands": ["dockerize -wait tcp://postgres:5432 -timeout 120s"]}, {"name": "postgres-integration-tests", "image": "golang:1.23.0-alpine", "depends_on": ["wire-install", "wait-for-postgres"], "commands": ["apk add --update build-base", "apk add --update postgresql-client", "psql -p 5432 -h postgres -U grafanatest -d grafanatest -f devenv/docker/blocks/postgres_tests/setup.sql", "go clean -testcache", "go test -p=1 -count=1 -covermode=atomic -timeout=5m -run '^TestIntegration' $(find ./pkg -type f -name '*_test.go' -exec grep -l '^func TestIntegration' '{}' '+' | grep -o '\\(.*\\)/' | sort -u)"], "environment": {"PGPASSWORD": "grafanatest", "GRAFANA_TEST_DB": "postgres", "POSTGRES_HOST": "postgres"}}, {"name": "wait-for-mysql-5.7", "image": "jwilder/dockerize:0.6.1", "commands": ["dockerize -wait tcp://mysql57:3306 -timeout 120s"]}, {"name": "mysql-5.7-integration-tests", "image": "golang:1.23.0-alpine", "depends_on": ["wire-install", "wait-for-mysql-5.7"], "commands": ["apk add --update build-base", "apk add --update mysql-client", "cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql57 -P 3306 -u root -prootpass", "go clean -testcache", "go test -p=1 -count=1 -covermode=atomic -timeout=5m -run '^TestIntegration' $(find ./pkg -type f -name '*_test.go' -exec grep -l '^func TestIntegration' '{}' '+' | grep -o '\\(.*\\)/' | sort -u)"], "environment": {"GRAFANA_TEST_DB": "mysql", "MYSQL_HOST": "mysql57"}}, {"name": "wait-for-mysql-8.0", "image": "jwilder/dockerize:0.6.1", "commands": ["dockerize -wait tcp://mysql80:3306 -timeout 120s"]}, {"name": "mysql-8.0-integration-tests", "image": "golang:1.23.0-alpine", "depends_on": ["wire-install", "wait-for-mysql-8.0"], "commands": ["apk add --update build-base", "apk add --update mysql-client", "cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql80 -P 3306 -u root -prootpass", "go clean -testcache", "go test -p=1 -count=1 -covermode=atomic -timeout=5m -run '^TestIntegration' $(find ./pkg -type f -name '*_test.go' -exec grep -l '^func TestIntegration' '{}' '+' | grep -o '\\(.*\\)/' | sort -u)"], "environment": {"GRAFANA_TEST_DB": "mysql", "MYSQL_HOST": "mysql80"}}, {"name": "wait-for-redis", "image": "jwilder/dockerize:0.6.1", "commands": ["dockerize -wait tcp://redis:6379 -timeout 120s"]}, {"name": "redis-integration-tests", "image": "golang:1.23.0-alpine", "depends_on": ["wire-install", "wait-for-redis"], "commands": ["apk add --update build-base", "go clean -testcache", "go list -f '{{.Dir}}/...' -m | xargs go test -run IntegrationRedis -covermode=atomic -timeout=2m"], "environment": {"REDIS_URL": "redis://redis:6379/0"}}, {"name": "wait-for-memcached", "image": "jwilder/dockerize:0.6.1", "commands": ["dockerize -wait tcp://memcached:11211 -timeout 120s"]}, {"name": "memcached-integration-tests", "image": "golang:1.23.0-alpine", "depends_on": ["wire-install", "wait-for-memcached"], "commands": ["apk add --update build-base", "go clean -testcache", "go list -f '{{.Dir}}/...' -m | xargs go test -run IntegrationMemcached -covermode=atomic -timeout=2m"], "environment": {"MEMCACHED_HOSTS": "memcached:11211"}}, {"name": "wait-for-remote-alertmanager", "image": "jwilder/dockerize:0.6.1", "commands": ["dockerize -wait tcp://mimir_backend:8080 -timeout 120s"]}, {"name": "remote-alertmanager-integration-tests", "image": "golang:1.23.0-alpine", "depends_on": ["wire-install", "wait-for-remote-alertmanager"], "commands": ["apk add --update build-base", "go clean -testcache", "go test -run TestIntegrationRemoteAlertmanager -covermode=atomic -timeout=2m ./pkg/services/ngalert/..."], "environment": {"AM_TENANT_ID": "test", "AM_URL": "http://mimir_backend:8080"}}], "clone": {"retries": 3}, "volumes": [{"name": "docker", "host": {"path": "/var/run/docker.sock"}}, {"name": "postgres", "temp": {"medium": "memory"}}, {"name": "mysql57", "temp": {"medium": "memory"}}, {"name": "mysql80", "temp": {"medium": "memory"}}], "depends_on": [], "image_pull_secrets": ["gcr", "gar"], "environment": {"EDITION": "oss"}, "platform": {"os": "linux", "arch": "amd64"}, "node": {"type": "no-parallel"}} +clone: + retries: 3 +depends_on: [] +environment: + EDITION: oss +image_pull_secrets: +- gcr +- gar +kind: pipeline +name: pr-integration-tests +node: + type: no-parallel +platform: + arch: amd64 + os: linux +services: +- environment: + PGDATA: /var/lib/postgresql/data/pgdata + POSTGRES_DB: grafanatest + POSTGRES_PASSWORD: grafanatest + POSTGRES_USER: grafanatest + image: postgres:12.3-alpine + name: postgres + volumes: + - name: postgres + path: /var/lib/postgresql/data/pgdata +- commands: + - docker-entrypoint.sh mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci + environment: + MYSQL_DATABASE: grafana_tests + MYSQL_PASSWORD: password + MYSQL_ROOT_PASSWORD: rootpass + MYSQL_USER: grafana + image: mysql:5.7.39 + name: mysql57 + volumes: + - name: mysql57 + path: /var/lib/mysql +- commands: + - docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password + environment: + MYSQL_DATABASE: grafana_tests + MYSQL_PASSWORD: password + MYSQL_ROOT_PASSWORD: rootpass + MYSQL_USER: grafana + image: mysql:8.0.32 + name: mysql80 + volumes: + - name: mysql80 + path: /var/lib/mysql +- commands: + - /bin/mimir -target=backend + environment: {} + image: us.gcr.io/kubernetes-dev/mimir:gotjosh-state-config-grafana-663a0ae78 + name: mimir_backend +- environment: {} + image: redis:6.2.11-alpine + name: redis +- environment: {} + image: memcached:1.6.9-alpine + name: memcached +steps: +- commands: + - apk add --update curl jq bash + - is_fork=$(curl "https://$GITHUB_TOKEN@api.github.com/repos/grafana/grafana/pulls/$DRONE_PULL_REQUEST" + | jq .head.repo.fork) + - if [ "$is_fork" != false ]; then return 1; fi + - git clone "https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git" + ../grafana-enterprise + - cd ../grafana-enterprise + - if git checkout ${DRONE_SOURCE_BRANCH}; then echo "checked out ${DRONE_SOURCE_BRANCH}"; + elif git checkout ${DRONE_TARGET_BRANCH}; then echo "git checkout ${DRONE_TARGET_BRANCH}"; + else git checkout main; fi + - cd ../ + - ln -s src grafana + - cd ./grafana-enterprise + - ./build.sh + environment: + GITHUB_TOKEN: + from_secret: github_token + failure: ignore + image: alpine/git:2.40.1 + name: clone-enterprise +- commands: + - mkdir -p bin + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.50/grabpl + - chmod +x bin/grabpl + image: byrnedo/alpine-curl:0.1.8 + name: grabpl +- commands: + - go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd + depends_on: [] + environment: + CGO_ENABLED: 0 + image: golang:1.22.5-alpine + name: compile-build-cmd +- commands: + - echo $DRONE_RUNNER_NAME + image: alpine:3.19.1 + name: identify-runner +- commands: + - '# It is required that code generated from Thema/CUE be committed and in sync + with its inputs.' + - '# The following command will fail if running code generators produces any diff + in output.' + - apk add --update make + - CODEGEN_VERIFY=1 make gen-cue + depends_on: [] + image: golang:1.22.5-alpine + name: verify-gen-cue +- commands: + - '# It is required that generated jsonnet is committed and in sync with its inputs.' + - '# The following command will fail if running code generators produces any diff + in output.' + - apk add --update make + - CODEGEN_VERIFY=1 make gen-jsonnet + depends_on: [] + image: golang:1.22.5-alpine + name: verify-gen-jsonnet +- commands: + - apk add --update make + - make gen-go + depends_on: + - verify-gen-cue + image: golang:1.22.5-alpine + name: wire-install +- commands: + - dockerize -wait tcp://postgres:5432 -timeout 120s + image: jwilder/dockerize:0.6.1 + name: wait-for-postgres +- commands: + - apk add --update build-base + - apk add --update postgresql-client + - psql -p 5432 -h postgres -U grafanatest -d grafanatest -f devenv/docker/blocks/postgres_tests/setup.sql + - go clean -testcache + - go test -p=1 -count=1 -covermode=atomic -timeout=5m -run '^TestIntegration' $(find + ./pkg -type f -name '*_test.go' -exec grep -l '^func TestIntegration' '{}' '+' + | grep -o '\(.*\)/' | sort -u) + depends_on: + - wire-install + - wait-for-postgres + environment: + GRAFANA_TEST_DB: postgres + PGPASSWORD: grafanatest + POSTGRES_HOST: postgres + image: golang:1.22.5-alpine + name: postgres-integration-tests +- commands: + - dockerize -wait tcp://mysql57:3306 -timeout 120s + image: jwilder/dockerize:0.6.1 + name: wait-for-mysql-5.7 +- commands: + - apk add --update build-base + - apk add --update mysql-client + - cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql57 -P 3306 -u root + -prootpass + - go clean -testcache + - go test -p=1 -count=1 -covermode=atomic -timeout=5m -run '^TestIntegration' $(find + ./pkg -type f -name '*_test.go' -exec grep -l '^func TestIntegration' '{}' '+' + | grep -o '\(.*\)/' | sort -u) + depends_on: + - wire-install + - wait-for-mysql-5.7 + environment: + GRAFANA_TEST_DB: mysql + MYSQL_HOST: mysql57 + image: golang:1.22.5-alpine + name: mysql-5.7-integration-tests +- commands: + - dockerize -wait tcp://mysql80:3306 -timeout 120s + image: jwilder/dockerize:0.6.1 + name: wait-for-mysql-8.0 +- commands: + - apk add --update build-base + - apk add --update mysql-client + - cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql80 -P 3306 -u root + -prootpass + - go clean -testcache + - go test -p=1 -count=1 -covermode=atomic -timeout=5m -run '^TestIntegration' $(find + ./pkg -type f -name '*_test.go' -exec grep -l '^func TestIntegration' '{}' '+' + | grep -o '\(.*\)/' | sort -u) + depends_on: + - wire-install + - wait-for-mysql-8.0 + environment: + GRAFANA_TEST_DB: mysql + MYSQL_HOST: mysql80 + image: golang:1.22.5-alpine + name: mysql-8.0-integration-tests +- commands: + - dockerize -wait tcp://redis:6379 -timeout 120s + image: jwilder/dockerize:0.6.1 + name: wait-for-redis +- commands: + - apk add --update build-base + - go clean -testcache + - go list -f '{{.Dir}}/...' -m | xargs go test -run IntegrationRedis -covermode=atomic + -timeout=2m + depends_on: + - wire-install + - wait-for-redis + environment: + REDIS_URL: redis://redis:6379/0 + image: golang:1.22.5-alpine + name: redis-integration-tests +- commands: + - dockerize -wait tcp://memcached:11211 -timeout 120s + image: jwilder/dockerize:0.6.1 + name: wait-for-memcached +- commands: + - apk add --update build-base + - go clean -testcache + - go list -f '{{.Dir}}/...' -m | xargs go test -run IntegrationMemcached -covermode=atomic + -timeout=2m + depends_on: + - wire-install + - wait-for-memcached + environment: + MEMCACHED_HOSTS: memcached:11211 + image: golang:1.22.5-alpine + name: memcached-integration-tests +- commands: + - dockerize -wait tcp://mimir_backend:8080 -timeout 120s + image: jwilder/dockerize:0.6.1 + name: wait-for-remote-alertmanager +- commands: + - apk add --update build-base + - go clean -testcache + - go test -run TestIntegrationRemoteAlertmanager -covermode=atomic -timeout=2m ./pkg/services/ngalert/... + depends_on: + - wire-install + - wait-for-remote-alertmanager + environment: + AM_TENANT_ID: test + AM_URL: http://mimir_backend:8080 + image: golang:1.22.5-alpine + name: remote-alertmanager-integration-tests +trigger: + event: + - pull_request + paths: + exclude: + - docs/** + - '*.md' + include: + - pkg/** + - packaging/** + - .drone.yml + - conf/** + - go.sum + - go.mod + - public/app/plugins/**/plugin.json +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker +- name: postgres + temp: + medium: memory +- name: mysql57 + temp: + medium: memory +- name: mysql80 + temp: + medium: memory --- -{"kind": "pipeline", "type": "docker", "name": "pr-docs", "trigger": {"event": ["pull_request"], "repo": ["grafana/grafana"], "paths": {"include": ["*.md", "docs/**", "packages/**/*.md", "latest.json"]}}, "services": [], "steps": [{"name": "identify-runner", "image": "alpine:3.19.1", "commands": ["echo $DRONE_RUNNER_NAME"]}, {"name": "yarn-install", "image": "node:20.9.0-alpine", "commands": ["yarn install --immutable"], "depends_on": []}, {"name": "codespell", "image": "python:3.8", "commands": ["pip3 install codespell", "codespell -I .codespellignore docs/"]}, {"name": "lint-docs", "image": "node:20.9.0-alpine", "depends_on": ["yarn-install"], "environment": {"NODE_OPTIONS": "--max_old_space_size=8192"}, "commands": ["yarn run prettier:checkDocs"]}, {"name": "build-docs-website", "image": "grafana/docs-base:latest", "pull": "always", "commands": ["mkdir -p /hugo/content/docs/grafana/latest", "echo -e '---\\nredirectURL: /docs/grafana/latest/\\ntype: redirect\\nversioned: true\\n---\\n' > /hugo/content/docs/grafana/_index.md", "cp -r docs/sources/* /hugo/content/docs/grafana/latest/", "cd /hugo && make prod"]}, {"name": "verify-gen-cue", "image": "golang:1.23.0-alpine", "depends_on": [], "commands": ["# It is required that code generated from Thema/CUE be committed and in sync with its inputs.", "# The following command will fail if running code generators produces any diff in output.", "apk add --update make", "CODEGEN_VERIFY=1 make gen-cue"]}], "clone": {"retries": 3}, "volumes": [{"name": "docker", "host": {"path": "/var/run/docker.sock"}}], "depends_on": [], "image_pull_secrets": ["gcr", "gar"], "environment": {"EDITION": "oss"}, "platform": {"os": "linux", "arch": "amd64"}, "node": {"type": "no-parallel"}} +clone: + retries: 3 +depends_on: [] +environment: + EDITION: oss +image_pull_secrets: +- gcr +- gar +kind: pipeline +name: pr-docs +node: + type: no-parallel +platform: + arch: amd64 + os: linux +services: [] +steps: +- commands: + - echo $DRONE_RUNNER_NAME + image: alpine:3.19.1 + name: identify-runner +- commands: + - yarn install --immutable + depends_on: [] + image: node:20.9.0-alpine + name: yarn-install +- commands: + - pip3 install codespell + - codespell -I .codespellignore docs/ + image: python:3.8 + name: codespell +- commands: + - yarn run prettier:checkDocs + depends_on: + - yarn-install + environment: + NODE_OPTIONS: --max_old_space_size=8192 + image: node:20.9.0-alpine + name: lint-docs +- commands: + - mkdir -p /hugo/content/docs/grafana/latest + - 'echo -e ''---\nredirectURL: /docs/grafana/latest/\ntype: redirect\nversioned: + true\n---\n'' > /hugo/content/docs/grafana/_index.md' + - cp -r docs/sources/* /hugo/content/docs/grafana/latest/ + - cd /hugo && make prod + image: grafana/docs-base:latest + name: build-docs-website + pull: always +- commands: + - '# It is required that code generated from Thema/CUE be committed and in sync + with its inputs.' + - '# The following command will fail if running code generators produces any diff + in output.' + - apk add --update make + - CODEGEN_VERIFY=1 make gen-cue + depends_on: [] + image: golang:1.22.5-alpine + name: verify-gen-cue +trigger: + event: + - pull_request + paths: + include: + - '*.md' + - docs/** + - packages/**/*.md + - latest.json + repo: + - grafana/grafana +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker --- -{"kind": "pipeline", "type": "docker", "name": "pr-shellcheck", "trigger": {"event": ["pull_request"], "paths": {"exclude": ["*.md", "docs/**", "latest.json"], "include": ["scripts/**/*.sh"]}}, "services": [], "steps": [{"name": "compile-build-cmd", "image": "golang:1.23.0-alpine", "commands": ["go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd"], "depends_on": [], "environment": {"CGO_ENABLED": 0}}, {"name": "shellcheck", "image": "ubuntu:22.04", "commands": ["apt-get update -yq && apt-get install shellcheck", "shellcheck -e SC1071 -e SC2162 scripts/**/*.sh"]}], "clone": {"retries": 3}, "volumes": [{"name": "docker", "host": {"path": "/var/run/docker.sock"}}], "depends_on": [], "image_pull_secrets": ["gcr", "gar"], "environment": {"EDITION": "oss"}, "platform": {"os": "linux", "arch": "amd64"}, "node": {"type": "no-parallel"}} +clone: + retries: 3 +depends_on: [] +environment: + EDITION: oss +image_pull_secrets: +- gcr +- gar +kind: pipeline +name: pr-shellcheck +node: + type: no-parallel +platform: + arch: amd64 + os: linux +services: [] +steps: +- commands: + - go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd + depends_on: [] + environment: + CGO_ENABLED: 0 + image: golang:1.22.5-alpine + name: compile-build-cmd +- commands: + - apt-get update -yq && apt-get install shellcheck + - shellcheck -e SC1071 -e SC2162 scripts/**/*.sh + image: ubuntu:22.04 + name: shellcheck +trigger: + event: + - pull_request + paths: + exclude: + - '*.md' + - docs/** + - latest.json + include: + - scripts/**/*.sh +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker --- -{"kind": "pipeline", "type": "docker", "name": "pr-swagger-gen", "trigger": {"event": ["pull_request"], "paths": {"exclude": ["docs/**", "*.md"], "include": ["pkg/**"]}}, "services": [], "steps": [{"name": "clone-enterprise", "image": "alpine/git:2.40.1", "environment": {"GITHUB_TOKEN": {"from_secret": "github_token"}}, "commands": ["apk add --update curl jq bash", "is_fork=$(curl \"https://$GITHUB_TOKEN@api.github.com/repos/grafana/grafana/pulls/$DRONE_PULL_REQUEST\" | jq .head.repo.fork)", "if [ \"$is_fork\" != false ]; then return 1; fi", "git clone \"https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git\" grafana-enterprise", "cd grafana-enterprise", "if git checkout ${DRONE_SOURCE_BRANCH}; then echo \"checked out ${DRONE_SOURCE_BRANCH}\"; elif git checkout main; then echo \"git checkout main\"; else git checkout main; fi"], "failure": "ignore"}, {"name": "swagger-gen", "image": "golang:1.23.0-alpine", "environment": {"GITHUB_TOKEN": {"from_secret": "github_token"}}, "commands": ["apk add --update git make", "make swagger-clean && make openapi3-gen", "for f in public/api-merged.json public/openapi3.json; do git add $f; done", "if [ -z \"$(git diff --name-only --cached)\" ]; then echo \"Everything seems up to date!\"; else echo \"Please ensure the branch is up-to-date, then regenerate the specification by running make swagger-clean && make openapi3-gen\" && return 1; fi"], "depends_on": ["clone-enterprise"]}], "clone": {"retries": 3}, "volumes": [{"name": "docker", "host": {"path": "/var/run/docker.sock"}}], "depends_on": [], "image_pull_secrets": ["gcr", "gar"], "platform": {"os": "linux", "arch": "amd64"}, "node": {"type": "no-parallel"}} +clone: + retries: 3 +depends_on: [] +image_pull_secrets: +- gcr +- gar +kind: pipeline +name: pr-swagger-gen +node: + type: no-parallel +platform: + arch: amd64 + os: linux +services: [] +steps: +- commands: + - apk add --update curl jq bash + - is_fork=$(curl "https://$GITHUB_TOKEN@api.github.com/repos/grafana/grafana/pulls/$DRONE_PULL_REQUEST" + | jq .head.repo.fork) + - if [ "$is_fork" != false ]; then return 1; fi + - git clone "https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git" + grafana-enterprise + - cd grafana-enterprise + - if git checkout ${DRONE_SOURCE_BRANCH}; then echo "checked out ${DRONE_SOURCE_BRANCH}"; + elif git checkout main; then echo "git checkout main"; else git checkout main; + fi + environment: + GITHUB_TOKEN: + from_secret: github_token + failure: ignore + image: alpine/git:2.40.1 + name: clone-enterprise +- commands: + - apk add --update git make + - make swagger-clean && make openapi3-gen + - for f in public/api-merged.json public/openapi3.json; do git add $f; done + - if [ -z "$(git diff --name-only --cached)" ]; then echo "Everything seems up to + date!"; else echo "Please ensure the branch is up-to-date, then regenerate the + specification by running make swagger-clean && make openapi3-gen" && return 1; + fi + depends_on: + - clone-enterprise + environment: + GITHUB_TOKEN: + from_secret: github_token + image: golang:1.22.5-alpine + name: swagger-gen +trigger: + event: + - pull_request + paths: + exclude: + - docs/** + - '*.md' + include: + - pkg/** +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker --- -{"kind": "pipeline", "type": "docker", "name": "pr-integration-benchmarks", "trigger": {"event": ["promote"], "target": ["gobenchmarks"]}, "services": [{"name": "postgres", "image": "postgres:12.3-alpine", "environment": {"POSTGRES_USER": "grafanatest", "POSTGRES_PASSWORD": "grafanatest", "POSTGRES_DB": "grafanatest", "PGDATA": "/var/lib/postgresql/data/pgdata"}, "volumes": [{"name": "postgres", "path": "/var/lib/postgresql/data/pgdata"}]}, {"name": "mysql57", "image": "mysql:5.7.39", "environment": {"MYSQL_ROOT_PASSWORD": "rootpass", "MYSQL_DATABASE": "grafana_tests", "MYSQL_USER": "grafana", "MYSQL_PASSWORD": "password"}, "volumes": [{"name": "mysql57", "path": "/var/lib/mysql"}], "commands": ["docker-entrypoint.sh mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci"]}, {"name": "mysql80", "image": "mysql:8.0.32", "environment": {"MYSQL_ROOT_PASSWORD": "rootpass", "MYSQL_DATABASE": "grafana_tests", "MYSQL_USER": "grafana", "MYSQL_PASSWORD": "password"}, "volumes": [{"name": "mysql80", "path": "/var/lib/mysql"}], "commands": ["docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password"]}, {"name": "mimir_backend", "image": "us.gcr.io/kubernetes-dev/mimir:gotjosh-state-config-grafana-663a0ae78", "environment": {}, "commands": ["/bin/mimir -target=backend"]}, {"name": "redis", "image": "redis:6.2.11-alpine", "environment": {}}, {"name": "memcached", "image": "memcached:1.6.9-alpine", "environment": {}}], "steps": [{"name": "clone-enterprise", "image": "alpine/git:2.40.1", "environment": {"GITHUB_TOKEN": {"from_secret": "github_token"}}, "commands": ["apk add --update curl jq bash", "git clone \"https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git\" ../grafana-enterprise", "cd ../grafana-enterprise", "if git checkout ${DRONE_SOURCE_BRANCH}; then echo \"checked out ${DRONE_SOURCE_BRANCH}\"; elif git checkout ${DRONE_TARGET_BRANCH}; then echo \"git checkout ${DRONE_TARGET_BRANCH}\"; else git checkout main; fi", "cd ../", "ln -s src grafana", "cd ./grafana-enterprise", "./build.sh"], "failure": "ignore"}, {"name": "compile-build-cmd", "image": "golang:1.23.0-alpine", "commands": ["go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd"], "depends_on": [], "environment": {"CGO_ENABLED": 0}}, {"name": "verify-gen-cue", "image": "golang:1.23.0-alpine", "depends_on": ["clone-enterprise"], "commands": ["# It is required that code generated from Thema/CUE be committed and in sync with its inputs.", "# The following command will fail if running code generators produces any diff in output.", "apk add --update make", "CODEGEN_VERIFY=1 make gen-cue"]}, {"name": "verify-gen-jsonnet", "image": "golang:1.23.0-alpine", "depends_on": ["clone-enterprise"], "commands": ["# It is required that generated jsonnet is committed and in sync with its inputs.", "# The following command will fail if running code generators produces any diff in output.", "apk add --update make", "CODEGEN_VERIFY=1 make gen-jsonnet"]}, {"name": "wire-install", "image": "golang:1.23.0-alpine", "commands": ["apk add --update make", "make gen-go"], "depends_on": ["verify-gen-cue"]}, {"name": "sqlite-benchmark-integration-tests", "image": "golang:1.23.0-alpine", "depends_on": ["wire-install"], "commands": ["apk add --update build-base", "if [ -z ${GO_PACKAGES} ]; then echo 'missing GO_PACKAGES'; false; fi", "go test -v -run=^$ -benchmem -timeout=1h -count=8 -bench=. ${GO_PACKAGES}"]}, {"name": "postgres-benchmark-integration-tests", "image": "golang:1.23.0-alpine", "depends_on": ["wire-install"], "commands": ["apk add --update build-base", "if [ -z ${GO_PACKAGES} ]; then echo 'missing GO_PACKAGES'; false; fi", "go test -v -run=^$ -benchmem -timeout=1h -count=8 -bench=. ${GO_PACKAGES}"], "environment": {"PGPASSWORD": "grafanatest", "GRAFANA_TEST_DB": "postgres", "POSTGRES_HOST": "postgres"}}, {"name": "mysql-5.7-benchmark-integration-tests", "image": "golang:1.23.0-alpine", "depends_on": ["wire-install"], "commands": ["apk add --update build-base", "if [ -z ${GO_PACKAGES} ]; then echo 'missing GO_PACKAGES'; false; fi", "go test -v -run=^$ -benchmem -timeout=1h -count=8 -bench=. ${GO_PACKAGES}"], "environment": {"GRAFANA_TEST_DB": "mysql", "MYSQL_HOST": "mysql57"}}, {"name": "mysql-8.0-benchmark-integration-tests", "image": "golang:1.23.0-alpine", "depends_on": ["wire-install"], "commands": ["apk add --update build-base", "if [ -z ${GO_PACKAGES} ]; then echo 'missing GO_PACKAGES'; false; fi", "go test -v -run=^$ -benchmem -timeout=1h -count=8 -bench=. ${GO_PACKAGES}"], "environment": {"GRAFANA_TEST_DB": "mysql", "MYSQL_HOST": "mysql80"}}], "clone": {"retries": 3}, "volumes": [{"name": "docker", "host": {"path": "/var/run/docker.sock"}}, {"name": "postgres", "temp": {"medium": "memory"}}, {"name": "mysql57", "temp": {"medium": "memory"}}, {"name": "mysql80", "temp": {"medium": "memory"}}], "depends_on": [], "image_pull_secrets": ["gcr", "gar"], "environment": {"EDITION": "oss"}, "platform": {"os": "linux", "arch": "amd64"}, "node": {"type": "no-parallel"}} +clone: + retries: 3 +depends_on: [] +environment: + EDITION: oss +image_pull_secrets: +- gcr +- gar +kind: pipeline +name: pr-integration-benchmarks +node: + type: no-parallel +platform: + arch: amd64 + os: linux +services: +- environment: + PGDATA: /var/lib/postgresql/data/pgdata + POSTGRES_DB: grafanatest + POSTGRES_PASSWORD: grafanatest + POSTGRES_USER: grafanatest + image: postgres:12.3-alpine + name: postgres + volumes: + - name: postgres + path: /var/lib/postgresql/data/pgdata +- commands: + - docker-entrypoint.sh mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci + environment: + MYSQL_DATABASE: grafana_tests + MYSQL_PASSWORD: password + MYSQL_ROOT_PASSWORD: rootpass + MYSQL_USER: grafana + image: mysql:5.7.39 + name: mysql57 + volumes: + - name: mysql57 + path: /var/lib/mysql +- commands: + - docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password + environment: + MYSQL_DATABASE: grafana_tests + MYSQL_PASSWORD: password + MYSQL_ROOT_PASSWORD: rootpass + MYSQL_USER: grafana + image: mysql:8.0.32 + name: mysql80 + volumes: + - name: mysql80 + path: /var/lib/mysql +- commands: + - /bin/mimir -target=backend + environment: {} + image: us.gcr.io/kubernetes-dev/mimir:gotjosh-state-config-grafana-663a0ae78 + name: mimir_backend +- environment: {} + image: redis:6.2.11-alpine + name: redis +- environment: {} + image: memcached:1.6.9-alpine + name: memcached +steps: +- commands: + - apk add --update curl jq bash + - git clone "https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git" + ../grafana-enterprise + - cd ../grafana-enterprise + - if git checkout ${DRONE_SOURCE_BRANCH}; then echo "checked out ${DRONE_SOURCE_BRANCH}"; + elif git checkout ${DRONE_TARGET_BRANCH}; then echo "git checkout ${DRONE_TARGET_BRANCH}"; + else git checkout main; fi + - cd ../ + - ln -s src grafana + - cd ./grafana-enterprise + - ./build.sh + environment: + GITHUB_TOKEN: + from_secret: github_token + failure: ignore + image: alpine/git:2.40.1 + name: clone-enterprise +- commands: + - go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd + depends_on: [] + environment: + CGO_ENABLED: 0 + image: golang:1.22.5-alpine + name: compile-build-cmd +- commands: + - '# It is required that code generated from Thema/CUE be committed and in sync + with its inputs.' + - '# The following command will fail if running code generators produces any diff + in output.' + - apk add --update make + - CODEGEN_VERIFY=1 make gen-cue + depends_on: + - clone-enterprise + image: golang:1.22.5-alpine + name: verify-gen-cue +- commands: + - '# It is required that generated jsonnet is committed and in sync with its inputs.' + - '# The following command will fail if running code generators produces any diff + in output.' + - apk add --update make + - CODEGEN_VERIFY=1 make gen-jsonnet + depends_on: + - clone-enterprise + image: golang:1.22.5-alpine + name: verify-gen-jsonnet +- commands: + - apk add --update make + - make gen-go + depends_on: + - verify-gen-cue + image: golang:1.22.5-alpine + name: wire-install +- commands: + - apk add --update build-base + - if [ -z ${GO_PACKAGES} ]; then echo 'missing GO_PACKAGES'; false; fi + - go test -v -run=^$ -benchmem -timeout=1h -count=8 -bench=. ${GO_PACKAGES} + depends_on: + - wire-install + image: golang:1.22.5-alpine + name: sqlite-benchmark-integration-tests +- commands: + - apk add --update build-base + - if [ -z ${GO_PACKAGES} ]; then echo 'missing GO_PACKAGES'; false; fi + - go test -v -run=^$ -benchmem -timeout=1h -count=8 -bench=. ${GO_PACKAGES} + depends_on: + - wire-install + environment: + GRAFANA_TEST_DB: postgres + PGPASSWORD: grafanatest + POSTGRES_HOST: postgres + image: golang:1.22.5-alpine + name: postgres-benchmark-integration-tests +- commands: + - apk add --update build-base + - if [ -z ${GO_PACKAGES} ]; then echo 'missing GO_PACKAGES'; false; fi + - go test -v -run=^$ -benchmem -timeout=1h -count=8 -bench=. ${GO_PACKAGES} + depends_on: + - wire-install + environment: + GRAFANA_TEST_DB: mysql + MYSQL_HOST: mysql57 + image: golang:1.22.5-alpine + name: mysql-5.7-benchmark-integration-tests +- commands: + - apk add --update build-base + - if [ -z ${GO_PACKAGES} ]; then echo 'missing GO_PACKAGES'; false; fi + - go test -v -run=^$ -benchmem -timeout=1h -count=8 -bench=. ${GO_PACKAGES} + depends_on: + - wire-install + environment: + GRAFANA_TEST_DB: mysql + MYSQL_HOST: mysql80 + image: golang:1.22.5-alpine + name: mysql-8.0-benchmark-integration-tests +trigger: + event: + - promote + target: + - gobenchmarks +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker +- name: postgres + temp: + medium: memory +- name: mysql57 + temp: + medium: memory +- name: mysql80 + temp: + medium: memory --- -{"kind": "pipeline", "type": "docker", "name": "main-docs", "trigger": {"branch": "main", "event": ["push"], "repo": ["grafana/grafana"], "paths": {"include": ["*.md", "docs/**", "packages/**/*.md", "latest.json"]}}, "services": [], "steps": [{"name": "identify-runner", "image": "alpine:3.19.1", "commands": ["echo $DRONE_RUNNER_NAME"]}, {"name": "yarn-install", "image": "node:20.9.0-alpine", "commands": ["yarn install --immutable"], "depends_on": []}, {"name": "codespell", "image": "python:3.8", "commands": ["pip3 install codespell", "codespell -I .codespellignore docs/"]}, {"name": "lint-docs", "image": "node:20.9.0-alpine", "depends_on": ["yarn-install"], "environment": {"NODE_OPTIONS": "--max_old_space_size=8192"}, "commands": ["yarn run prettier:checkDocs"]}, {"name": "build-docs-website", "image": "grafana/docs-base:latest", "pull": "always", "commands": ["mkdir -p /hugo/content/docs/grafana/latest", "echo -e '---\\nredirectURL: /docs/grafana/latest/\\ntype: redirect\\nversioned: true\\n---\\n' > /hugo/content/docs/grafana/_index.md", "cp -r docs/sources/* /hugo/content/docs/grafana/latest/", "cd /hugo && make prod"]}, {"name": "verify-gen-cue", "image": "golang:1.23.0-alpine", "depends_on": [], "commands": ["# It is required that code generated from Thema/CUE be committed and in sync with its inputs.", "# The following command will fail if running code generators produces any diff in output.", "apk add --update make", "CODEGEN_VERIFY=1 make gen-cue"]}], "clone": {"retries": 3}, "volumes": [{"name": "docker", "host": {"path": "/var/run/docker.sock"}}], "depends_on": [], "image_pull_secrets": ["gcr", "gar"], "environment": {"EDITION": "oss"}, "platform": {"os": "linux", "arch": "amd64"}, "node": {"type": "no-parallel"}} +clone: + retries: 3 +depends_on: [] +environment: + EDITION: oss +image_pull_secrets: +- gcr +- gar +kind: pipeline +name: main-docs +node: + type: no-parallel +platform: + arch: amd64 + os: linux +services: [] +steps: +- commands: + - echo $DRONE_RUNNER_NAME + image: alpine:3.19.1 + name: identify-runner +- commands: + - yarn install --immutable + depends_on: [] + image: node:20.9.0-alpine + name: yarn-install +- commands: + - pip3 install codespell + - codespell -I .codespellignore docs/ + image: python:3.8 + name: codespell +- commands: + - yarn run prettier:checkDocs + depends_on: + - yarn-install + environment: + NODE_OPTIONS: --max_old_space_size=8192 + image: node:20.9.0-alpine + name: lint-docs +- commands: + - mkdir -p /hugo/content/docs/grafana/latest + - 'echo -e ''---\nredirectURL: /docs/grafana/latest/\ntype: redirect\nversioned: + true\n---\n'' > /hugo/content/docs/grafana/_index.md' + - cp -r docs/sources/* /hugo/content/docs/grafana/latest/ + - cd /hugo && make prod + image: grafana/docs-base:latest + name: build-docs-website + pull: always +- commands: + - '# It is required that code generated from Thema/CUE be committed and in sync + with its inputs.' + - '# The following command will fail if running code generators produces any diff + in output.' + - apk add --update make + - CODEGEN_VERIFY=1 make gen-cue + depends_on: [] + image: golang:1.22.5-alpine + name: verify-gen-cue +trigger: + branch: main + event: + - push + paths: + include: + - '*.md' + - docs/** + - packages/**/*.md + - latest.json + repo: + - grafana/grafana +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker --- -{"kind": "pipeline", "type": "docker", "name": "main-test-frontend", "trigger": {"event": ["push"], "branch": "main", "paths": {"exclude": ["*.md", "docs/**", "latest.json"]}, "repo": ["grafana/grafana"]}, "services": [], "steps": [{"name": "identify-runner", "image": "alpine:3.19.1", "commands": ["echo $DRONE_RUNNER_NAME"]}, {"name": "yarn-install", "image": "node:20.9.0-alpine", "commands": ["yarn install --immutable"], "depends_on": []}, {"name": "betterer-frontend", "image": "node:20.9.0-alpine", "depends_on": ["yarn-install"], "commands": ["apk add --update git bash", "yarn betterer ci"]}, {"name": "test-frontend", "image": "node:20.9.0-alpine", "environment": {"TEST_MAX_WORKERS": "50%"}, "depends_on": ["yarn-install"], "commands": ["yarn run ci:test-frontend"]}], "clone": {"retries": 3}, "volumes": [{"name": "docker", "host": {"path": "/var/run/docker.sock"}}], "depends_on": [], "image_pull_secrets": ["gcr", "gar"], "environment": {"EDITION": "oss"}, "platform": {"os": "linux", "arch": "amd64"}, "node": {"type": "no-parallel"}} +clone: + retries: 3 +depends_on: [] +environment: + EDITION: oss +image_pull_secrets: +- gcr +- gar +kind: pipeline +name: main-test-frontend +node: + type: no-parallel +platform: + arch: amd64 + os: linux +services: [] +steps: +- commands: + - echo $DRONE_RUNNER_NAME + image: alpine:3.19.1 + name: identify-runner +- commands: + - yarn install --immutable + depends_on: [] + image: node:20.9.0-alpine + name: yarn-install +- commands: + - apk add --update git bash + - yarn betterer ci + depends_on: + - yarn-install + image: node:20.9.0-alpine + name: betterer-frontend +- commands: + - yarn run ci:test-frontend + depends_on: + - yarn-install + environment: + TEST_MAX_WORKERS: 50% + image: node:20.9.0-alpine + name: test-frontend +trigger: + branch: main + event: + - push + paths: + exclude: + - '*.md' + - docs/** + - latest.json + repo: + - grafana/grafana +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker --- -{"kind": "pipeline", "type": "docker", "name": "main-lint-frontend", "trigger": {"event": ["push"], "branch": "main", "paths": {"exclude": ["*.md", "docs/**", "latest.json"]}, "repo": ["grafana/grafana"]}, "services": [], "steps": [{"name": "identify-runner", "image": "alpine:3.19.1", "commands": ["echo $DRONE_RUNNER_NAME"]}, {"name": "yarn-install", "image": "node:20.9.0-alpine", "commands": ["yarn install --immutable"], "depends_on": []}, {"name": "lint-frontend", "image": "node:20.9.0-alpine", "environment": {"TEST_MAX_WORKERS": "50%"}, "depends_on": ["yarn-install"], "commands": ["yarn run prettier:check", "yarn run lint", "yarn run typecheck"]}, {"name": "verify-i18n", "image": "node:20.9.0-alpine", "depends_on": ["yarn-install"], "commands": ["apk add --update git", "yarn run i18n:extract || (echo \"\nExtraction failed. Make sure that you have no dynamic translation phrases, such as 't(\\`preferences.theme.\\$${themeID}\\`, themeName)' and that no translation key is used twice. Search the output for '[warning]' to find the offending file.\" \u0026\u0026 false)", "\n file_diff=$(git diff --dirstat public/locales)\n if [ -n \"$file_diff\" ]; then\n echo $file_diff\n echo \"\nTranslation extraction has not been committed. Please run 'yarn i18n:extract', commit the changes and push again.\"\n exit 1\n fi\n ", "yarn run i18n:compile"]}], "clone": {"retries": 3}, "volumes": [{"name": "docker", "host": {"path": "/var/run/docker.sock"}}], "depends_on": [], "image_pull_secrets": ["gcr", "gar"], "environment": {"EDITION": "oss"}, "platform": {"os": "linux", "arch": "amd64"}, "node": {"type": "no-parallel"}} +clone: + retries: 3 +depends_on: [] +environment: + EDITION: oss +image_pull_secrets: +- gcr +- gar +kind: pipeline +name: main-lint-frontend +node: + type: no-parallel +platform: + arch: amd64 + os: linux +services: [] +steps: +- commands: + - echo $DRONE_RUNNER_NAME + image: alpine:3.19.1 + name: identify-runner +- commands: + - yarn install --immutable + depends_on: [] + image: node:20.9.0-alpine + name: yarn-install +- commands: + - yarn run prettier:check + - yarn run lint + - yarn run typecheck + depends_on: + - yarn-install + environment: + TEST_MAX_WORKERS: 50% + image: node:20.9.0-alpine + name: lint-frontend +- commands: + - apk add --update git + - |- + yarn run i18n:extract || (echo " + Extraction failed. Make sure that you have no dynamic translation phrases, such as 't(\`preferences.theme.\$${themeID}\`, themeName)' and that no translation key is used twice. Search the output for '[warning]' to find the offending file." && false) + - "\n file_diff=$(git diff --dirstat public/locales)\n if + [ -n \"$file_diff\" ]; then\n echo $file_diff\n echo + \"\nTranslation extraction has not been committed. Please run 'yarn i18n:extract', + commit the changes and push again.\"\n exit 1\n fi\n + \ " + - yarn run i18n:compile + depends_on: + - yarn-install + image: node:20.9.0-alpine + name: verify-i18n +trigger: + branch: main + event: + - push + paths: + exclude: + - '*.md' + - docs/** + - latest.json + repo: + - grafana/grafana +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker --- -{"kind": "pipeline", "type": "docker", "name": "main-test-backend", "trigger": {"event": ["push"], "branch": "main", "paths": {"exclude": ["*.md", "docs/**", "latest.json"]}, "repo": ["grafana/grafana"]}, "services": [], "steps": [{"name": "identify-runner", "image": "alpine:3.19.1", "commands": ["echo $DRONE_RUNNER_NAME"]}, {"name": "verify-gen-cue", "image": "golang:1.23.0-alpine", "depends_on": [], "commands": ["# It is required that code generated from Thema/CUE be committed and in sync with its inputs.", "# The following command will fail if running code generators produces any diff in output.", "apk add --update make", "CODEGEN_VERIFY=1 make gen-cue"]}, {"name": "verify-gen-jsonnet", "image": "golang:1.23.0-alpine", "depends_on": [], "commands": ["# It is required that generated jsonnet is committed and in sync with its inputs.", "# The following command will fail if running code generators produces any diff in output.", "apk add --update make", "CODEGEN_VERIFY=1 make gen-jsonnet"]}, {"name": "wire-install", "image": "golang:1.23.0-alpine", "commands": ["apk add --update make", "make gen-go"], "depends_on": ["verify-gen-cue"]}, {"name": "test-backend", "image": "golang:1.23.0-alpine", "depends_on": ["wire-install"], "commands": ["apk add --update build-base shared-mime-info shared-mime-info-lang", "go list -f '{{.Dir}}/...' -m | xargs go test -tags requires_buildifer -short -covermode=atomic -timeout=5m"]}, {"name": "test-backend-integration", "image": "golang:1.23.0-alpine", "depends_on": ["wire-install"], "commands": ["apk add --update build-base", "go test -count=1 -covermode=atomic -timeout=5m -run '^TestIntegration' $(find ./pkg -type f -name '*_test.go' -exec grep -l '^func TestIntegration' '{}' '+' | grep -o '\\(.*\\)/' | sort -u)"]}], "clone": {"retries": 3}, "volumes": [{"name": "docker", "host": {"path": "/var/run/docker.sock"}}], "depends_on": [], "image_pull_secrets": ["gcr", "gar"], "environment": {"EDITION": "oss"}, "platform": {"os": "linux", "arch": "amd64"}, "node": {"type": "no-parallel"}} +clone: + retries: 3 +depends_on: [] +environment: + EDITION: oss +image_pull_secrets: +- gcr +- gar +kind: pipeline +name: main-test-backend +node: + type: no-parallel +platform: + arch: amd64 + os: linux +services: [] +steps: +- commands: + - echo $DRONE_RUNNER_NAME + image: alpine:3.19.1 + name: identify-runner +- commands: + - '# It is required that code generated from Thema/CUE be committed and in sync + with its inputs.' + - '# The following command will fail if running code generators produces any diff + in output.' + - apk add --update make + - CODEGEN_VERIFY=1 make gen-cue + depends_on: [] + image: golang:1.22.5-alpine + name: verify-gen-cue +- commands: + - '# It is required that generated jsonnet is committed and in sync with its inputs.' + - '# The following command will fail if running code generators produces any diff + in output.' + - apk add --update make + - CODEGEN_VERIFY=1 make gen-jsonnet + depends_on: [] + image: golang:1.22.5-alpine + name: verify-gen-jsonnet +- commands: + - apk add --update make + - make gen-go + depends_on: + - verify-gen-cue + image: golang:1.22.5-alpine + name: wire-install +- commands: + - apk add --update build-base shared-mime-info shared-mime-info-lang + - go list -f '{{.Dir}}/...' -m | xargs go test -tags requires_buildifer -short -covermode=atomic + -timeout=5m + depends_on: + - wire-install + image: golang:1.22.5-alpine + name: test-backend +- commands: + - apk add --update build-base + - go test -count=1 -covermode=atomic -timeout=5m -run '^TestIntegration' $(find + ./pkg -type f -name '*_test.go' -exec grep -l '^func TestIntegration' '{}' '+' + | grep -o '\(.*\)/' | sort -u) + depends_on: + - wire-install + image: golang:1.22.5-alpine + name: test-backend-integration +trigger: + branch: main + event: + - push + paths: + exclude: + - '*.md' + - docs/** + - latest.json + repo: + - grafana/grafana +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker --- -{"kind": "pipeline", "type": "docker", "name": "main-lint-backend", "trigger": {"event": ["push"], "branch": "main", "paths": {"exclude": ["*.md", "docs/**", "latest.json"]}, "repo": ["grafana/grafana"]}, "services": [], "steps": [{"name": "identify-runner", "image": "alpine:3.19.1", "commands": ["echo $DRONE_RUNNER_NAME"]}, {"name": "compile-build-cmd", "image": "golang:1.23.0-alpine", "commands": ["go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd"], "depends_on": [], "environment": {"CGO_ENABLED": 0}}, {"name": "wire-install", "image": "golang:1.23.0-alpine", "commands": ["apk add --update make", "make gen-go"], "depends_on": []}, {"name": "lint-backend", "image": "golang:1.23.0-alpine", "environment": {"CGO_ENABLED": "1"}, "depends_on": ["wire-install"], "commands": ["apk add --update make build-base", "make lint-go"]}, {"name": "validate-modfile", "image": "golang:1.23.0-alpine", "commands": ["go run scripts/modowners/modowners.go check go.mod"]}, {"name": "validate-openapi-spec", "image": "golang:1.23.0-alpine", "commands": ["apk add --update make", "make swagger-validate"]}, {"name": "lint-drone", "image": "byrnedo/alpine-curl:0.1.8", "commands": ["./bin/build verify-drone"], "depends_on": ["compile-build-cmd"]}], "clone": {"retries": 3}, "volumes": [{"name": "docker", "host": {"path": "/var/run/docker.sock"}}], "depends_on": [], "image_pull_secrets": ["gcr", "gar"], "environment": {"EDITION": "oss"}, "platform": {"os": "linux", "arch": "amd64"}, "node": {"type": "no-parallel"}} +clone: + retries: 3 +depends_on: [] +environment: + EDITION: oss +image_pull_secrets: +- gcr +- gar +kind: pipeline +name: main-lint-backend +node: + type: no-parallel +platform: + arch: amd64 + os: linux +services: [] +steps: +- commands: + - echo $DRONE_RUNNER_NAME + image: alpine:3.19.1 + name: identify-runner +- commands: + - go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd + depends_on: [] + environment: + CGO_ENABLED: 0 + image: golang:1.22.5-alpine + name: compile-build-cmd +- commands: + - apk add --update make + - make gen-go + depends_on: [] + image: golang:1.22.5-alpine + name: wire-install +- commands: + - apk add --update make build-base + - make lint-go + depends_on: + - wire-install + environment: + CGO_ENABLED: "1" + image: golang:1.22.5-alpine + name: lint-backend +- commands: + - go run scripts/modowners/modowners.go check go.mod + image: golang:1.22.5-alpine + name: validate-modfile +- commands: + - apk add --update make + - make swagger-validate + image: golang:1.22.5-alpine + name: validate-openapi-spec +- commands: + - ./bin/build verify-drone + depends_on: + - compile-build-cmd + image: byrnedo/alpine-curl:0.1.8 + name: lint-drone +trigger: + branch: main + event: + - push + paths: + exclude: + - '*.md' + - docs/** + - latest.json + repo: + - grafana/grafana +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker --- -{"kind": "pipeline", "type": "docker", "name": "main-build-e2e-publish", "trigger": {"event": ["push"], "branch": "main", "paths": {"exclude": ["*.md", "docs/**", "latest.json"]}, "repo": ["grafana/grafana"]}, "services": [], "steps": [{"name": "identify-runner", "image": "alpine:3.19.1", "commands": ["echo $DRONE_RUNNER_NAME"]}, {"name": "grabpl", "image": "byrnedo/alpine-curl:0.1.8", "commands": ["mkdir -p bin", "curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.50/grabpl", "chmod +x bin/grabpl"]}, {"name": "compile-build-cmd", "image": "golang:1.23.0-alpine", "commands": ["go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd"], "depends_on": [], "environment": {"CGO_ENABLED": 0}}, {"name": "verify-gen-cue", "image": "golang:1.23.0-alpine", "depends_on": [], "commands": ["# It is required that code generated from Thema/CUE be committed and in sync with its inputs.", "# The following command will fail if running code generators produces any diff in output.", "apk add --update make", "CODEGEN_VERIFY=1 make gen-cue"]}, {"name": "verify-gen-jsonnet", "image": "golang:1.23.0-alpine", "depends_on": [], "commands": ["# It is required that generated jsonnet is committed and in sync with its inputs.", "# The following command will fail if running code generators produces any diff in output.", "apk add --update make", "CODEGEN_VERIFY=1 make gen-jsonnet"]}, {"name": "wire-install", "image": "golang:1.23.0-alpine", "commands": ["apk add --update make", "make gen-go"], "depends_on": ["verify-gen-cue"]}, {"name": "yarn-install", "image": "node:20.9.0-alpine", "commands": ["yarn install --immutable"], "depends_on": []}, {"name": "update-package-json-version", "image": "node:20.9.0-alpine", "depends_on": ["yarn-install"], "commands": ["apk add --update jq", "new_version=$(cat package.json | jq .version | sed s/pre/${DRONE_BUILD_NUMBER}/g)", "echo \"New version: $new_version\"", "yarn run lerna version $new_version --exact --no-git-tag-version --no-push --force-publish -y", "yarn install --mode=update-lockfile"]}, {"name": "build-frontend-packages", "image": "node:20.9.0-alpine", "environment": {"NODE_OPTIONS": "--max_old_space_size=8192"}, "depends_on": ["yarn-install", "update-package-json-version"], "commands": ["apk add --update jq bash", "yarn packages:build", "yarn packages:pack", "./scripts/validate-npm-packages.sh"]}, {"name": "rgm-package", "image": "grafana/grafana-build:main", "pull": "always", "depends_on": ["update-package-json-version"], "commands": ["/src/grafana-build artifacts -a targz:grafana:linux/amd64 -a targz:grafana:linux/arm64 -a targz:grafana:linux/arm/v7 --go-version=1.23.0 --yarn-cache=$$YARN_CACHE_FOLDER --build-id=$$DRONE_BUILD_NUMBER --grafana-dir=$$PWD > packages.txt"], "volumes": [{"name": "docker", "path": "/var/run/docker.sock"}]}, {"name": "grafana-server", "image": "alpine:3.19.1", "detach": true, "depends_on": ["rgm-package"], "environment": {"GF_SERVER_HTTP_PORT": "3001", "GF_SERVER_ROUTER_LOGGING": "1", "GF_APP_MODE": "development"}, "commands": ["apk add --update tar bash", "mkdir grafana", "tar --strip-components=1 -xvf ./dist/*amd64.tar.gz -C grafana", "cp -r devenv scripts tools grafana && cd grafana && ./scripts/grafana-server/start-server"]}, {"name": "end-to-end-tests-dashboards-suite", "image": "cypress/included:13.1.0", "depends_on": ["grafana-server"], "environment": {"HOST": "grafana-server"}, "commands": ["./bin/build e2e-tests --port 3001 --suite dashboards-suite"]}, {"name": "end-to-end-tests-smoke-tests-suite", "image": "cypress/included:13.1.0", "depends_on": ["grafana-server"], "environment": {"HOST": "grafana-server"}, "commands": ["./bin/build e2e-tests --port 3001 --suite smoke-tests-suite"]}, {"name": "end-to-end-tests-panels-suite", "image": "cypress/included:13.1.0", "depends_on": ["grafana-server"], "environment": {"HOST": "grafana-server"}, "commands": ["./bin/build e2e-tests --port 3001 --suite panels-suite"]}, {"name": "end-to-end-tests-various-suite", "image": "cypress/included:13.1.0", "depends_on": ["grafana-server"], "environment": {"HOST": "grafana-server"}, "commands": ["./bin/build e2e-tests --port 3001 --suite various-suite"]}, {"name": "end-to-end-tests-cloud-plugins-suite-azure", "image": "us-docker.pkg.dev/grafanalabs-dev/cloud-data-sources/e2e-13.1.0:1.0.0", "depends_on": ["grafana-server"], "environment": {"CYPRESS_CI": "true", "HOST": "grafana-server", "GITHUB_TOKEN": {"from_secret": "github_token"}, "AZURE_SP_APP_ID": {"from_secret": "azure_sp_app_id"}, "AZURE_SP_PASSWORD": {"from_secret": "azure_sp_app_pw"}, "AZURE_TENANT": {"from_secret": "azure_tenant"}}, "commands": ["cd /", "./cpp-e2e/scripts/ci-run.sh azure ${DRONE_SOURCE_BRANCH}"], "when": {"repo": ["grafana/grafana"], "paths": {"include": ["pkg/tsdb/azuremonitor/**", "public/app/plugins/datasource/azuremonitor/**", "e2e/cloud-plugins-suite/azure-monitor.spec.ts"]}}}, {"name": "e2e-tests-artifacts-upload", "image": "google/cloud-sdk:431.0.0", "depends_on": ["end-to-end-tests-dashboards-suite", "end-to-end-tests-panels-suite", "end-to-end-tests-smoke-tests-suite", "end-to-end-tests-various-suite"], "failure": "ignore", "when": {"status": ["success", "failure"]}, "environment": {"GCP_GRAFANA_UPLOAD_ARTIFACTS_KEY": {"from_secret": "gcp_upload_artifacts_key"}, "E2E_TEST_ARTIFACTS_BUCKET": "releng-pipeline-artifacts-dev", "GITHUB_TOKEN": {"from_secret": "github_token"}}, "commands": ["apt-get update", "apt-get install -yq zip", "printenv GCP_GRAFANA_UPLOAD_ARTIFACTS_KEY > /tmp/gcpkey_upload_artifacts.json", "gcloud auth activate-service-account --key-file=/tmp/gcpkey_upload_artifacts.json", "find ./e2e -type f -name \"*spec.ts.mp4\" | zip e2e/videos.zip -@", "gsutil cp e2e/videos.zip gs://$${E2E_TEST_ARTIFACTS_BUCKET}/${DRONE_BUILD_NUMBER}/artifacts/videos/videos.zip", "export E2E_ARTIFACTS_VIDEO_ZIP=https://storage.googleapis.com/$${E2E_TEST_ARTIFACTS_BUCKET}/${DRONE_BUILD_NUMBER}/artifacts/videos/videos.zip", "echo \"E2E Test artifacts uploaded to: $${E2E_ARTIFACTS_VIDEO_ZIP}\"", "curl -X POST https://api.github.com/repos/${DRONE_REPO}/statuses/${DRONE_COMMIT_SHA} -H \"Authorization: token $${GITHUB_TOKEN}\" -d \"{\\\"state\\\":\\\"success\\\",\\\"target_url\\\":\\\"$${E2E_ARTIFACTS_VIDEO_ZIP}\\\", \\\"description\\\": \\\"Click on the details to download e2e recording videos\\\", \\\"context\\\": \\\"e2e_artifacts\\\"}\""]}, {"name": "build-storybook", "image": "node:20.9.0-alpine", "depends_on": ["rgm-package", "build-frontend-packages"], "environment": {"NODE_OPTIONS": "--max_old_space_size=4096"}, "commands": ["yarn storybook:build", "./bin/build verify-storybook"], "when": {"paths": {"include": ["packages/grafana-ui/**"]}}}, {"name": "test-a11y-frontend", "image": "grafana/docker-puppeteer:1.1.0", "depends_on": ["grafana-server"], "environment": {"GRAFANA_MISC_STATS_API_KEY": {"from_secret": "grafana_misc_stats_api_key"}, "HOST": "grafana-server", "PORT": 3001}, "failure": "ignore", "commands": ["npx wait-on@7.0.1 http://$HOST:$PORT", "pa11y-ci --config .pa11yci.conf.js --json > pa11y-ci-results.json"]}, {"name": "store-storybook", "image": "grafana/grafana-ci-deploy:1.3.3", "depends_on": ["build-storybook", "end-to-end-tests-dashboards-suite", "end-to-end-tests-panels-suite", "end-to-end-tests-smoke-tests-suite", "end-to-end-tests-various-suite"], "environment": {"GCP_KEY": {"from_secret": "gcp_grafanauploads"}, "PRERELEASE_BUCKET": {"from_secret": "prerelease_bucket"}}, "commands": ["./bin/build store-storybook --deployment canary"], "when": {"repo": ["grafana/grafana"], "paths": {"include": ["packages/grafana-ui/**"]}}}, {"name": "publish-frontend-metrics", "image": "node:20.9.0-alpine", "depends_on": ["test-a11y-frontend"], "environment": {"GRAFANA_MISC_STATS_API_KEY": {"from_secret": "grafana_misc_stats_api_key"}}, "failure": "ignore", "commands": ["apk add --update bash grep git", "./scripts/ci-frontend-metrics.sh ./grafana/public/build | ./bin/build publish-metrics $$GRAFANA_MISC_STATS_API_KEY"], "when": {"repo": ["grafana/grafana"]}}, {"name": "rgm-build-docker", "image": "grafana/grafana-build:main", "pull": "always", "commands": ["docker run --privileged --rm tonistiigi/binfmt --install all", "/src/grafana-build artifacts -a docker:grafana:linux/amd64 -a docker:grafana:linux/amd64:ubuntu -a docker:grafana:linux/arm64 -a docker:grafana:linux/arm64:ubuntu -a docker:grafana:linux/arm/v7 -a docker:grafana:linux/arm/v7:ubuntu --yarn-cache=$$YARN_CACHE_FOLDER --build-id=$$DRONE_BUILD_NUMBER --go-version=1.23.0 --ubuntu-base=ubuntu:22.04 --alpine-base=alpine:3.19.1 --tag-format='{{ .version_base }}-{{ .buildID }}-{{ .arch }}' --grafana-dir=$$PWD --ubuntu-tag-format='{{ .version_base }}-{{ .buildID }}-ubuntu-{{ .arch }}' > docker.txt", "find ./dist -name '*docker*.tar.gz' -type f | xargs -n1 docker load -i"], "volumes": [{"name": "docker", "path": "/var/run/docker.sock"}], "depends_on": ["update-package-json-version"]}, {"name": "publish-images-grafana", "image": "google/cloud-sdk:431.0.0", "environment": {"GCP_KEY": {"from_secret": "gcp_grafanauploads"}, "DOCKER_USER": {"from_secret": "docker_username"}, "DOCKER_PASSWORD": {"from_secret": "docker_password"}, "GITHUB_APP_ID": {"from_secret": "delivery-bot-app-id"}, "GITHUB_APP_INSTALLATION_ID": {"from_secret": "delivery-bot-app-installation-id"}, "GITHUB_APP_PRIVATE_KEY": {"from_secret": "delivery-bot-app-private-key"}}, "commands": ["./bin/grabpl artifacts docker publish --dockerhub-repo grafana/grafana"], "depends_on": ["rgm-build-docker"], "volumes": [{"name": "docker", "path": "/var/run/docker.sock"}], "when": {"repo": ["grafana/grafana"]}}, {"name": "publish-images-grafana-oss", "image": "google/cloud-sdk:431.0.0", "environment": {"GCP_KEY": {"from_secret": "gcp_grafanauploads"}, "DOCKER_USER": {"from_secret": "docker_username"}, "DOCKER_PASSWORD": {"from_secret": "docker_password"}, "GITHUB_APP_ID": {"from_secret": "delivery-bot-app-id"}, "GITHUB_APP_INSTALLATION_ID": {"from_secret": "delivery-bot-app-installation-id"}, "GITHUB_APP_PRIVATE_KEY": {"from_secret": "delivery-bot-app-private-key"}}, "commands": ["./bin/grabpl artifacts docker publish --dockerhub-repo grafana/grafana-oss"], "depends_on": ["rgm-build-docker"], "volumes": [{"name": "docker", "path": "/var/run/docker.sock"}], "when": {"repo": ["grafana/grafana"]}}, {"name": "release-canary-npm-packages", "image": "node:20.9.0-alpine", "depends_on": ["end-to-end-tests-dashboards-suite", "end-to-end-tests-panels-suite", "end-to-end-tests-smoke-tests-suite", "end-to-end-tests-various-suite", "build-frontend-packages"], "environment": {"NPM_TOKEN": {"from_secret": "npm_token"}}, "commands": ["apk add --update bash", "./scripts/publish-npm-packages.sh --dist-tag 'canary' --registry 'https://registry.npmjs.org'"], "when": {"repo": ["grafana/grafana"], "paths": {"include": ["packages/**"]}}}, {"name": "upload-packages", "image": "grafana/grafana-ci-deploy:1.3.3", "depends_on": ["end-to-end-tests-dashboards-suite", "end-to-end-tests-panels-suite", "end-to-end-tests-smoke-tests-suite", "end-to-end-tests-various-suite"], "environment": {"GCP_KEY": {"from_secret": "gcp_grafanauploads_base64"}, "PRERELEASE_BUCKET": {"from_secret": "prerelease_bucket"}}, "commands": ["./bin/build upload-packages --edition oss"], "when": {"repo": ["grafana/grafana"]}}, {"name": "upload-cdn-assets", "image": "grafana/grafana-ci-deploy:1.3.3", "depends_on": ["grafana-server"], "environment": {"GCP_KEY": {"from_secret": "gcp_grafanauploads"}, "PRERELEASE_BUCKET": {"from_secret": "prerelease_bucket"}}, "commands": ["./bin/build upload-cdn --edition oss"], "when": {"repo": ["grafana/grafana"]}}], "clone": {"retries": 3}, "volumes": [{"name": "docker", "host": {"path": "/var/run/docker.sock"}}], "depends_on": [], "image_pull_secrets": ["gcr", "gar"], "environment": {"EDITION": "oss"}, "platform": {"os": "linux", "arch": "amd64"}, "node": {"type": "no-parallel"}} +clone: + retries: 3 +depends_on: [] +environment: + EDITION: oss +image_pull_secrets: +- gcr +- gar +kind: pipeline +name: main-build-e2e-publish +node: + type: no-parallel +platform: + arch: amd64 + os: linux +services: [] +steps: +- commands: + - echo $DRONE_RUNNER_NAME + image: alpine:3.19.1 + name: identify-runner +- commands: + - mkdir -p bin + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.50/grabpl + - chmod +x bin/grabpl + image: byrnedo/alpine-curl:0.1.8 + name: grabpl +- commands: + - go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd + depends_on: [] + environment: + CGO_ENABLED: 0 + image: golang:1.22.5-alpine + name: compile-build-cmd +- commands: + - '# It is required that code generated from Thema/CUE be committed and in sync + with its inputs.' + - '# The following command will fail if running code generators produces any diff + in output.' + - apk add --update make + - CODEGEN_VERIFY=1 make gen-cue + depends_on: [] + image: golang:1.22.5-alpine + name: verify-gen-cue +- commands: + - '# It is required that generated jsonnet is committed and in sync with its inputs.' + - '# The following command will fail if running code generators produces any diff + in output.' + - apk add --update make + - CODEGEN_VERIFY=1 make gen-jsonnet + depends_on: [] + image: golang:1.22.5-alpine + name: verify-gen-jsonnet +- commands: + - apk add --update make + - make gen-go + depends_on: + - verify-gen-cue + image: golang:1.22.5-alpine + name: wire-install +- commands: + - yarn install --immutable + depends_on: [] + image: node:20.9.0-alpine + name: yarn-install +- commands: + - apk add --update jq + - new_version=$(cat package.json | jq .version | sed s/pre/${DRONE_BUILD_NUMBER}/g) + - 'echo "New version: $new_version"' + - yarn run lerna version $new_version --exact --no-git-tag-version --no-push --force-publish + -y + - yarn install --mode=update-lockfile + depends_on: + - yarn-install + image: node:20.9.0-alpine + name: update-package-json-version +- commands: + - apk add --update jq bash + - yarn packages:build + - yarn packages:pack + - ./scripts/validate-npm-packages.sh + depends_on: + - yarn-install + - update-package-json-version + environment: + NODE_OPTIONS: --max_old_space_size=8192 + image: node:20.9.0-alpine + name: build-frontend-packages +- commands: + - /src/grafana-build artifacts -a targz:grafana:linux/amd64 -a targz:grafana:linux/arm64 + -a targz:grafana:linux/arm/v7 --go-version=1.22.5 --yarn-cache=$$YARN_CACHE_FOLDER + --build-id=$$DRONE_BUILD_NUMBER --grafana-dir=$$PWD > packages.txt + depends_on: + - update-package-json-version + image: grafana/grafana-build:main + name: rgm-package + pull: always + volumes: + - name: docker + path: /var/run/docker.sock +- commands: + - apk add --update tar bash + - mkdir grafana + - tar --strip-components=1 -xvf ./dist/*amd64.tar.gz -C grafana + - cp -r devenv scripts tools grafana && cd grafana && ./scripts/grafana-server/start-server + depends_on: + - rgm-package + detach: true + environment: + GF_APP_MODE: development + GF_SERVER_HTTP_PORT: "3001" + GF_SERVER_ROUTER_LOGGING: "1" + image: alpine:3.19.1 + name: grafana-server +- commands: + - ./bin/build e2e-tests --port 3001 --suite dashboards-suite + depends_on: + - grafana-server + environment: + HOST: grafana-server + image: cypress/included:13.1.0 + name: end-to-end-tests-dashboards-suite +- commands: + - ./bin/build e2e-tests --port 3001 --suite smoke-tests-suite + depends_on: + - grafana-server + environment: + HOST: grafana-server + image: cypress/included:13.1.0 + name: end-to-end-tests-smoke-tests-suite +- commands: + - ./bin/build e2e-tests --port 3001 --suite panels-suite + depends_on: + - grafana-server + environment: + HOST: grafana-server + image: cypress/included:13.1.0 + name: end-to-end-tests-panels-suite +- commands: + - ./bin/build e2e-tests --port 3001 --suite various-suite + depends_on: + - grafana-server + environment: + HOST: grafana-server + image: cypress/included:13.1.0 + name: end-to-end-tests-various-suite +- commands: + - cd / + - ./cpp-e2e/scripts/ci-run.sh azure ${DRONE_SOURCE_BRANCH} + depends_on: + - grafana-server + environment: + AZURE_SP_APP_ID: + from_secret: azure_sp_app_id + AZURE_SP_PASSWORD: + from_secret: azure_sp_app_pw + AZURE_TENANT: + from_secret: azure_tenant + CYPRESS_CI: "true" + GITHUB_TOKEN: + from_secret: github_token + HOST: grafana-server + image: us-docker.pkg.dev/grafanalabs-dev/cloud-data-sources/e2e-13.1.0:1.0.0 + name: end-to-end-tests-cloud-plugins-suite-azure + when: + paths: + include: + - pkg/tsdb/azuremonitor/** + - public/app/plugins/datasource/azuremonitor/** + - e2e/cloud-plugins-suite/azure-monitor.spec.ts + repo: + - grafana/grafana +- commands: + - apt-get update + - apt-get install -yq zip + - printenv GCP_GRAFANA_UPLOAD_ARTIFACTS_KEY > /tmp/gcpkey_upload_artifacts.json + - gcloud auth activate-service-account --key-file=/tmp/gcpkey_upload_artifacts.json + - find ./e2e -type f -name "*spec.ts.mp4" | zip e2e/videos.zip -@ + - gsutil cp e2e/videos.zip gs://$${E2E_TEST_ARTIFACTS_BUCKET}/${DRONE_BUILD_NUMBER}/artifacts/videos/videos.zip + - export E2E_ARTIFACTS_VIDEO_ZIP=https://storage.googleapis.com/$${E2E_TEST_ARTIFACTS_BUCKET}/${DRONE_BUILD_NUMBER}/artifacts/videos/videos.zip + - 'echo "E2E Test artifacts uploaded to: $${E2E_ARTIFACTS_VIDEO_ZIP}"' + - 'curl -X POST https://api.github.com/repos/${DRONE_REPO}/statuses/${DRONE_COMMIT_SHA} + -H "Authorization: token $${GITHUB_TOKEN}" -d "{\"state\":\"success\",\"target_url\":\"$${E2E_ARTIFACTS_VIDEO_ZIP}\", + \"description\": \"Click on the details to download e2e recording videos\", \"context\": + \"e2e_artifacts\"}"' + depends_on: + - end-to-end-tests-dashboards-suite + - end-to-end-tests-panels-suite + - end-to-end-tests-smoke-tests-suite + - end-to-end-tests-various-suite + environment: + E2E_TEST_ARTIFACTS_BUCKET: releng-pipeline-artifacts-dev + GCP_GRAFANA_UPLOAD_ARTIFACTS_KEY: + from_secret: gcp_upload_artifacts_key + GITHUB_TOKEN: + from_secret: github_token + failure: ignore + image: google/cloud-sdk:431.0.0 + name: e2e-tests-artifacts-upload + when: + status: + - success + - failure +- commands: + - yarn storybook:build + - ./bin/build verify-storybook + depends_on: + - rgm-package + - build-frontend-packages + environment: + NODE_OPTIONS: --max_old_space_size=4096 + image: node:20.9.0-alpine + name: build-storybook + when: + paths: + include: + - packages/grafana-ui/** +- commands: + - npx wait-on@7.0.1 http://$HOST:$PORT + - pa11y-ci --config .pa11yci.conf.js --json > pa11y-ci-results.json + depends_on: + - grafana-server + environment: + GRAFANA_MISC_STATS_API_KEY: + from_secret: grafana_misc_stats_api_key + HOST: grafana-server + PORT: 3001 + failure: ignore + image: grafana/docker-puppeteer:1.1.0 + name: test-a11y-frontend +- commands: + - ./bin/build store-storybook --deployment canary + depends_on: + - build-storybook + - end-to-end-tests-dashboards-suite + - end-to-end-tests-panels-suite + - end-to-end-tests-smoke-tests-suite + - end-to-end-tests-various-suite + environment: + GCP_KEY: + from_secret: gcp_grafanauploads + PRERELEASE_BUCKET: + from_secret: prerelease_bucket + image: grafana/grafana-ci-deploy:1.3.3 + name: store-storybook + when: + paths: + include: + - packages/grafana-ui/** + repo: + - grafana/grafana +- commands: + - apk add --update bash grep git + - ./scripts/ci-frontend-metrics.sh ./grafana/public/build | ./bin/build publish-metrics + $$GRAFANA_MISC_STATS_API_KEY + depends_on: + - test-a11y-frontend + environment: + GRAFANA_MISC_STATS_API_KEY: + from_secret: grafana_misc_stats_api_key + failure: ignore + image: node:20.9.0-alpine + name: publish-frontend-metrics + when: + repo: + - grafana/grafana +- commands: + - docker run --privileged --rm tonistiigi/binfmt --install all + - /src/grafana-build artifacts -a docker:grafana:linux/amd64 -a docker:grafana:linux/amd64:ubuntu + -a docker:grafana:linux/arm64 -a docker:grafana:linux/arm64:ubuntu -a docker:grafana:linux/arm/v7 + -a docker:grafana:linux/arm/v7:ubuntu --yarn-cache=$$YARN_CACHE_FOLDER --build-id=$$DRONE_BUILD_NUMBER + --go-version=1.22.5 --ubuntu-base=ubuntu:22.04 --alpine-base=alpine:3.19.1 --tag-format='{{ + .version_base }}-{{ .buildID }}-{{ .arch }}' --grafana-dir=$$PWD --ubuntu-tag-format='{{ + .version_base }}-{{ .buildID }}-ubuntu-{{ .arch }}' > docker.txt + - find ./dist -name '*docker*.tar.gz' -type f | xargs -n1 docker load -i + depends_on: + - update-package-json-version + image: grafana/grafana-build:main + name: rgm-build-docker + pull: always + volumes: + - name: docker + path: /var/run/docker.sock +- commands: + - ./bin/grabpl artifacts docker publish --dockerhub-repo grafana/grafana + depends_on: + - rgm-build-docker + environment: + DOCKER_PASSWORD: + from_secret: docker_password + DOCKER_USER: + from_secret: docker_username + GCP_KEY: + from_secret: gcp_grafanauploads + GITHUB_APP_ID: + from_secret: delivery-bot-app-id + GITHUB_APP_INSTALLATION_ID: + from_secret: delivery-bot-app-installation-id + GITHUB_APP_PRIVATE_KEY: + from_secret: delivery-bot-app-private-key + image: google/cloud-sdk:431.0.0 + name: publish-images-grafana + volumes: + - name: docker + path: /var/run/docker.sock + when: + repo: + - grafana/grafana +- commands: + - ./bin/grabpl artifacts docker publish --dockerhub-repo grafana/grafana-oss + depends_on: + - rgm-build-docker + environment: + DOCKER_PASSWORD: + from_secret: docker_password + DOCKER_USER: + from_secret: docker_username + GCP_KEY: + from_secret: gcp_grafanauploads + GITHUB_APP_ID: + from_secret: delivery-bot-app-id + GITHUB_APP_INSTALLATION_ID: + from_secret: delivery-bot-app-installation-id + GITHUB_APP_PRIVATE_KEY: + from_secret: delivery-bot-app-private-key + image: google/cloud-sdk:431.0.0 + name: publish-images-grafana-oss + volumes: + - name: docker + path: /var/run/docker.sock + when: + repo: + - grafana/grafana +- commands: + - apk add --update bash + - ./scripts/publish-npm-packages.sh --dist-tag 'canary' --registry 'https://registry.npmjs.org' + depends_on: + - end-to-end-tests-dashboards-suite + - end-to-end-tests-panels-suite + - end-to-end-tests-smoke-tests-suite + - end-to-end-tests-various-suite + - build-frontend-packages + environment: + NPM_TOKEN: + from_secret: npm_token + image: node:20.9.0-alpine + name: release-canary-npm-packages + when: + paths: + include: + - packages/** + repo: + - grafana/grafana +- commands: + - ./bin/build upload-packages --edition oss + depends_on: + - end-to-end-tests-dashboards-suite + - end-to-end-tests-panels-suite + - end-to-end-tests-smoke-tests-suite + - end-to-end-tests-various-suite + environment: + GCP_KEY: + from_secret: gcp_grafanauploads_base64 + PRERELEASE_BUCKET: + from_secret: prerelease_bucket + image: grafana/grafana-ci-deploy:1.3.3 + name: upload-packages + when: + repo: + - grafana/grafana +- commands: + - ./bin/build upload-cdn --edition oss + depends_on: + - grafana-server + environment: + GCP_KEY: + from_secret: gcp_grafanauploads + PRERELEASE_BUCKET: + from_secret: prerelease_bucket + image: grafana/grafana-ci-deploy:1.3.3 + name: upload-cdn-assets + when: + repo: + - grafana/grafana +trigger: + branch: main + event: + - push + paths: + exclude: + - '*.md' + - docs/** + - latest.json + repo: + - grafana/grafana +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker --- -{"kind": "pipeline", "type": "docker", "name": "main-integration-tests", "trigger": {"event": ["push"], "branch": "main", "paths": {"exclude": ["*.md", "docs/**", "latest.json"]}, "repo": ["grafana/grafana"]}, "services": [{"name": "postgres", "image": "postgres:12.3-alpine", "environment": {"POSTGRES_USER": "grafanatest", "POSTGRES_PASSWORD": "grafanatest", "POSTGRES_DB": "grafanatest", "PGDATA": "/var/lib/postgresql/data/pgdata"}, "volumes": [{"name": "postgres", "path": "/var/lib/postgresql/data/pgdata"}]}, {"name": "mysql57", "image": "mysql:5.7.39", "environment": {"MYSQL_ROOT_PASSWORD": "rootpass", "MYSQL_DATABASE": "grafana_tests", "MYSQL_USER": "grafana", "MYSQL_PASSWORD": "password"}, "volumes": [{"name": "mysql57", "path": "/var/lib/mysql"}], "commands": ["docker-entrypoint.sh mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci"]}, {"name": "mysql80", "image": "mysql:8.0.32", "environment": {"MYSQL_ROOT_PASSWORD": "rootpass", "MYSQL_DATABASE": "grafana_tests", "MYSQL_USER": "grafana", "MYSQL_PASSWORD": "password"}, "volumes": [{"name": "mysql80", "path": "/var/lib/mysql"}], "commands": ["docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password"]}, {"name": "mimir_backend", "image": "us.gcr.io/kubernetes-dev/mimir:gotjosh-state-config-grafana-663a0ae78", "environment": {}, "commands": ["/bin/mimir -target=backend"]}, {"name": "redis", "image": "redis:6.2.11-alpine", "environment": {}}, {"name": "memcached", "image": "memcached:1.6.9-alpine", "environment": {}}], "steps": [{"name": "grabpl", "image": "byrnedo/alpine-curl:0.1.8", "commands": ["mkdir -p bin", "curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.50/grabpl", "chmod +x bin/grabpl"]}, {"name": "compile-build-cmd", "image": "golang:1.23.0-alpine", "commands": ["go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd"], "depends_on": [], "environment": {"CGO_ENABLED": 0}}, {"name": "identify-runner", "image": "alpine:3.19.1", "commands": ["echo $DRONE_RUNNER_NAME"]}, {"name": "verify-gen-cue", "image": "golang:1.23.0-alpine", "depends_on": [], "commands": ["# It is required that code generated from Thema/CUE be committed and in sync with its inputs.", "# The following command will fail if running code generators produces any diff in output.", "apk add --update make", "CODEGEN_VERIFY=1 make gen-cue"]}, {"name": "verify-gen-jsonnet", "image": "golang:1.23.0-alpine", "depends_on": [], "commands": ["# It is required that generated jsonnet is committed and in sync with its inputs.", "# The following command will fail if running code generators produces any diff in output.", "apk add --update make", "CODEGEN_VERIFY=1 make gen-jsonnet"]}, {"name": "wire-install", "image": "golang:1.23.0-alpine", "commands": ["apk add --update make", "make gen-go"], "depends_on": ["verify-gen-cue"]}, {"name": "wait-for-postgres", "image": "jwilder/dockerize:0.6.1", "commands": ["dockerize -wait tcp://postgres:5432 -timeout 120s"]}, {"name": "postgres-integration-tests", "image": "golang:1.23.0-alpine", "depends_on": ["wire-install", "wait-for-postgres"], "commands": ["apk add --update build-base", "apk add --update postgresql-client", "psql -p 5432 -h postgres -U grafanatest -d grafanatest -f devenv/docker/blocks/postgres_tests/setup.sql", "go clean -testcache", "go test -p=1 -count=1 -covermode=atomic -timeout=5m -run '^TestIntegration' $(find ./pkg -type f -name '*_test.go' -exec grep -l '^func TestIntegration' '{}' '+' | grep -o '\\(.*\\)/' | sort -u)"], "environment": {"PGPASSWORD": "grafanatest", "GRAFANA_TEST_DB": "postgres", "POSTGRES_HOST": "postgres"}}, {"name": "wait-for-mysql-5.7", "image": "jwilder/dockerize:0.6.1", "commands": ["dockerize -wait tcp://mysql57:3306 -timeout 120s"]}, {"name": "mysql-5.7-integration-tests", "image": "golang:1.23.0-alpine", "depends_on": ["wire-install", "wait-for-mysql-5.7"], "commands": ["apk add --update build-base", "apk add --update mysql-client", "cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql57 -P 3306 -u root -prootpass", "go clean -testcache", "go test -p=1 -count=1 -covermode=atomic -timeout=5m -run '^TestIntegration' $(find ./pkg -type f -name '*_test.go' -exec grep -l '^func TestIntegration' '{}' '+' | grep -o '\\(.*\\)/' | sort -u)"], "environment": {"GRAFANA_TEST_DB": "mysql", "MYSQL_HOST": "mysql57"}}, {"name": "wait-for-mysql-8.0", "image": "jwilder/dockerize:0.6.1", "commands": ["dockerize -wait tcp://mysql80:3306 -timeout 120s"]}, {"name": "mysql-8.0-integration-tests", "image": "golang:1.23.0-alpine", "depends_on": ["wire-install", "wait-for-mysql-8.0"], "commands": ["apk add --update build-base", "apk add --update mysql-client", "cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql80 -P 3306 -u root -prootpass", "go clean -testcache", "go test -p=1 -count=1 -covermode=atomic -timeout=5m -run '^TestIntegration' $(find ./pkg -type f -name '*_test.go' -exec grep -l '^func TestIntegration' '{}' '+' | grep -o '\\(.*\\)/' | sort -u)"], "environment": {"GRAFANA_TEST_DB": "mysql", "MYSQL_HOST": "mysql80"}}, {"name": "wait-for-redis", "image": "jwilder/dockerize:0.6.1", "commands": ["dockerize -wait tcp://redis:6379 -timeout 120s"]}, {"name": "redis-integration-tests", "image": "golang:1.23.0-alpine", "depends_on": ["wire-install", "wait-for-redis"], "commands": ["apk add --update build-base", "go clean -testcache", "go list -f '{{.Dir}}/...' -m | xargs go test -run IntegrationRedis -covermode=atomic -timeout=2m"], "environment": {"REDIS_URL": "redis://redis:6379/0"}}, {"name": "wait-for-memcached", "image": "jwilder/dockerize:0.6.1", "commands": ["dockerize -wait tcp://memcached:11211 -timeout 120s"]}, {"name": "memcached-integration-tests", "image": "golang:1.23.0-alpine", "depends_on": ["wire-install", "wait-for-memcached"], "commands": ["apk add --update build-base", "go clean -testcache", "go list -f '{{.Dir}}/...' -m | xargs go test -run IntegrationMemcached -covermode=atomic -timeout=2m"], "environment": {"MEMCACHED_HOSTS": "memcached:11211"}}, {"name": "wait-for-remote-alertmanager", "image": "jwilder/dockerize:0.6.1", "commands": ["dockerize -wait tcp://mimir_backend:8080 -timeout 120s"]}, {"name": "remote-alertmanager-integration-tests", "image": "golang:1.23.0-alpine", "depends_on": ["wire-install", "wait-for-remote-alertmanager"], "commands": ["apk add --update build-base", "go clean -testcache", "go test -run TestIntegrationRemoteAlertmanager -covermode=atomic -timeout=2m ./pkg/services/ngalert/..."], "environment": {"AM_TENANT_ID": "test", "AM_URL": "http://mimir_backend:8080"}}], "clone": {"retries": 3}, "volumes": [{"name": "docker", "host": {"path": "/var/run/docker.sock"}}, {"name": "postgres", "temp": {"medium": "memory"}}, {"name": "mysql57", "temp": {"medium": "memory"}}, {"name": "mysql80", "temp": {"medium": "memory"}}], "depends_on": [], "image_pull_secrets": ["gcr", "gar"], "environment": {"EDITION": "oss"}, "platform": {"os": "linux", "arch": "amd64"}, "node": {"type": "no-parallel"}} +clone: + retries: 3 +depends_on: [] +environment: + EDITION: oss +image_pull_secrets: +- gcr +- gar +kind: pipeline +name: main-integration-tests +node: + type: no-parallel +platform: + arch: amd64 + os: linux +services: +- environment: + PGDATA: /var/lib/postgresql/data/pgdata + POSTGRES_DB: grafanatest + POSTGRES_PASSWORD: grafanatest + POSTGRES_USER: grafanatest + image: postgres:12.3-alpine + name: postgres + volumes: + - name: postgres + path: /var/lib/postgresql/data/pgdata +- commands: + - docker-entrypoint.sh mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci + environment: + MYSQL_DATABASE: grafana_tests + MYSQL_PASSWORD: password + MYSQL_ROOT_PASSWORD: rootpass + MYSQL_USER: grafana + image: mysql:5.7.39 + name: mysql57 + volumes: + - name: mysql57 + path: /var/lib/mysql +- commands: + - docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password + environment: + MYSQL_DATABASE: grafana_tests + MYSQL_PASSWORD: password + MYSQL_ROOT_PASSWORD: rootpass + MYSQL_USER: grafana + image: mysql:8.0.32 + name: mysql80 + volumes: + - name: mysql80 + path: /var/lib/mysql +- commands: + - /bin/mimir -target=backend + environment: {} + image: us.gcr.io/kubernetes-dev/mimir:gotjosh-state-config-grafana-663a0ae78 + name: mimir_backend +- environment: {} + image: redis:6.2.11-alpine + name: redis +- environment: {} + image: memcached:1.6.9-alpine + name: memcached +steps: +- commands: + - mkdir -p bin + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.50/grabpl + - chmod +x bin/grabpl + image: byrnedo/alpine-curl:0.1.8 + name: grabpl +- commands: + - go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd + depends_on: [] + environment: + CGO_ENABLED: 0 + image: golang:1.22.5-alpine + name: compile-build-cmd +- commands: + - echo $DRONE_RUNNER_NAME + image: alpine:3.19.1 + name: identify-runner +- commands: + - '# It is required that code generated from Thema/CUE be committed and in sync + with its inputs.' + - '# The following command will fail if running code generators produces any diff + in output.' + - apk add --update make + - CODEGEN_VERIFY=1 make gen-cue + depends_on: [] + image: golang:1.22.5-alpine + name: verify-gen-cue +- commands: + - '# It is required that generated jsonnet is committed and in sync with its inputs.' + - '# The following command will fail if running code generators produces any diff + in output.' + - apk add --update make + - CODEGEN_VERIFY=1 make gen-jsonnet + depends_on: [] + image: golang:1.22.5-alpine + name: verify-gen-jsonnet +- commands: + - apk add --update make + - make gen-go + depends_on: + - verify-gen-cue + image: golang:1.22.5-alpine + name: wire-install +- commands: + - dockerize -wait tcp://postgres:5432 -timeout 120s + image: jwilder/dockerize:0.6.1 + name: wait-for-postgres +- commands: + - apk add --update build-base + - apk add --update postgresql-client + - psql -p 5432 -h postgres -U grafanatest -d grafanatest -f devenv/docker/blocks/postgres_tests/setup.sql + - go clean -testcache + - go test -p=1 -count=1 -covermode=atomic -timeout=5m -run '^TestIntegration' $(find + ./pkg -type f -name '*_test.go' -exec grep -l '^func TestIntegration' '{}' '+' + | grep -o '\(.*\)/' | sort -u) + depends_on: + - wire-install + - wait-for-postgres + environment: + GRAFANA_TEST_DB: postgres + PGPASSWORD: grafanatest + POSTGRES_HOST: postgres + image: golang:1.22.5-alpine + name: postgres-integration-tests +- commands: + - dockerize -wait tcp://mysql57:3306 -timeout 120s + image: jwilder/dockerize:0.6.1 + name: wait-for-mysql-5.7 +- commands: + - apk add --update build-base + - apk add --update mysql-client + - cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql57 -P 3306 -u root + -prootpass + - go clean -testcache + - go test -p=1 -count=1 -covermode=atomic -timeout=5m -run '^TestIntegration' $(find + ./pkg -type f -name '*_test.go' -exec grep -l '^func TestIntegration' '{}' '+' + | grep -o '\(.*\)/' | sort -u) + depends_on: + - wire-install + - wait-for-mysql-5.7 + environment: + GRAFANA_TEST_DB: mysql + MYSQL_HOST: mysql57 + image: golang:1.22.5-alpine + name: mysql-5.7-integration-tests +- commands: + - dockerize -wait tcp://mysql80:3306 -timeout 120s + image: jwilder/dockerize:0.6.1 + name: wait-for-mysql-8.0 +- commands: + - apk add --update build-base + - apk add --update mysql-client + - cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql80 -P 3306 -u root + -prootpass + - go clean -testcache + - go test -p=1 -count=1 -covermode=atomic -timeout=5m -run '^TestIntegration' $(find + ./pkg -type f -name '*_test.go' -exec grep -l '^func TestIntegration' '{}' '+' + | grep -o '\(.*\)/' | sort -u) + depends_on: + - wire-install + - wait-for-mysql-8.0 + environment: + GRAFANA_TEST_DB: mysql + MYSQL_HOST: mysql80 + image: golang:1.22.5-alpine + name: mysql-8.0-integration-tests +- commands: + - dockerize -wait tcp://redis:6379 -timeout 120s + image: jwilder/dockerize:0.6.1 + name: wait-for-redis +- commands: + - apk add --update build-base + - go clean -testcache + - go list -f '{{.Dir}}/...' -m | xargs go test -run IntegrationRedis -covermode=atomic + -timeout=2m + depends_on: + - wire-install + - wait-for-redis + environment: + REDIS_URL: redis://redis:6379/0 + image: golang:1.22.5-alpine + name: redis-integration-tests +- commands: + - dockerize -wait tcp://memcached:11211 -timeout 120s + image: jwilder/dockerize:0.6.1 + name: wait-for-memcached +- commands: + - apk add --update build-base + - go clean -testcache + - go list -f '{{.Dir}}/...' -m | xargs go test -run IntegrationMemcached -covermode=atomic + -timeout=2m + depends_on: + - wire-install + - wait-for-memcached + environment: + MEMCACHED_HOSTS: memcached:11211 + image: golang:1.22.5-alpine + name: memcached-integration-tests +- commands: + - dockerize -wait tcp://mimir_backend:8080 -timeout 120s + image: jwilder/dockerize:0.6.1 + name: wait-for-remote-alertmanager +- commands: + - apk add --update build-base + - go clean -testcache + - go test -run TestIntegrationRemoteAlertmanager -covermode=atomic -timeout=2m ./pkg/services/ngalert/... + depends_on: + - wire-install + - wait-for-remote-alertmanager + environment: + AM_TENANT_ID: test + AM_URL: http://mimir_backend:8080 + image: golang:1.22.5-alpine + name: remote-alertmanager-integration-tests +trigger: + branch: main + event: + - push + paths: + exclude: + - '*.md' + - docs/** + - latest.json + repo: + - grafana/grafana +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker +- name: postgres + temp: + medium: memory +- name: mysql57 + temp: + medium: memory +- name: mysql80 + temp: + medium: memory --- -{"kind": "pipeline", "type": "docker", "name": "main-windows", "trigger": {"event": ["push"], "branch": "main", "paths": {"exclude": ["*.md", "docs/**", "latest.json"]}, "repo": ["grafana/grafana"]}, "services": [], "steps": [{"name": "identify-runner", "image": "mcr.microsoft.com/windows:1809", "commands": ["echo $env:DRONE_RUNNER_NAME"]}, {"name": "windows-init", "image": "grafana/ci-wix:0.1.1", "commands": ["$$ProgressPreference = \"SilentlyContinue\"", "Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.50/windows/grabpl.exe -OutFile grabpl.exe"]}], "clone": {"retries": 3}, "volumes": [{"name": "docker", "host": {"path": "//./pipe/docker_engine/"}}], "depends_on": ["main-test-frontend", "main-test-backend", "main-build-e2e-publish", "main-integration-tests"], "image_pull_secrets": ["gcr", "gar"], "environment": {"EDITION": "oss"}, "platform": {"os": "windows", "arch": "amd64", "version": "1809"}} +clone: + retries: 3 +depends_on: +- main-test-frontend +- main-test-backend +- main-build-e2e-publish +- main-integration-tests +environment: + EDITION: oss +image_pull_secrets: +- gcr +- gar +kind: pipeline +name: main-windows +platform: + arch: amd64 + os: windows + version: "1809" +services: [] +steps: +- commands: + - echo $env:DRONE_RUNNER_NAME + image: mcr.microsoft.com/windows:1809 + name: identify-runner +- commands: + - $$ProgressPreference = "SilentlyContinue" + - Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.50/windows/grabpl.exe + -OutFile grabpl.exe + image: grafana/ci-wix:0.1.1 + name: windows-init +trigger: + branch: main + event: + - push + paths: + exclude: + - '*.md' + - docs/** + - latest.json + repo: + - grafana/grafana +type: docker +volumes: +- host: + path: //./pipe/docker_engine/ + name: docker --- -{"kind": "pipeline", "type": "docker", "name": "main-trigger-downstream", "trigger": {"event": ["push"], "branch": "main", "paths": {"exclude": ["*.md", "docs/**", "latest.json"]}, "repo": ["grafana/grafana-security-mirror"]}, "services": [], "steps": [{"name": "trigger-enterprise-downstream", "image": "grafana/drone-downstream", "settings": {"server": "https://drone.grafana.net", "token": {"from_secret": "drone_token"}, "repositories": ["grafana/grafana-enterprise@main"], "params": ["SOURCE_BUILD_NUMBER=${DRONE_COMMIT}", "SOURCE_COMMIT=${DRONE_COMMIT}"]}}], "clone": {"retries": 3}, "volumes": [{"name": "docker", "host": {"path": "/var/run/docker.sock"}}], "depends_on": ["main-build-e2e-publish", "main-integration-tests"], "image_pull_secrets": ["gcr", "gar"], "environment": {"EDITION": "oss"}, "platform": {"os": "linux", "arch": "amd64"}, "node": {"type": "no-parallel"}} +clone: + retries: 3 +depends_on: +- main-build-e2e-publish +- main-integration-tests +environment: + EDITION: oss +image_pull_secrets: +- gcr +- gar +kind: pipeline +name: main-trigger-downstream +node: + type: no-parallel +platform: + arch: amd64 + os: linux +services: [] +steps: +- image: grafana/drone-downstream + name: trigger-enterprise-downstream + settings: + params: + - SOURCE_BUILD_NUMBER=${DRONE_COMMIT} + - SOURCE_COMMIT=${DRONE_COMMIT} + repositories: + - grafana/grafana-enterprise@main + server: https://drone.grafana.net + token: + from_secret: drone_token +trigger: + branch: main + event: + - push + paths: + exclude: + - '*.md' + - docs/** + - latest.json + repo: + - grafana/grafana-security-mirror +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker --- -{"kind": "pipeline", "type": "docker", "platform": {"os": "linux", "arch": "amd64"}, "name": "main-notify", "trigger": {"event": ["push"], "branch": "main", "paths": {"exclude": ["*.md", "docs/**", "latest.json"]}, "repo": ["grafana/grafana"], "status": ["failure"]}, "steps": [{"name": "slack", "image": "plugins/slack", "settings": {"webhook": {"from_secret": "slack_webhook"}, "channel": "grafana-ci-notifications", "template": "Build {{build.number}} failed for commit: \u003chttps://github.com/{{repo.owner}}/{{repo.name}}/commit/{{build.commit}}|{{ truncate build.commit 8 }}\u003e: {{build.link}}\nBranch: \u003chttps://github.com/{{ repo.owner }}/{{ repo.name }}/commits/{{ build.branch }}|{{ build.branch }}\u003e\nAuthor: {{build.author}}"}}], "clone": {"retries": 3}, "depends_on": ["main-test-frontend", "main-test-backend", "main-build-e2e-publish", "main-integration-tests", "main-windows"]} +clone: + retries: 3 +depends_on: +- main-test-frontend +- main-test-backend +- main-build-e2e-publish +- main-integration-tests +- main-windows +kind: pipeline +name: main-notify +platform: + arch: amd64 + os: linux +steps: +- image: plugins/slack + name: slack + settings: + channel: grafana-ci-notifications + template: |- + Build {{build.number}} failed for commit: : {{build.link}} + Branch: + Author: {{build.author}} + webhook: + from_secret: slack_webhook +trigger: + branch: main + event: + - push + paths: + exclude: + - '*.md' + - docs/** + - latest.json + repo: + - grafana/grafana + status: + - failure +type: docker --- -{"kind": "pipeline", "type": "docker", "name": "publish-docker-public", "trigger": {"event": ["promote"], "target": ["public"]}, "services": [], "steps": [{"name": "identify-runner", "image": "alpine:3.19.1", "commands": ["echo $DRONE_RUNNER_NAME"]}, {"name": "grabpl", "image": "byrnedo/alpine-curl:0.1.8", "commands": ["mkdir -p bin", "curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.50/grabpl", "chmod +x bin/grabpl"]}, {"name": "compile-build-cmd", "image": "golang:1.23.0-alpine", "commands": ["go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd"], "depends_on": [], "environment": {"CGO_ENABLED": 0}}, {"name": "fetch-images", "image": "google/cloud-sdk:431.0.0", "environment": {"GCP_KEY": {"from_secret": "gcp_grafanauploads"}, "DOCKER_USER": {"from_secret": "docker_username"}, "DOCKER_PASSWORD": {"from_secret": "docker_password"}}, "commands": ["./bin/build artifacts docker fetch --edition oss"], "depends_on": ["compile-build-cmd"], "volumes": [{"name": "docker", "path": "/var/run/docker.sock"}]}, {"environment": {"DOCKER_USER": {"from_secret": "docker_username"}, "DOCKER_PASSWORD": {"from_secret": "docker_password"}}, "name": "publish-images-grafana", "image": "docker:27-cli", "depends_on": ["fetch-images"], "commands": ["apk add bash", "\n bash -c '\n debug=\n if [[ -n $${DRY_RUN} ]]; then debug=echo; fi\n docker login -u $${DOCKER_USER} -p $${DOCKER_PASSWORD}\n\n # Push the grafana-image-tags images\n $$debug docker push grafana/grafana-image-tags:$${TAG}-amd64\n $$debug docker push grafana/grafana-image-tags:$${TAG}-arm64\n $$debug docker push grafana/grafana-image-tags:$${TAG}-armv7\n $$debug docker push grafana/grafana-image-tags:$${TAG}-ubuntu-amd64\n $$debug docker push grafana/grafana-image-tags:$${TAG}-ubuntu-arm64\n $$debug docker push grafana/grafana-image-tags:$${TAG}-ubuntu-armv7\n\n # Create the grafana manifests\n $$debug docker manifest create grafana/grafana:${TAG} grafana/grafana-image-tags:$${TAG}-amd64 grafana/grafana-image-tags:$${TAG}-arm64 grafana/grafana-image-tags:$${TAG}-armv7\n\n $$debug docker manifest create grafana/grafana:${TAG}-ubuntu grafana/grafana-image-tags:$${TAG}-ubuntu-amd64 grafana/grafana-image-tags:$${TAG}-ubuntu-arm64 grafana/grafana-image-tags:$${TAG}-ubuntu-armv7\n\n # Push the grafana manifests\n $$debug docker manifest push grafana/grafana:$${TAG}\n $$debug docker manifest push grafana/grafana:$${TAG}-ubuntu\n\n # if LATEST is set, then also create \u0026 push latest\n if [[ -n $${LATEST} ]]; then\n $$debug docker manifest create grafana/grafana:latest grafana/grafana-image-tags:$${TAG}-amd64 grafana/grafana-image-tags:$${TAG}-arm64 grafana/grafana-image-tags:$${TAG}-armv7\n $$debug docker manifest create grafana/grafana:latest-ubuntu grafana/grafana-image-tags:$${TAG}-ubuntu-amd64 grafana/grafana-image-tags:$${TAG}-ubuntu-arm64 grafana/grafana-image-tags:$${TAG}-ubuntu-armv7\n\n $$debug docker manifest push grafana/grafana:latest\n $$debug docker manifest push grafana/grafana:latest-ubuntu\n\n fi'"], "volumes": [{"name": "docker", "path": "/var/run/docker.sock"}]}, {"name": "publish-images-grafana-oss", "image": "google/cloud-sdk:431.0.0", "environment": {"GCP_KEY": {"from_secret": "gcp_grafanauploads"}, "DOCKER_USER": {"from_secret": "docker_username"}, "DOCKER_PASSWORD": {"from_secret": "docker_password"}, "GITHUB_APP_ID": {"from_secret": "delivery-bot-app-id"}, "GITHUB_APP_INSTALLATION_ID": {"from_secret": "delivery-bot-app-installation-id"}, "GITHUB_APP_PRIVATE_KEY": {"from_secret": "delivery-bot-app-private-key"}}, "commands": ["./bin/grabpl artifacts docker publish --dockerhub-repo grafana/grafana-oss --version-tag ${DRONE_TAG}"], "depends_on": ["fetch-images"], "volumes": [{"name": "docker", "path": "/var/run/docker.sock"}]}], "clone": {"retries": 3}, "volumes": [{"name": "docker", "host": {"path": "/var/run/docker.sock"}}], "depends_on": [], "image_pull_secrets": ["gcr", "gar"], "environment": {"EDITION": "oss"}, "platform": {"os": "linux", "arch": "amd64"}, "node": {"type": "no-parallel"}} +clone: + retries: 3 +depends_on: [] +environment: + EDITION: oss +image_pull_secrets: +- gcr +- gar +kind: pipeline +name: publish-docker-public +node: + type: no-parallel +platform: + arch: amd64 + os: linux +services: [] +steps: +- commands: + - echo $DRONE_RUNNER_NAME + image: alpine:3.19.1 + name: identify-runner +- commands: + - mkdir -p bin + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.50/grabpl + - chmod +x bin/grabpl + image: byrnedo/alpine-curl:0.1.8 + name: grabpl +- commands: + - go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd + depends_on: [] + environment: + CGO_ENABLED: 0 + image: golang:1.22.5-alpine + name: compile-build-cmd +- commands: + - ./bin/build artifacts docker fetch --edition oss + depends_on: + - compile-build-cmd + environment: + DOCKER_PASSWORD: + from_secret: docker_password + DOCKER_USER: + from_secret: docker_username + GCP_KEY: + from_secret: gcp_grafanauploads + image: google/cloud-sdk:431.0.0 + name: fetch-images + volumes: + - name: docker + path: /var/run/docker.sock +- commands: + - apk add bash + - |2- + + bash -c ' + debug= + if [[ -n $${DRY_RUN} ]]; then debug=echo; fi + docker login -u $${DOCKER_USER} -p $${DOCKER_PASSWORD} + + # Push the grafana-image-tags images + $$debug docker push grafana/grafana-image-tags:$${TAG}-amd64 + $$debug docker push grafana/grafana-image-tags:$${TAG}-arm64 + $$debug docker push grafana/grafana-image-tags:$${TAG}-armv7 + $$debug docker push grafana/grafana-image-tags:$${TAG}-ubuntu-amd64 + $$debug docker push grafana/grafana-image-tags:$${TAG}-ubuntu-arm64 + $$debug docker push grafana/grafana-image-tags:$${TAG}-ubuntu-armv7 + + # Create the grafana manifests + $$debug docker manifest create grafana/grafana:${TAG} grafana/grafana-image-tags:$${TAG}-amd64 grafana/grafana-image-tags:$${TAG}-arm64 grafana/grafana-image-tags:$${TAG}-armv7 + + $$debug docker manifest create grafana/grafana:${TAG}-ubuntu grafana/grafana-image-tags:$${TAG}-ubuntu-amd64 grafana/grafana-image-tags:$${TAG}-ubuntu-arm64 grafana/grafana-image-tags:$${TAG}-ubuntu-armv7 + + # Push the grafana manifests + $$debug docker manifest push grafana/grafana:$${TAG} + $$debug docker manifest push grafana/grafana:$${TAG}-ubuntu + + # if LATEST is set, then also create & push latest + if [[ -n $${LATEST} ]]; then + $$debug docker manifest create grafana/grafana:latest grafana/grafana-image-tags:$${TAG}-amd64 grafana/grafana-image-tags:$${TAG}-arm64 grafana/grafana-image-tags:$${TAG}-armv7 + $$debug docker manifest create grafana/grafana:latest-ubuntu grafana/grafana-image-tags:$${TAG}-ubuntu-amd64 grafana/grafana-image-tags:$${TAG}-ubuntu-arm64 grafana/grafana-image-tags:$${TAG}-ubuntu-armv7 + + $$debug docker manifest push grafana/grafana:latest + $$debug docker manifest push grafana/grafana:latest-ubuntu + + fi' + depends_on: + - fetch-images + environment: + DOCKER_PASSWORD: + from_secret: docker_password + DOCKER_USER: + from_secret: docker_username + image: docker:27-cli + name: publish-images-grafana + volumes: + - name: docker + path: /var/run/docker.sock +- commands: + - ./bin/grabpl artifacts docker publish --dockerhub-repo grafana/grafana-oss --version-tag + ${DRONE_TAG} + depends_on: + - fetch-images + environment: + DOCKER_PASSWORD: + from_secret: docker_password + DOCKER_USER: + from_secret: docker_username + GCP_KEY: + from_secret: gcp_grafanauploads + GITHUB_APP_ID: + from_secret: delivery-bot-app-id + GITHUB_APP_INSTALLATION_ID: + from_secret: delivery-bot-app-installation-id + GITHUB_APP_PRIVATE_KEY: + from_secret: delivery-bot-app-private-key + image: google/cloud-sdk:431.0.0 + name: publish-images-grafana-oss + volumes: + - name: docker + path: /var/run/docker.sock +trigger: + event: + - promote + target: + - public +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker --- -{"kind": "pipeline", "type": "docker", "name": "manually-publish-docker-public", "trigger": {"event": ["promote"], "target": ["publish-docker-public"]}, "services": [], "steps": [{"name": "identify-runner", "image": "alpine:3.19.1", "commands": ["echo $DRONE_RUNNER_NAME"]}, {"name": "grabpl", "image": "byrnedo/alpine-curl:0.1.8", "commands": ["mkdir -p bin", "curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.50/grabpl", "chmod +x bin/grabpl"]}, {"name": "compile-build-cmd", "image": "golang:1.23.0-alpine", "commands": ["go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd"], "depends_on": [], "environment": {"CGO_ENABLED": 0}}, {"name": "fetch-images", "image": "google/cloud-sdk:431.0.0", "environment": {"GCP_KEY": {"from_secret": "gcp_grafanauploads"}, "DOCKER_USER": {"from_secret": "docker_username"}, "DOCKER_PASSWORD": {"from_secret": "docker_password"}}, "commands": ["./bin/build artifacts docker fetch --edition oss"], "depends_on": ["compile-build-cmd"], "volumes": [{"name": "docker", "path": "/var/run/docker.sock"}]}, {"environment": {"DOCKER_USER": {"from_secret": "docker_username"}, "DOCKER_PASSWORD": {"from_secret": "docker_password"}}, "name": "publish-images-grafana", "image": "docker:27-cli", "depends_on": ["fetch-images"], "commands": ["apk add bash", "\n bash -c '\n debug=\n if [[ -n $${DRY_RUN} ]]; then debug=echo; fi\n docker login -u $${DOCKER_USER} -p $${DOCKER_PASSWORD}\n\n # Push the grafana-image-tags images\n $$debug docker push grafana/grafana-image-tags:$${TAG}-amd64\n $$debug docker push grafana/grafana-image-tags:$${TAG}-arm64\n $$debug docker push grafana/grafana-image-tags:$${TAG}-armv7\n $$debug docker push grafana/grafana-image-tags:$${TAG}-ubuntu-amd64\n $$debug docker push grafana/grafana-image-tags:$${TAG}-ubuntu-arm64\n $$debug docker push grafana/grafana-image-tags:$${TAG}-ubuntu-armv7\n\n # Create the grafana manifests\n $$debug docker manifest create grafana/grafana:${TAG} grafana/grafana-image-tags:$${TAG}-amd64 grafana/grafana-image-tags:$${TAG}-arm64 grafana/grafana-image-tags:$${TAG}-armv7\n\n $$debug docker manifest create grafana/grafana:${TAG}-ubuntu grafana/grafana-image-tags:$${TAG}-ubuntu-amd64 grafana/grafana-image-tags:$${TAG}-ubuntu-arm64 grafana/grafana-image-tags:$${TAG}-ubuntu-armv7\n\n # Push the grafana manifests\n $$debug docker manifest push grafana/grafana:$${TAG}\n $$debug docker manifest push grafana/grafana:$${TAG}-ubuntu\n\n # if LATEST is set, then also create \u0026 push latest\n if [[ -n $${LATEST} ]]; then\n $$debug docker manifest create grafana/grafana:latest grafana/grafana-image-tags:$${TAG}-amd64 grafana/grafana-image-tags:$${TAG}-arm64 grafana/grafana-image-tags:$${TAG}-armv7\n $$debug docker manifest create grafana/grafana:latest-ubuntu grafana/grafana-image-tags:$${TAG}-ubuntu-amd64 grafana/grafana-image-tags:$${TAG}-ubuntu-arm64 grafana/grafana-image-tags:$${TAG}-ubuntu-armv7\n\n $$debug docker manifest push grafana/grafana:latest\n $$debug docker manifest push grafana/grafana:latest-ubuntu\n\n fi'"], "volumes": [{"name": "docker", "path": "/var/run/docker.sock"}]}], "clone": {"retries": 3}, "volumes": [{"name": "docker", "host": {"path": "/var/run/docker.sock"}}], "depends_on": [], "image_pull_secrets": ["gcr", "gar"], "environment": {"EDITION": "oss"}, "platform": {"os": "linux", "arch": "amd64"}, "node": {"type": "no-parallel"}} +clone: + retries: 3 +depends_on: [] +environment: + EDITION: oss +image_pull_secrets: +- gcr +- gar +kind: pipeline +name: manually-publish-docker-public +node: + type: no-parallel +platform: + arch: amd64 + os: linux +services: [] +steps: +- commands: + - echo $DRONE_RUNNER_NAME + image: alpine:3.19.1 + name: identify-runner +- commands: + - mkdir -p bin + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.50/grabpl + - chmod +x bin/grabpl + image: byrnedo/alpine-curl:0.1.8 + name: grabpl +- commands: + - go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd + depends_on: [] + environment: + CGO_ENABLED: 0 + image: golang:1.22.5-alpine + name: compile-build-cmd +- commands: + - ./bin/build artifacts docker fetch --edition oss + depends_on: + - compile-build-cmd + environment: + DOCKER_PASSWORD: + from_secret: docker_password + DOCKER_USER: + from_secret: docker_username + GCP_KEY: + from_secret: gcp_grafanauploads + image: google/cloud-sdk:431.0.0 + name: fetch-images + volumes: + - name: docker + path: /var/run/docker.sock +- commands: + - apk add bash + - |2- + + bash -c ' + debug= + if [[ -n $${DRY_RUN} ]]; then debug=echo; fi + docker login -u $${DOCKER_USER} -p $${DOCKER_PASSWORD} + + # Push the grafana-image-tags images + $$debug docker push grafana/grafana-image-tags:$${TAG}-amd64 + $$debug docker push grafana/grafana-image-tags:$${TAG}-arm64 + $$debug docker push grafana/grafana-image-tags:$${TAG}-armv7 + $$debug docker push grafana/grafana-image-tags:$${TAG}-ubuntu-amd64 + $$debug docker push grafana/grafana-image-tags:$${TAG}-ubuntu-arm64 + $$debug docker push grafana/grafana-image-tags:$${TAG}-ubuntu-armv7 + + # Create the grafana manifests + $$debug docker manifest create grafana/grafana:${TAG} grafana/grafana-image-tags:$${TAG}-amd64 grafana/grafana-image-tags:$${TAG}-arm64 grafana/grafana-image-tags:$${TAG}-armv7 + + $$debug docker manifest create grafana/grafana:${TAG}-ubuntu grafana/grafana-image-tags:$${TAG}-ubuntu-amd64 grafana/grafana-image-tags:$${TAG}-ubuntu-arm64 grafana/grafana-image-tags:$${TAG}-ubuntu-armv7 + + # Push the grafana manifests + $$debug docker manifest push grafana/grafana:$${TAG} + $$debug docker manifest push grafana/grafana:$${TAG}-ubuntu + + # if LATEST is set, then also create & push latest + if [[ -n $${LATEST} ]]; then + $$debug docker manifest create grafana/grafana:latest grafana/grafana-image-tags:$${TAG}-amd64 grafana/grafana-image-tags:$${TAG}-arm64 grafana/grafana-image-tags:$${TAG}-armv7 + $$debug docker manifest create grafana/grafana:latest-ubuntu grafana/grafana-image-tags:$${TAG}-ubuntu-amd64 grafana/grafana-image-tags:$${TAG}-ubuntu-arm64 grafana/grafana-image-tags:$${TAG}-ubuntu-armv7 + + $$debug docker manifest push grafana/grafana:latest + $$debug docker manifest push grafana/grafana:latest-ubuntu + + fi' + depends_on: + - fetch-images + environment: + DOCKER_PASSWORD: + from_secret: docker_password + DOCKER_USER: + from_secret: docker_username + image: docker:27-cli + name: publish-images-grafana + volumes: + - name: docker + path: /var/run/docker.sock +trigger: + event: + - promote + target: + - publish-docker-public +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker --- -{"kind": "pipeline", "type": "docker", "name": "create-release-pr", "trigger": {"event": ["promote"], "target": "release-pr"}, "services": [], "steps": [{"name": "create-release-pr", "image": "byrnedo/alpine-curl:0.1.8", "depends_on": [], "environment": {"GITHUB_TOKEN": {"from_secret": "github_token"}, "GH_CLI_URL": "https://github.com/cli/cli/releases/download/v2.50.0/gh_2.50.0_linux_amd64.tar.gz"}, "commands": ["apk add perl", "v_target=`echo $${TAG} | perl -pe 's/^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$/v\\1.\\2.x/'`", "curl -L $${GH_CLI_URL} | tar -xz --strip-components=1 -C /usr", "gh workflow run -f dry_run=$${DRY_RUN} -f version=$${TAG} -f target=$${v_target} -f latest=$${LATEST} --repo=grafana/grafana release-pr.yml"]}], "clone": {"retries": 3}, "volumes": [{"name": "docker", "host": {"path": "/var/run/docker.sock"}}], "depends_on": [], "image_pull_secrets": ["gcr", "gar"], "platform": {"os": "linux", "arch": "amd64"}, "node": {"type": "no-parallel"}} +clone: + retries: 3 +depends_on: [] +image_pull_secrets: +- gcr +- gar +kind: pipeline +name: create-release-pr +node: + type: no-parallel +platform: + arch: amd64 + os: linux +services: [] +steps: +- commands: + - apk add perl + - v_target=`echo $${TAG} | perl -pe 's/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/v\1.\2.x/'` + - curl -L $${GH_CLI_URL} | tar -xz --strip-components=1 -C /usr + - gh workflow run -f dry_run=$${DRY_RUN} -f version=$${TAG} -f target=$${v_target} + -f latest=$${LATEST} --repo=grafana/grafana release-pr.yml + depends_on: [] + environment: + GH_CLI_URL: https://github.com/cli/cli/releases/download/v2.50.0/gh_2.50.0_linux_amd64.tar.gz + GITHUB_TOKEN: + from_secret: github_token + image: byrnedo/alpine-curl:0.1.8 + name: create-release-pr +trigger: + event: + - promote + target: release-pr +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker --- -{"kind": "pipeline", "type": "docker", "name": "publish-artifacts-public", "trigger": {"event": ["promote"], "target": ["public"]}, "services": [], "steps": [{"name": "compile-build-cmd", "image": "golang:1.23.0-alpine", "commands": ["go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd"], "depends_on": [], "environment": {"CGO_ENABLED": 0}}, {"name": "publish-artifacts", "image": "grafana/grafana-ci-deploy:1.3.3", "environment": {"GCP_KEY": {"from_secret": "gcp_grafanauploads_base64"}, "PRERELEASE_BUCKET": {"from_secret": "prerelease_bucket"}}, "commands": ["./bin/build artifacts packages --tag $${DRONE_TAG} --src-bucket $${PRERELEASE_BUCKET}"], "depends_on": ["compile-build-cmd"]}, {"name": "publish-static-assets", "image": "grafana/grafana-ci-deploy:1.3.3", "environment": {"GCP_KEY": {"from_secret": "gcp_grafanauploads_base64"}, "PRERELEASE_BUCKET": {"from_secret": "prerelease_bucket"}, "STATIC_ASSET_EDITIONS": {"from_secret": "static_asset_editions"}}, "commands": ["./bin/build artifacts static-assets --tag ${DRONE_TAG} --static-asset-editions=grafana-oss"], "depends_on": ["compile-build-cmd"]}, {"name": "publish-storybook", "image": "grafana/grafana-ci-deploy:1.3.3", "environment": {"GCP_KEY": {"from_secret": "gcp_grafanauploads_base64"}, "PRERELEASE_BUCKET": {"from_secret": "prerelease_bucket"}}, "commands": ["./bin/build artifacts storybook --tag ${DRONE_TAG}"], "depends_on": ["compile-build-cmd"]}, {"name": "create-release-pr", "image": "byrnedo/alpine-curl:0.1.8", "depends_on": ["publish-artifacts", "publish-static-assets"], "environment": {"GITHUB_TOKEN": {"from_secret": "github_token"}, "GH_CLI_URL": "https://github.com/cli/cli/releases/download/v2.50.0/gh_2.50.0_linux_amd64.tar.gz"}, "commands": ["apk add perl", "v_target=`echo $${TAG} | perl -pe 's/^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$/v\\1.\\2.x/'`", "curl -L $${GH_CLI_URL} | tar -xz --strip-components=1 -C /usr", "gh workflow run -f dry_run=$${DRY_RUN} -f version=$${TAG} -f target=$${v_target} -f latest=$${LATEST} --repo=grafana/grafana release-pr.yml"]}], "clone": {"retries": 3}, "volumes": [{"name": "docker", "host": {"path": "/var/run/docker.sock"}}], "depends_on": [], "image_pull_secrets": ["gcr", "gar"], "environment": {"EDITION": "oss"}, "platform": {"os": "linux", "arch": "amd64"}, "node": {"type": "no-parallel"}} +clone: + retries: 3 +depends_on: [] +environment: + EDITION: oss +image_pull_secrets: +- gcr +- gar +kind: pipeline +name: publish-artifacts-public +node: + type: no-parallel +platform: + arch: amd64 + os: linux +services: [] +steps: +- commands: + - go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd + depends_on: [] + environment: + CGO_ENABLED: 0 + image: golang:1.22.5-alpine + name: compile-build-cmd +- commands: + - ./bin/build artifacts packages --tag $${DRONE_TAG} --src-bucket $${PRERELEASE_BUCKET} + depends_on: + - compile-build-cmd + environment: + GCP_KEY: + from_secret: gcp_grafanauploads_base64 + PRERELEASE_BUCKET: + from_secret: prerelease_bucket + image: grafana/grafana-ci-deploy:1.3.3 + name: publish-artifacts +- commands: + - ./bin/build artifacts static-assets --tag ${DRONE_TAG} --static-asset-editions=grafana-oss + depends_on: + - compile-build-cmd + environment: + GCP_KEY: + from_secret: gcp_grafanauploads_base64 + PRERELEASE_BUCKET: + from_secret: prerelease_bucket + STATIC_ASSET_EDITIONS: + from_secret: static_asset_editions + image: grafana/grafana-ci-deploy:1.3.3 + name: publish-static-assets +- commands: + - ./bin/build artifacts storybook --tag ${DRONE_TAG} + depends_on: + - compile-build-cmd + environment: + GCP_KEY: + from_secret: gcp_grafanauploads_base64 + PRERELEASE_BUCKET: + from_secret: prerelease_bucket + image: grafana/grafana-ci-deploy:1.3.3 + name: publish-storybook +- commands: + - apk add perl + - v_target=`echo $${TAG} | perl -pe 's/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/v\1.\2.x/'` + - curl -L $${GH_CLI_URL} | tar -xz --strip-components=1 -C /usr + - gh workflow run -f dry_run=$${DRY_RUN} -f version=$${TAG} -f target=$${v_target} + -f latest=$${LATEST} --repo=grafana/grafana release-pr.yml + depends_on: + - publish-artifacts + - publish-static-assets + environment: + GH_CLI_URL: https://github.com/cli/cli/releases/download/v2.50.0/gh_2.50.0_linux_amd64.tar.gz + GITHUB_TOKEN: + from_secret: github_token + image: byrnedo/alpine-curl:0.1.8 + name: create-release-pr +trigger: + event: + - promote + target: + - public +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker --- -{"kind": "pipeline", "type": "docker", "name": "publish-npm-packages-public", "trigger": {"event": ["promote"], "target": ["public"]}, "services": [], "steps": [{"name": "compile-build-cmd", "image": "golang:1.23.0-alpine", "commands": ["go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd"], "depends_on": [], "environment": {"CGO_ENABLED": 0}}, {"name": "yarn-install", "image": "node:20.9.0-alpine", "commands": ["yarn install --immutable"], "depends_on": []}, {"name": "retrieve-npm-packages", "image": "grafana/grafana-ci-deploy:1.3.3", "depends_on": ["compile-build-cmd", "yarn-install"], "failure": "ignore", "environment": {"GCP_KEY": {"from_secret": "gcp_grafanauploads_base64"}, "PRERELEASE_BUCKET": {"from_secret": "prerelease_bucket"}}, "commands": ["./bin/build artifacts npm retrieve --tag ${DRONE_TAG}"]}, {"name": "release-npm-packages", "image": "node:20.9.0-alpine", "depends_on": ["compile-build-cmd", "retrieve-npm-packages"], "failure": "ignore", "environment": {"NPM_TOKEN": {"from_secret": "npm_token"}}, "commands": ["./bin/build artifacts npm release --tag ${DRONE_TAG}"]}], "clone": {"retries": 3}, "volumes": [{"name": "docker", "host": {"path": "/var/run/docker.sock"}}], "depends_on": [], "image_pull_secrets": ["gcr", "gar"], "environment": {"EDITION": "oss"}, "platform": {"os": "linux", "arch": "amd64"}, "node": {"type": "no-parallel"}} +clone: + retries: 3 +depends_on: [] +environment: + EDITION: oss +image_pull_secrets: +- gcr +- gar +kind: pipeline +name: publish-npm-packages-public +node: + type: no-parallel +platform: + arch: amd64 + os: linux +services: [] +steps: +- commands: + - go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd + depends_on: [] + environment: + CGO_ENABLED: 0 + image: golang:1.22.5-alpine + name: compile-build-cmd +- commands: + - yarn install --immutable + depends_on: [] + image: node:20.9.0-alpine + name: yarn-install +- commands: + - ./bin/build artifacts npm retrieve --tag ${DRONE_TAG} + depends_on: + - compile-build-cmd + - yarn-install + environment: + GCP_KEY: + from_secret: gcp_grafanauploads_base64 + PRERELEASE_BUCKET: + from_secret: prerelease_bucket + failure: ignore + image: grafana/grafana-ci-deploy:1.3.3 + name: retrieve-npm-packages +- commands: + - ./bin/build artifacts npm release --tag ${DRONE_TAG} + depends_on: + - compile-build-cmd + - retrieve-npm-packages + environment: + NPM_TOKEN: + from_secret: npm_token + failure: ignore + image: node:20.9.0-alpine + name: release-npm-packages +trigger: + event: + - promote + target: + - public +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker --- -{"kind": "pipeline", "type": "docker", "name": "verify-grafanacom-artifacts", "trigger": {"event": ["promote"], "target": "verify-grafanacom-artifacts"}, "services": [], "steps": [{"name": "verify-grafanacom", "image": "node:20.9.0-alpine", "commands": ["apk add curl bash", "\n for i in {1..5}; do\n if ./scripts/drone/verify-grafanacom.sh; then\n exit 0\n elif [ $i -eq 5 ]; then\n exit 1\n else\n sleep 60\n fi\n done\n "], "depends_on": []}], "clone": {"retries": 3}, "volumes": [{"name": "docker", "host": {"path": "/var/run/docker.sock"}}], "depends_on": [], "image_pull_secrets": ["gcr", "gar"], "platform": {"os": "linux", "arch": "amd64"}, "node": {"type": "no-parallel"}} +clone: + retries: 3 +depends_on: [] +image_pull_secrets: +- gcr +- gar +kind: pipeline +name: verify-grafanacom-artifacts +node: + type: no-parallel +platform: + arch: amd64 + os: linux +services: [] +steps: +- commands: + - apk add curl bash + - "\n for i in {1..5}; do\n if ./scripts/drone/verify-grafanacom.sh; + then\n exit 0\n elif [ $i -eq 5 ]; then\n exit + 1\n else\n sleep 60\n fi\n done\n + \ " + depends_on: [] + image: node:20.9.0-alpine + name: verify-grafanacom +trigger: + event: + - promote + target: verify-grafanacom-artifacts +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker --- -{"kind": "pipeline", "type": "docker", "name": "verify-linux-packages", "trigger": {"event": ["promote"], "target": "verify-linux-packages"}, "services": [], "steps": [{"name": "verify-linux-DEB-packages", "image": "ubuntu:22.04", "environment": {}, "commands": ["echo \"Step 1: Updating package lists...\"", "apt-get update >/dev/null 2>&1", "echo \"Step 2: Installing prerequisites...\"", "DEBIAN_FRONTEND=noninteractive apt-get install -yq apt-transport-https software-properties-common wget >/dev/null 2>&1", "echo \"Step 3: Adding Grafana GPG key...\"", "mkdir -p /etc/apt/keyrings/", "wget -q -O - https://apt.grafana.com/gpg.key | gpg --dearmor | tee /etc/apt/keyrings/grafana.gpg > /dev/null", "echo \"Step 4: Adding Grafana repository...\"", "echo \"deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable main\" | tee -a /etc/apt/sources.list.d/grafana.list", "echo \"Step 5: Installing Grafana...\"", "for i in $(seq 1 10); do", " if apt-get update >/dev/null 2>&1 && DEBIAN_FRONTEND=noninteractive apt-get install -yq grafana=${TAG} >/dev/null 2>&1; then", " echo \"Command succeeded on attempt $i\"", " break", " else", " echo \"Attempt $i failed\"", " if [ $i -eq 10 ]; then", " echo 'All attempts failed'", " exit 1", " fi", " echo \"Waiting 60 seconds before next attempt...\"", " sleep 60", " fi", "done", "echo \"Step 6: Verifying Grafana installation...\"", "if dpkg -s grafana | grep -q \"Version: ${TAG}\"; then", " echo \"Successfully verified Grafana version ${TAG}\"", "else", " echo \"Failed to verify Grafana version ${TAG}\"", " exit 1", "fi", "echo \"Verification complete.\""], "depends_on": []}, {"name": "verify-linux-RPM-packages", "image": "rockylinux:9", "environment": {}, "commands": ["echo \"Step 1: Updating package lists...\"", "dnf check-update -y >/dev/null 2>&1 || true", "echo \"Step 2: Installing prerequisites...\"", "dnf install -y dnf-utils >/dev/null 2>&1", "echo \"Step 3: Adding Grafana GPG key...\"", "rpm --import https://rpm.grafana.com/gpg.key", "echo \"Step 4: Configuring Grafana repository...\"", "echo -e '[grafana]\nname=grafana\nbaseurl=https://rpm.grafana.com\nrepo_gpgcheck=0\nenabled=1\ngpgcheck=0\ngpgkey=https://rpm.grafana.com/gpg.key\nsslverify=1\nsslcacert=/etc/pki/tls/certs/ca-bundle.crt\n' \u003e /etc/yum.repos.d/grafana.repo", "echo \"Step 5: Checking RPM repository...\"", "dnf list available grafana-${TAG}", "if [ $? -eq 0 ]; then", " echo \"Grafana package found in repository. Installing from repo...\"", "for i in $(seq 1 5); do", " if dnf install -y --nogpgcheck grafana-${TAG} >/dev/null 2>&1; then", " echo \"Command succeeded on attempt $i\"", " break", " else", " echo \"Attempt $i failed\"", " if [ $i -eq 5 ]; then", " echo 'All attempts failed'", " exit 1", " fi", " echo \"Waiting 60 seconds before next attempt...\"", " sleep 60", " fi", "done", " echo \"Verifying GPG key...\"", " rpm --import https://rpm.grafana.com/gpg.key", " rpm -qa gpg-pubkey* | xargs rpm -qi | grep -i grafana", "else", " echo \"Grafana package version ${TAG} not found in repository.\"", " dnf repolist", " dnf list available grafana*", " exit 1", "fi", "echo \"Step 6: Verifying Grafana installation...\"", "if rpm -q grafana | grep -q \"${TAG}\"; then", " echo \"Successfully verified Grafana version ${TAG}\"", "else", " echo \"Failed to verify Grafana version ${TAG}\"", " exit 1", "fi", "echo \"Verification complete.\""], "depends_on": []}], "clone": {"retries": 3}, "volumes": [{"name": "docker", "host": {"path": "/var/run/docker.sock"}}], "depends_on": [], "image_pull_secrets": ["gcr", "gar"], "platform": {"os": "linux", "arch": "amd64"}, "node": {"type": "no-parallel"}} +clone: + retries: 3 +depends_on: [] +image_pull_secrets: +- gcr +- gar +kind: pipeline +name: verify-linux-packages +node: + type: no-parallel +platform: + arch: amd64 + os: linux +services: [] +steps: +- commands: + - 'echo "Step 1: Updating package lists..."' + - apt-get update >/dev/null 2>&1 + - 'echo "Step 2: Installing prerequisites..."' + - DEBIAN_FRONTEND=noninteractive apt-get install -yq apt-transport-https software-properties-common + wget >/dev/null 2>&1 + - 'echo "Step 3: Adding Grafana GPG key..."' + - mkdir -p /etc/apt/keyrings/ + - wget -q -O - https://apt.grafana.com/gpg.key | gpg --dearmor | tee /etc/apt/keyrings/grafana.gpg + > /dev/null + - 'echo "Step 4: Adding Grafana repository..."' + - echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable + main" | tee -a /etc/apt/sources.list.d/grafana.list + - 'echo "Step 5: Installing Grafana..."' + - for i in $(seq 1 10); do + - ' if apt-get update >/dev/null 2>&1 && DEBIAN_FRONTEND=noninteractive apt-get + install -yq grafana=${TAG} >/dev/null 2>&1; then' + - ' echo "Command succeeded on attempt $i"' + - ' break' + - ' else' + - ' echo "Attempt $i failed"' + - ' if [ $i -eq 10 ]; then' + - ' echo ''All attempts failed''' + - ' exit 1' + - ' fi' + - ' echo "Waiting 60 seconds before next attempt..."' + - ' sleep 60' + - ' fi' + - done + - 'echo "Step 6: Verifying Grafana installation..."' + - 'if dpkg -s grafana | grep -q "Version: ${TAG}"; then' + - ' echo "Successfully verified Grafana version ${TAG}"' + - else + - ' echo "Failed to verify Grafana version ${TAG}"' + - ' exit 1' + - fi + - echo "Verification complete." + depends_on: [] + environment: {} + image: ubuntu:22.04 + name: verify-linux-DEB-packages +- commands: + - 'echo "Step 1: Updating package lists..."' + - dnf check-update -y >/dev/null 2>&1 || true + - 'echo "Step 2: Installing prerequisites..."' + - dnf install -y dnf-utils >/dev/null 2>&1 + - 'echo "Step 3: Adding Grafana GPG key..."' + - rpm --import https://rpm.grafana.com/gpg.key + - 'echo "Step 4: Configuring Grafana repository..."' + - |- + echo -e '[grafana] + name=grafana + baseurl=https://rpm.grafana.com + repo_gpgcheck=0 + enabled=1 + gpgcheck=0 + gpgkey=https://rpm.grafana.com/gpg.key + sslverify=1 + sslcacert=/etc/pki/tls/certs/ca-bundle.crt + ' > /etc/yum.repos.d/grafana.repo + - 'echo "Step 5: Checking RPM repository..."' + - dnf list available grafana-${TAG} + - if [ $? -eq 0 ]; then + - ' echo "Grafana package found in repository. Installing from repo..."' + - for i in $(seq 1 5); do + - ' if dnf install -y --nogpgcheck grafana-${TAG} >/dev/null 2>&1; then' + - ' echo "Command succeeded on attempt $i"' + - ' break' + - ' else' + - ' echo "Attempt $i failed"' + - ' if [ $i -eq 5 ]; then' + - ' echo ''All attempts failed''' + - ' exit 1' + - ' fi' + - ' echo "Waiting 60 seconds before next attempt..."' + - ' sleep 60' + - ' fi' + - done + - ' echo "Verifying GPG key..."' + - ' rpm --import https://rpm.grafana.com/gpg.key' + - ' rpm -qa gpg-pubkey* | xargs rpm -qi | grep -i grafana' + - else + - ' echo "Grafana package version ${TAG} not found in repository."' + - ' dnf repolist' + - ' dnf list available grafana*' + - ' exit 1' + - fi + - 'echo "Step 6: Verifying Grafana installation..."' + - if rpm -q grafana | grep -q "${TAG}"; then + - ' echo "Successfully verified Grafana version ${TAG}"' + - else + - ' echo "Failed to verify Grafana version ${TAG}"' + - ' exit 1' + - fi + - echo "Verification complete." + depends_on: [] + environment: {} + image: rockylinux:9 + name: verify-linux-RPM-packages +trigger: + event: + - promote + target: verify-linux-packages +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker --- -{"kind": "pipeline", "type": "docker", "name": "publish-packages", "trigger": {"event": ["promote"], "target": ["public"]}, "services": [], "steps": [{"name": "compile-build-cmd", "image": "golang:1.23.0-alpine", "commands": ["go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd"], "depends_on": [], "environment": {"CGO_ENABLED": 0}}, {"name": "publish-linux-packages-deb", "image": "us.gcr.io/kubernetes-dev/package-publish:latest", "depends_on": ["compile-build-cmd"], "privileged": true, "settings": {"access_key_id": {"from_secret": "packages_access_key_id"}, "secret_access_key": {"from_secret": "packages_secret_access_key"}, "service_account_json": {"from_secret": "packages_service_account"}, "target_bucket": "grafana-packages", "deb_distribution": "auto", "gpg_passphrase": {"from_secret": "packages_gpg_passphrase"}, "gpg_public_key": {"from_secret": "packages_gpg_public_key"}, "gpg_private_key": {"from_secret": "packages_gpg_private_key"}, "package_path": "gs://grafana-prerelease/artifacts/downloads/*${DRONE_TAG}/oss/**.deb"}}, {"name": "publish-linux-packages-rpm", "image": "us.gcr.io/kubernetes-dev/package-publish:latest", "depends_on": ["compile-build-cmd"], "privileged": true, "settings": {"access_key_id": {"from_secret": "packages_access_key_id"}, "secret_access_key": {"from_secret": "packages_secret_access_key"}, "service_account_json": {"from_secret": "packages_service_account"}, "target_bucket": "grafana-packages", "deb_distribution": "auto", "gpg_passphrase": {"from_secret": "packages_gpg_passphrase"}, "gpg_public_key": {"from_secret": "packages_gpg_public_key"}, "gpg_private_key": {"from_secret": "packages_gpg_private_key"}, "package_path": "gs://grafana-prerelease/artifacts/downloads/*${DRONE_TAG}/oss/**.rpm"}}, {"name": "verify-linux-DEB-packages", "image": "ubuntu:22.04", "environment": {}, "commands": ["echo \"Step 1: Updating package lists...\"", "apt-get update >/dev/null 2>&1", "echo \"Step 2: Installing prerequisites...\"", "DEBIAN_FRONTEND=noninteractive apt-get install -yq apt-transport-https software-properties-common wget >/dev/null 2>&1", "echo \"Step 3: Adding Grafana GPG key...\"", "mkdir -p /etc/apt/keyrings/", "wget -q -O - https://apt.grafana.com/gpg.key | gpg --dearmor | tee /etc/apt/keyrings/grafana.gpg > /dev/null", "echo \"Step 4: Adding Grafana repository...\"", "echo \"deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable main\" | tee -a /etc/apt/sources.list.d/grafana.list", "echo \"Step 5: Installing Grafana...\"", "for i in $(seq 1 10); do", " if apt-get update >/dev/null 2>&1 && DEBIAN_FRONTEND=noninteractive apt-get install -yq grafana=${TAG} >/dev/null 2>&1; then", " echo \"Command succeeded on attempt $i\"", " break", " else", " echo \"Attempt $i failed\"", " if [ $i -eq 10 ]; then", " echo 'All attempts failed'", " exit 1", " fi", " echo \"Waiting 60 seconds before next attempt...\"", " sleep 60", " fi", "done", "echo \"Step 6: Verifying Grafana installation...\"", "if dpkg -s grafana | grep -q \"Version: ${TAG}\"; then", " echo \"Successfully verified Grafana version ${TAG}\"", "else", " echo \"Failed to verify Grafana version ${TAG}\"", " exit 1", "fi", "echo \"Verification complete.\""], "depends_on": ["publish-linux-packages-deb"]}, {"name": "verify-linux-RPM-packages", "image": "rockylinux:9", "environment": {}, "commands": ["echo \"Step 1: Updating package lists...\"", "dnf check-update -y >/dev/null 2>&1 || true", "echo \"Step 2: Installing prerequisites...\"", "dnf install -y dnf-utils >/dev/null 2>&1", "echo \"Step 3: Adding Grafana GPG key...\"", "rpm --import https://rpm.grafana.com/gpg.key", "echo \"Step 4: Configuring Grafana repository...\"", "echo -e '[grafana]\nname=grafana\nbaseurl=https://rpm.grafana.com\nrepo_gpgcheck=0\nenabled=1\ngpgcheck=0\ngpgkey=https://rpm.grafana.com/gpg.key\nsslverify=1\nsslcacert=/etc/pki/tls/certs/ca-bundle.crt\n' \u003e /etc/yum.repos.d/grafana.repo", "echo \"Step 5: Checking RPM repository...\"", "dnf list available grafana-${TAG}", "if [ $? -eq 0 ]; then", " echo \"Grafana package found in repository. Installing from repo...\"", "for i in $(seq 1 5); do", " if dnf install -y --nogpgcheck grafana-${TAG} >/dev/null 2>&1; then", " echo \"Command succeeded on attempt $i\"", " break", " else", " echo \"Attempt $i failed\"", " if [ $i -eq 5 ]; then", " echo 'All attempts failed'", " exit 1", " fi", " echo \"Waiting 60 seconds before next attempt...\"", " sleep 60", " fi", "done", " echo \"Verifying GPG key...\"", " rpm --import https://rpm.grafana.com/gpg.key", " rpm -qa gpg-pubkey* | xargs rpm -qi | grep -i grafana", "else", " echo \"Grafana package version ${TAG} not found in repository.\"", " dnf repolist", " dnf list available grafana*", " exit 1", "fi", "echo \"Step 6: Verifying Grafana installation...\"", "if rpm -q grafana | grep -q \"${TAG}\"; then", " echo \"Successfully verified Grafana version ${TAG}\"", "else", " echo \"Failed to verify Grafana version ${TAG}\"", " exit 1", "fi", "echo \"Verification complete.\""], "depends_on": ["publish-linux-packages-rpm"]}, {"name": "publish-grafanacom", "image": "grafana/grafana-ci-deploy:1.3.3", "depends_on": ["publish-linux-packages-deb", "publish-linux-packages-rpm"], "environment": {"GRAFANA_COM_API_KEY": {"from_secret": "grafana_api_key"}, "GCP_KEY": {"from_secret": "gcp_grafanauploads_base64"}}, "commands": ["./bin/build publish grafana-com --edition oss ${DRONE_TAG}"]}, {"name": "verify-grafanacom", "image": "node:20.9.0-alpine", "commands": ["apk add curl bash", "\n for i in {1..5}; do\n if ./scripts/drone/verify-grafanacom.sh; then\n exit 0\n elif [ $i -eq 5 ]; then\n exit 1\n else\n sleep 60\n fi\n done\n "], "depends_on": ["publish-grafanacom"]}], "clone": {"retries": 3}, "volumes": [{"name": "docker", "host": {"path": "/var/run/docker.sock"}}], "depends_on": ["publish-artifacts-public", "publish-docker-public"], "image_pull_secrets": ["gcr", "gar"], "environment": {"EDITION": "oss"}, "platform": {"os": "linux", "arch": "amd64"}, "node": {"type": "no-parallel"}} +clone: + retries: 3 +depends_on: +- publish-artifacts-public +- publish-docker-public +environment: + EDITION: oss +image_pull_secrets: +- gcr +- gar +kind: pipeline +name: publish-packages +node: + type: no-parallel +platform: + arch: amd64 + os: linux +services: [] +steps: +- commands: + - go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd + depends_on: [] + environment: + CGO_ENABLED: 0 + image: golang:1.22.5-alpine + name: compile-build-cmd +- depends_on: + - compile-build-cmd + image: us.gcr.io/kubernetes-dev/package-publish:latest + name: publish-linux-packages-deb + privileged: true + settings: + access_key_id: + from_secret: packages_access_key_id + deb_distribution: auto + gpg_passphrase: + from_secret: packages_gpg_passphrase + gpg_private_key: + from_secret: packages_gpg_private_key + gpg_public_key: + from_secret: packages_gpg_public_key + package_path: gs://grafana-prerelease/artifacts/downloads/*${DRONE_TAG}/oss/**.deb + secret_access_key: + from_secret: packages_secret_access_key + service_account_json: + from_secret: packages_service_account + target_bucket: grafana-packages +- depends_on: + - compile-build-cmd + image: us.gcr.io/kubernetes-dev/package-publish:latest + name: publish-linux-packages-rpm + privileged: true + settings: + access_key_id: + from_secret: packages_access_key_id + deb_distribution: auto + gpg_passphrase: + from_secret: packages_gpg_passphrase + gpg_private_key: + from_secret: packages_gpg_private_key + gpg_public_key: + from_secret: packages_gpg_public_key + package_path: gs://grafana-prerelease/artifacts/downloads/*${DRONE_TAG}/oss/**.rpm + secret_access_key: + from_secret: packages_secret_access_key + service_account_json: + from_secret: packages_service_account + target_bucket: grafana-packages +- commands: + - 'echo "Step 1: Updating package lists..."' + - apt-get update >/dev/null 2>&1 + - 'echo "Step 2: Installing prerequisites..."' + - DEBIAN_FRONTEND=noninteractive apt-get install -yq apt-transport-https software-properties-common + wget >/dev/null 2>&1 + - 'echo "Step 3: Adding Grafana GPG key..."' + - mkdir -p /etc/apt/keyrings/ + - wget -q -O - https://apt.grafana.com/gpg.key | gpg --dearmor | tee /etc/apt/keyrings/grafana.gpg + > /dev/null + - 'echo "Step 4: Adding Grafana repository..."' + - echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable + main" | tee -a /etc/apt/sources.list.d/grafana.list + - 'echo "Step 5: Installing Grafana..."' + - for i in $(seq 1 10); do + - ' if apt-get update >/dev/null 2>&1 && DEBIAN_FRONTEND=noninteractive apt-get + install -yq grafana=${TAG} >/dev/null 2>&1; then' + - ' echo "Command succeeded on attempt $i"' + - ' break' + - ' else' + - ' echo "Attempt $i failed"' + - ' if [ $i -eq 10 ]; then' + - ' echo ''All attempts failed''' + - ' exit 1' + - ' fi' + - ' echo "Waiting 60 seconds before next attempt..."' + - ' sleep 60' + - ' fi' + - done + - 'echo "Step 6: Verifying Grafana installation..."' + - 'if dpkg -s grafana | grep -q "Version: ${TAG}"; then' + - ' echo "Successfully verified Grafana version ${TAG}"' + - else + - ' echo "Failed to verify Grafana version ${TAG}"' + - ' exit 1' + - fi + - echo "Verification complete." + depends_on: + - publish-linux-packages-deb + environment: {} + image: ubuntu:22.04 + name: verify-linux-DEB-packages +- commands: + - 'echo "Step 1: Updating package lists..."' + - dnf check-update -y >/dev/null 2>&1 || true + - 'echo "Step 2: Installing prerequisites..."' + - dnf install -y dnf-utils >/dev/null 2>&1 + - 'echo "Step 3: Adding Grafana GPG key..."' + - rpm --import https://rpm.grafana.com/gpg.key + - 'echo "Step 4: Configuring Grafana repository..."' + - |- + echo -e '[grafana] + name=grafana + baseurl=https://rpm.grafana.com + repo_gpgcheck=0 + enabled=1 + gpgcheck=0 + gpgkey=https://rpm.grafana.com/gpg.key + sslverify=1 + sslcacert=/etc/pki/tls/certs/ca-bundle.crt + ' > /etc/yum.repos.d/grafana.repo + - 'echo "Step 5: Checking RPM repository..."' + - dnf list available grafana-${TAG} + - if [ $? -eq 0 ]; then + - ' echo "Grafana package found in repository. Installing from repo..."' + - for i in $(seq 1 5); do + - ' if dnf install -y --nogpgcheck grafana-${TAG} >/dev/null 2>&1; then' + - ' echo "Command succeeded on attempt $i"' + - ' break' + - ' else' + - ' echo "Attempt $i failed"' + - ' if [ $i -eq 5 ]; then' + - ' echo ''All attempts failed''' + - ' exit 1' + - ' fi' + - ' echo "Waiting 60 seconds before next attempt..."' + - ' sleep 60' + - ' fi' + - done + - ' echo "Verifying GPG key..."' + - ' rpm --import https://rpm.grafana.com/gpg.key' + - ' rpm -qa gpg-pubkey* | xargs rpm -qi | grep -i grafana' + - else + - ' echo "Grafana package version ${TAG} not found in repository."' + - ' dnf repolist' + - ' dnf list available grafana*' + - ' exit 1' + - fi + - 'echo "Step 6: Verifying Grafana installation..."' + - if rpm -q grafana | grep -q "${TAG}"; then + - ' echo "Successfully verified Grafana version ${TAG}"' + - else + - ' echo "Failed to verify Grafana version ${TAG}"' + - ' exit 1' + - fi + - echo "Verification complete." + depends_on: + - publish-linux-packages-rpm + environment: {} + image: rockylinux:9 + name: verify-linux-RPM-packages +- commands: + - ./bin/build publish grafana-com --edition oss ${DRONE_TAG} + depends_on: + - publish-linux-packages-deb + - publish-linux-packages-rpm + environment: + GCP_KEY: + from_secret: gcp_grafanauploads_base64 + GRAFANA_COM_API_KEY: + from_secret: grafana_api_key + image: grafana/grafana-ci-deploy:1.3.3 + name: publish-grafanacom +- commands: + - apk add curl bash + - "\n for i in {1..5}; do\n if ./scripts/drone/verify-grafanacom.sh; + then\n exit 0\n elif [ $i -eq 5 ]; then\n exit + 1\n else\n sleep 60\n fi\n done\n + \ " + depends_on: + - publish-grafanacom + image: node:20.9.0-alpine + name: verify-grafanacom +trigger: + event: + - promote + target: + - public +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker --- -{"kind": "pipeline", "type": "docker", "name": "rgm-main-prerelease", "trigger": {"event": ["push"], "branch": "main", "paths": {"exclude": ["*.md", "docs/**", "packages/**/*.md", "latest.json"]}, "repo": ["grafana/grafana"]}, "services": [], "steps": [{"name": "rgm-build", "image": "grafana/grafana-build:main", "pull": "always", "commands": ["export GRAFANA_DIR=$$(pwd)", "cd /src && ./scripts/drone_build_main.sh"], "environment": {"GO_VERSION": "1.23.0", "ALPINE_BASE": "alpine:3.19.1", "UBUNTU_BASE": "ubuntu:22.04", "DESTINATION": {"from_secret": "destination"}, "STORYBOOK_DESTINATION": {"from_secret": "rgm_storybook_destination"}, "CDN_DESTINATION": {"from_secret": "rgm_cdn_destination"}, "DOWNLOADS_DESTINATION": {"from_secret": "rgm_downloads_destination"}, "GCP_KEY_BASE64": {"from_secret": "gcp_key_base64"}, "GITHUB_TOKEN": {"from_secret": "github_token"}, "_EXPERIMENTAL_DAGGER_CLOUD_TOKEN": {"from_secret": "dagger_token"}, "GPG_PRIVATE_KEY": {"from_secret": "packages_gpg_private_key"}, "GPG_PUBLIC_KEY": {"from_secret": "packages_gpg_public_key"}, "GPG_PASSPHRASE": {"from_secret": "packages_gpg_passphrase"}, "DOCKER_USERNAME": {"from_secret": "docker_username"}, "DOCKER_PASSWORD": {"from_secret": "docker_password"}, "NPM_TOKEN": {"from_secret": "npm_token"}, "GCOM_API_KEY": {"from_secret": "grafana_api_key"}}, "volumes": [{"name": "docker", "path": "/var/run/docker.sock"}]}], "clone": {"retries": 3}, "volumes": [{"name": "docker", "host": {"path": "/var/run/docker.sock"}}], "depends_on": ["main-test-backend", "main-test-frontend"], "image_pull_secrets": ["gcr", "gar"], "platform": {"os": "linux", "arch": "amd64"}, "node": {"type": "no-parallel"}} +clone: + retries: 3 +depends_on: +- main-test-backend +- main-test-frontend +image_pull_secrets: +- gcr +- gar +kind: pipeline +name: rgm-main-prerelease +node: + type: no-parallel +platform: + arch: amd64 + os: linux +services: [] +steps: +- commands: + - export GRAFANA_DIR=$$(pwd) + - cd /src && ./scripts/drone_build_main.sh + environment: + _EXPERIMENTAL_DAGGER_CLOUD_TOKEN: + from_secret: dagger_token + ALPINE_BASE: alpine:3.19.1 + CDN_DESTINATION: + from_secret: rgm_cdn_destination + DESTINATION: + from_secret: destination + DOCKER_PASSWORD: + from_secret: docker_password + DOCKER_USERNAME: + from_secret: docker_username + DOWNLOADS_DESTINATION: + from_secret: rgm_downloads_destination + GCOM_API_KEY: + from_secret: grafana_api_key + GCP_KEY_BASE64: + from_secret: gcp_key_base64 + GITHUB_TOKEN: + from_secret: github_token + GO_VERSION: 1.22.5 + GPG_PASSPHRASE: + from_secret: packages_gpg_passphrase + GPG_PRIVATE_KEY: + from_secret: packages_gpg_private_key + GPG_PUBLIC_KEY: + from_secret: packages_gpg_public_key + NPM_TOKEN: + from_secret: npm_token + STORYBOOK_DESTINATION: + from_secret: rgm_storybook_destination + UBUNTU_BASE: ubuntu:22.04 + image: grafana/grafana-build:main + name: rgm-build + pull: always + volumes: + - name: docker + path: /var/run/docker.sock +trigger: + branch: main + event: + - push + paths: + exclude: + - '*.md' + - docs/** + - packages/**/*.md + - latest.json + repo: + - grafana/grafana +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker --- -{"kind": "pipeline", "type": "docker", "name": "release-whatsnew-checker", "trigger": {"event": {"exclude": ["promote"]}, "ref": {"include": ["refs/tags/v*"], "exclude": ["refs/tags/*-cloud*"]}}, "services": [], "steps": [{"name": "compile-build-cmd", "image": "golang:1.23.0-alpine", "commands": ["go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd"], "depends_on": [], "environment": {"CGO_ENABLED": 0}}, {"name": "whats-new-checker", "image": "golang:1.23.0-alpine", "depends_on": ["compile-build-cmd"], "commands": ["./bin/build whatsnew-checker"]}], "clone": {"retries": 3}, "volumes": [{"name": "docker", "host": {"path": "/var/run/docker.sock"}}], "depends_on": [], "image_pull_secrets": ["gcr", "gar"], "environment": {"EDITION": "oss"}, "platform": {"os": "linux", "arch": "amd64"}, "node": {"type": "no-parallel"}} +clone: + retries: 3 +depends_on: [] +environment: + EDITION: oss +image_pull_secrets: +- gcr +- gar +kind: pipeline +name: release-whatsnew-checker +node: + type: no-parallel +platform: + arch: amd64 + os: linux +services: [] +steps: +- commands: + - go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd + depends_on: [] + environment: + CGO_ENABLED: 0 + image: golang:1.22.5-alpine + name: compile-build-cmd +- commands: + - ./bin/build whatsnew-checker + depends_on: + - compile-build-cmd + image: golang:1.22.5-alpine + name: whats-new-checker +trigger: + event: + exclude: + - promote + ref: + exclude: + - refs/tags/*-cloud* + include: + - refs/tags/v* +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker --- -{"kind": "pipeline", "type": "docker", "name": "release-test-frontend", "trigger": {"event": {"exclude": ["promote"]}, "ref": {"include": ["refs/tags/v*"], "exclude": ["refs/tags/*-cloud*"]}}, "services": [], "steps": [{"name": "identify-runner", "image": "alpine:3.19.1", "commands": ["echo $DRONE_RUNNER_NAME"]}, {"name": "yarn-install", "image": "node:20.9.0-alpine", "commands": ["yarn install --immutable"], "depends_on": []}, {"name": "betterer-frontend", "image": "node:20.9.0-alpine", "depends_on": ["yarn-install"], "commands": ["apk add --update git bash", "yarn betterer ci"]}, {"name": "test-frontend", "image": "node:20.9.0-alpine", "environment": {"TEST_MAX_WORKERS": "50%"}, "depends_on": ["yarn-install"], "commands": ["yarn run ci:test-frontend"]}], "clone": {"retries": 3}, "volumes": [{"name": "docker", "host": {"path": "/var/run/docker.sock"}}], "depends_on": [], "image_pull_secrets": ["gcr", "gar"], "environment": {"EDITION": "oss"}, "platform": {"os": "linux", "arch": "amd64"}, "node": {"type": "no-parallel"}} +clone: + retries: 3 +depends_on: [] +environment: + EDITION: oss +image_pull_secrets: +- gcr +- gar +kind: pipeline +name: release-test-frontend +node: + type: no-parallel +platform: + arch: amd64 + os: linux +services: [] +steps: +- commands: + - echo $DRONE_RUNNER_NAME + image: alpine:3.19.1 + name: identify-runner +- commands: + - yarn install --immutable + depends_on: [] + image: node:20.9.0-alpine + name: yarn-install +- commands: + - apk add --update git bash + - yarn betterer ci + depends_on: + - yarn-install + image: node:20.9.0-alpine + name: betterer-frontend +- commands: + - yarn run ci:test-frontend + depends_on: + - yarn-install + environment: + TEST_MAX_WORKERS: 50% + image: node:20.9.0-alpine + name: test-frontend +trigger: + event: + exclude: + - promote + ref: + exclude: + - refs/tags/*-cloud* + include: + - refs/tags/v* +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker --- -{"kind": "pipeline", "type": "docker", "name": "release-test-backend", "trigger": {"event": {"exclude": ["promote"]}, "ref": {"include": ["refs/tags/v*"], "exclude": ["refs/tags/*-cloud*"]}}, "services": [], "steps": [{"name": "identify-runner", "image": "alpine:3.19.1", "commands": ["echo $DRONE_RUNNER_NAME"]}, {"name": "verify-gen-cue", "image": "golang:1.23.0-alpine", "depends_on": [], "commands": ["# It is required that code generated from Thema/CUE be committed and in sync with its inputs.", "# The following command will fail if running code generators produces any diff in output.", "apk add --update make", "CODEGEN_VERIFY=1 make gen-cue"]}, {"name": "verify-gen-jsonnet", "image": "golang:1.23.0-alpine", "depends_on": [], "commands": ["# It is required that generated jsonnet is committed and in sync with its inputs.", "# The following command will fail if running code generators produces any diff in output.", "apk add --update make", "CODEGEN_VERIFY=1 make gen-jsonnet"]}, {"name": "wire-install", "image": "golang:1.23.0-alpine", "commands": ["apk add --update make", "make gen-go"], "depends_on": ["verify-gen-cue"]}, {"name": "test-backend", "image": "golang:1.23.0-alpine", "depends_on": ["wire-install"], "commands": ["apk add --update build-base shared-mime-info shared-mime-info-lang", "go list -f '{{.Dir}}/...' -m | xargs go test -tags requires_buildifer -short -covermode=atomic -timeout=5m"]}, {"name": "test-backend-integration", "image": "golang:1.23.0-alpine", "depends_on": ["wire-install"], "commands": ["apk add --update build-base", "go test -count=1 -covermode=atomic -timeout=5m -run '^TestIntegration' $(find ./pkg -type f -name '*_test.go' -exec grep -l '^func TestIntegration' '{}' '+' | grep -o '\\(.*\\)/' | sort -u)"]}], "clone": {"retries": 3}, "volumes": [{"name": "docker", "host": {"path": "/var/run/docker.sock"}}], "depends_on": [], "image_pull_secrets": ["gcr", "gar"], "environment": {"EDITION": "oss"}, "platform": {"os": "linux", "arch": "amd64"}, "node": {"type": "no-parallel"}} +clone: + retries: 3 +depends_on: [] +environment: + EDITION: oss +image_pull_secrets: +- gcr +- gar +kind: pipeline +name: release-test-backend +node: + type: no-parallel +platform: + arch: amd64 + os: linux +services: [] +steps: +- commands: + - echo $DRONE_RUNNER_NAME + image: alpine:3.19.1 + name: identify-runner +- commands: + - '# It is required that code generated from Thema/CUE be committed and in sync + with its inputs.' + - '# The following command will fail if running code generators produces any diff + in output.' + - apk add --update make + - CODEGEN_VERIFY=1 make gen-cue + depends_on: [] + image: golang:1.22.5-alpine + name: verify-gen-cue +- commands: + - '# It is required that generated jsonnet is committed and in sync with its inputs.' + - '# The following command will fail if running code generators produces any diff + in output.' + - apk add --update make + - CODEGEN_VERIFY=1 make gen-jsonnet + depends_on: [] + image: golang:1.22.5-alpine + name: verify-gen-jsonnet +- commands: + - apk add --update make + - make gen-go + depends_on: + - verify-gen-cue + image: golang:1.22.5-alpine + name: wire-install +- commands: + - apk add --update build-base shared-mime-info shared-mime-info-lang + - go list -f '{{.Dir}}/...' -m | xargs go test -tags requires_buildifer -short -covermode=atomic + -timeout=5m + depends_on: + - wire-install + image: golang:1.22.5-alpine + name: test-backend +- commands: + - apk add --update build-base + - go test -count=1 -covermode=atomic -timeout=5m -run '^TestIntegration' $(find + ./pkg -type f -name '*_test.go' -exec grep -l '^func TestIntegration' '{}' '+' + | grep -o '\(.*\)/' | sort -u) + depends_on: + - wire-install + image: golang:1.22.5-alpine + name: test-backend-integration +trigger: + event: + exclude: + - promote + ref: + exclude: + - refs/tags/*-cloud* + include: + - refs/tags/v* +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker --- -{"kind": "pipeline", "type": "docker", "name": "rgm-tag-prerelease", "trigger": {"event": {"exclude": ["promote"]}, "ref": {"include": ["refs/tags/v*"], "exclude": ["refs/tags/*-cloud*"]}}, "services": [], "steps": [{"name": "rgm-build", "image": "grafana/grafana-build:main", "pull": "always", "commands": ["export GRAFANA_DIR=$$(pwd)", "cd /src && ./scripts/drone_build_tag_grafana.sh"], "environment": {"GO_VERSION": "1.23.0", "ALPINE_BASE": "alpine:3.19.1", "UBUNTU_BASE": "ubuntu:22.04", "DESTINATION": {"from_secret": "destination"}, "STORYBOOK_DESTINATION": {"from_secret": "rgm_storybook_destination"}, "CDN_DESTINATION": {"from_secret": "rgm_cdn_destination"}, "DOWNLOADS_DESTINATION": {"from_secret": "rgm_downloads_destination"}, "GCP_KEY_BASE64": {"from_secret": "gcp_key_base64"}, "GITHUB_TOKEN": {"from_secret": "github_token"}, "_EXPERIMENTAL_DAGGER_CLOUD_TOKEN": {"from_secret": "dagger_token"}, "GPG_PRIVATE_KEY": {"from_secret": "packages_gpg_private_key"}, "GPG_PUBLIC_KEY": {"from_secret": "packages_gpg_public_key"}, "GPG_PASSPHRASE": {"from_secret": "packages_gpg_passphrase"}, "DOCKER_USERNAME": {"from_secret": "docker_username"}, "DOCKER_PASSWORD": {"from_secret": "docker_password"}, "NPM_TOKEN": {"from_secret": "npm_token"}, "GCOM_API_KEY": {"from_secret": "grafana_api_key"}}, "volumes": [{"name": "docker", "path": "/var/run/docker.sock"}]}], "clone": {"retries": 3}, "volumes": [{"name": "docker", "host": {"path": "/var/run/docker.sock"}}], "depends_on": ["release-test-backend", "release-test-frontend"], "image_pull_secrets": ["gcr", "gar"], "platform": {"os": "linux", "arch": "amd64"}, "node": {"type": "no-parallel"}} +clone: + retries: 3 +depends_on: +- release-test-backend +- release-test-frontend +image_pull_secrets: +- gcr +- gar +kind: pipeline +name: rgm-tag-prerelease +node: + type: no-parallel +platform: + arch: amd64 + os: linux +services: [] +steps: +- commands: + - export GRAFANA_DIR=$$(pwd) + - cd /src && ./scripts/drone_build_tag_grafana.sh + environment: + _EXPERIMENTAL_DAGGER_CLOUD_TOKEN: + from_secret: dagger_token + ALPINE_BASE: alpine:3.19.1 + CDN_DESTINATION: + from_secret: rgm_cdn_destination + DESTINATION: + from_secret: destination + DOCKER_PASSWORD: + from_secret: docker_password + DOCKER_USERNAME: + from_secret: docker_username + DOWNLOADS_DESTINATION: + from_secret: rgm_downloads_destination + GCOM_API_KEY: + from_secret: grafana_api_key + GCP_KEY_BASE64: + from_secret: gcp_key_base64 + GITHUB_TOKEN: + from_secret: github_token + GO_VERSION: 1.22.5 + GPG_PASSPHRASE: + from_secret: packages_gpg_passphrase + GPG_PRIVATE_KEY: + from_secret: packages_gpg_private_key + GPG_PUBLIC_KEY: + from_secret: packages_gpg_public_key + NPM_TOKEN: + from_secret: npm_token + STORYBOOK_DESTINATION: + from_secret: rgm_storybook_destination + UBUNTU_BASE: ubuntu:22.04 + image: grafana/grafana-build:main + name: rgm-build + pull: always + volumes: + - name: docker + path: /var/run/docker.sock +trigger: + event: + exclude: + - promote + ref: + exclude: + - refs/tags/*-cloud* + include: + - refs/tags/v* +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker --- -{"kind": "pipeline", "type": "docker", "name": "rgm-tag-prerelease-windows", "trigger": {"event": {"exclude": ["promote"]}, "ref": {"include": ["refs/tags/v*"], "exclude": ["refs/tags/*-cloud*"]}}, "services": [], "steps": [{"name": "identify-runner", "image": "mcr.microsoft.com/windows:1809", "commands": ["echo $env:DRONE_RUNNER_NAME"]}, {"name": "windows-init", "image": "grafana/ci-wix:0.1.1", "commands": ["$$ProgressPreference = \"SilentlyContinue\"", "Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.50/windows/grabpl.exe -OutFile grabpl.exe"]}, {"name": "build-windows-installer", "image": "grafana/ci-wix:0.1.1", "depends_on": ["windows-init"], "environment": {"GCP_KEY": {"from_secret": "gcp_grafanauploads_base64"}, "PRERELEASE_BUCKET": {"from_secret": "prerelease_bucket"}, "GITHUB_TOKEN": {"from_secret": "github_token"}}, "commands": ["$$gcpKey = $$env:GCP_KEY", "[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($$gcpKey)) > gcpkey.json", "dos2unix gcpkey.json", "gcloud auth activate-service-account --key-file=gcpkey.json", "rm gcpkey.json", "cp C:\\App\\nssm-2.24.zip .", ".\\grabpl.exe windows-installer --target gs://grafana-prerelease/artifacts/downloads/${DRONE_TAG}/oss/release/grafana-${DRONE_TAG:1}.windows-amd64.zip --edition oss ${DRONE_TAG}", "$$fname = ((Get-Childitem grafana*.msi -name) -split \"`n\")[0]", "gsutil cp $$fname gs://grafana-prerelease/artifacts/downloads/${DRONE_TAG}/oss/release/", "gsutil cp \"$$fname.sha256\" gs://grafana-prerelease/artifacts/downloads/${DRONE_TAG}/oss/release/"]}], "clone": {"retries": 3}, "volumes": [{"name": "docker", "host": {"path": "//./pipe/docker_engine/"}}], "depends_on": ["rgm-tag-prerelease"], "image_pull_secrets": ["gcr", "gar"], "platform": {"os": "windows", "arch": "amd64", "version": "1809"}} +clone: + retries: 3 +depends_on: +- rgm-tag-prerelease +image_pull_secrets: +- gcr +- gar +kind: pipeline +name: rgm-tag-prerelease-windows +platform: + arch: amd64 + os: windows + version: "1809" +services: [] +steps: +- commands: + - echo $env:DRONE_RUNNER_NAME + image: mcr.microsoft.com/windows:1809 + name: identify-runner +- commands: + - $$ProgressPreference = "SilentlyContinue" + - Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.50/windows/grabpl.exe + -OutFile grabpl.exe + image: grafana/ci-wix:0.1.1 + name: windows-init +- commands: + - $$gcpKey = $$env:GCP_KEY + - '[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($$gcpKey)) + > gcpkey.json' + - dos2unix gcpkey.json + - gcloud auth activate-service-account --key-file=gcpkey.json + - rm gcpkey.json + - cp C:\App\nssm-2.24.zip . + - .\grabpl.exe windows-installer --target gs://grafana-prerelease/artifacts/downloads/${DRONE_TAG}/oss/release/grafana-${DRONE_TAG:1}.windows-amd64.zip + --edition oss ${DRONE_TAG} + - $$fname = ((Get-Childitem grafana*.msi -name) -split "`n")[0] + - gsutil cp $$fname gs://grafana-prerelease/artifacts/downloads/${DRONE_TAG}/oss/release/ + - gsutil cp "$$fname.sha256" gs://grafana-prerelease/artifacts/downloads/${DRONE_TAG}/oss/release/ + depends_on: + - windows-init + environment: + GCP_KEY: + from_secret: gcp_grafanauploads_base64 + GITHUB_TOKEN: + from_secret: github_token + PRERELEASE_BUCKET: + from_secret: prerelease_bucket + image: grafana/ci-wix:0.1.1 + name: build-windows-installer +trigger: + event: + exclude: + - promote + ref: + exclude: + - refs/tags/*-cloud* + include: + - refs/tags/v* +type: docker +volumes: +- host: + path: //./pipe/docker_engine/ + name: docker --- -{"kind": "pipeline", "type": "docker", "name": "rgm-tag-verify-prerelease-assets", "trigger": {"event": {"exclude": ["promote"]}, "ref": {"include": ["refs/tags/v*"], "exclude": ["refs/tags/*-cloud*"]}}, "services": [], "steps": [{"name": "gsutil-stat", "depends_on": ["clone"], "image": "google/cloud-sdk:431.0.0", "environment": {"BUCKET": "grafana-prerelease", "GCP_KEY": {"from_secret": "gcp_key_base64"}}, "commands": ["apt-get update && apt-get install -yq gettext", "printenv GCP_KEY | base64 -d > /tmp/key.json", "gcloud auth activate-service-account --key-file=/tmp/key.json", "./scripts/list-release-artifacts.sh ${DRONE_TAG} | xargs -n1 gsutil stat >> /tmp/stat.log", "! cat /tmp/stat.log | grep \"No URLs matched\""]}], "clone": {"retries": 3}, "volumes": [{"name": "docker", "host": {"path": "/var/run/docker.sock"}}], "depends_on": ["rgm-tag-prerelease", "rgm-tag-prerelease-windows"], "image_pull_secrets": ["gcr", "gar"], "platform": {"os": "linux", "arch": "amd64"}, "node": {"type": "no-parallel"}} +clone: + retries: 3 +depends_on: +- rgm-tag-prerelease +- rgm-tag-prerelease-windows +image_pull_secrets: +- gcr +- gar +kind: pipeline +name: rgm-tag-verify-prerelease-assets +node: + type: no-parallel +platform: + arch: amd64 + os: linux +services: [] +steps: +- commands: + - apt-get update && apt-get install -yq gettext + - printenv GCP_KEY | base64 -d > /tmp/key.json + - gcloud auth activate-service-account --key-file=/tmp/key.json + - ./scripts/list-release-artifacts.sh ${DRONE_TAG} | xargs -n1 gsutil stat >> /tmp/stat.log + - '! cat /tmp/stat.log | grep "No URLs matched"' + depends_on: + - clone + environment: + BUCKET: grafana-prerelease + GCP_KEY: + from_secret: gcp_key_base64 + image: google/cloud-sdk:431.0.0 + name: gsutil-stat +trigger: + event: + exclude: + - promote + ref: + exclude: + - refs/tags/*-cloud* + include: + - refs/tags/v* +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker --- -{"kind": "pipeline", "type": "docker", "name": "rgm-version-branch-prerelease", "trigger": {"ref": ["refs/heads/v[0-9]*"]}, "services": [], "steps": [{"name": "rgm-build", "image": "grafana/grafana-build:main", "pull": "always", "commands": ["export GRAFANA_DIR=$$(pwd)", "cd /src && ./scripts/drone_build_tag_grafana.sh"], "environment": {"GO_VERSION": "1.23.0", "ALPINE_BASE": "alpine:3.19.1", "UBUNTU_BASE": "ubuntu:22.04", "DESTINATION": {"from_secret": "destination"}, "STORYBOOK_DESTINATION": {"from_secret": "rgm_storybook_destination"}, "CDN_DESTINATION": {"from_secret": "rgm_cdn_destination"}, "DOWNLOADS_DESTINATION": {"from_secret": "rgm_downloads_destination"}, "GCP_KEY_BASE64": {"from_secret": "gcp_key_base64"}, "GITHUB_TOKEN": {"from_secret": "github_token"}, "_EXPERIMENTAL_DAGGER_CLOUD_TOKEN": {"from_secret": "dagger_token"}, "GPG_PRIVATE_KEY": {"from_secret": "packages_gpg_private_key"}, "GPG_PUBLIC_KEY": {"from_secret": "packages_gpg_public_key"}, "GPG_PASSPHRASE": {"from_secret": "packages_gpg_passphrase"}, "DOCKER_USERNAME": {"from_secret": "docker_username"}, "DOCKER_PASSWORD": {"from_secret": "docker_password"}, "NPM_TOKEN": {"from_secret": "npm_token"}, "GCOM_API_KEY": {"from_secret": "grafana_api_key"}}, "volumes": [{"name": "docker", "path": "/var/run/docker.sock"}]}], "clone": {"retries": 3}, "volumes": [{"name": "docker", "host": {"path": "/var/run/docker.sock"}}], "depends_on": ["release-test-backend", "release-test-frontend"], "image_pull_secrets": ["gcr", "gar"], "platform": {"os": "linux", "arch": "amd64"}, "node": {"type": "no-parallel"}} +clone: + retries: 3 +depends_on: +- release-test-backend +- release-test-frontend +image_pull_secrets: +- gcr +- gar +kind: pipeline +name: rgm-version-branch-prerelease +node: + type: no-parallel +platform: + arch: amd64 + os: linux +services: [] +steps: +- commands: + - export GRAFANA_DIR=$$(pwd) + - cd /src && ./scripts/drone_build_tag_grafana.sh + environment: + _EXPERIMENTAL_DAGGER_CLOUD_TOKEN: + from_secret: dagger_token + ALPINE_BASE: alpine:3.19.1 + CDN_DESTINATION: + from_secret: rgm_cdn_destination + DESTINATION: + from_secret: destination + DOCKER_PASSWORD: + from_secret: docker_password + DOCKER_USERNAME: + from_secret: docker_username + DOWNLOADS_DESTINATION: + from_secret: rgm_downloads_destination + GCOM_API_KEY: + from_secret: grafana_api_key + GCP_KEY_BASE64: + from_secret: gcp_key_base64 + GITHUB_TOKEN: + from_secret: github_token + GO_VERSION: 1.22.5 + GPG_PASSPHRASE: + from_secret: packages_gpg_passphrase + GPG_PRIVATE_KEY: + from_secret: packages_gpg_private_key + GPG_PUBLIC_KEY: + from_secret: packages_gpg_public_key + NPM_TOKEN: + from_secret: npm_token + STORYBOOK_DESTINATION: + from_secret: rgm_storybook_destination + UBUNTU_BASE: ubuntu:22.04 + image: grafana/grafana-build:main + name: rgm-build + pull: always + volumes: + - name: docker + path: /var/run/docker.sock +trigger: + ref: + - refs/heads/v[0-9]* +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker --- -{"kind": "pipeline", "type": "docker", "name": "rgm-prerelease-verify-prerelease-assets", "trigger": {"ref": ["refs/heads/v[0-9]*"]}, "services": [], "steps": [{"name": "gsutil-stat", "depends_on": ["clone"], "image": "google/cloud-sdk:431.0.0", "environment": {"BUCKET": "grafana-prerelease", "GCP_KEY": {"from_secret": "gcp_key_base64"}}, "commands": ["apt-get update && apt-get install -yq gettext", "printenv GCP_KEY | base64 -d > /tmp/key.json", "gcloud auth activate-service-account --key-file=/tmp/key.json", "./scripts/list-release-artifacts.sh ${DRONE_TAG} | xargs -n1 gsutil stat >> /tmp/stat.log", "! cat /tmp/stat.log | grep \"No URLs matched\""]}], "clone": {"retries": 3}, "volumes": [{"name": "docker", "host": {"path": "/var/run/docker.sock"}}], "depends_on": ["rgm-version-branch-prerelease"], "image_pull_secrets": ["gcr", "gar"], "platform": {"os": "linux", "arch": "amd64"}, "node": {"type": "no-parallel"}} +clone: + retries: 3 +depends_on: +- rgm-version-branch-prerelease +image_pull_secrets: +- gcr +- gar +kind: pipeline +name: rgm-prerelease-verify-prerelease-assets +node: + type: no-parallel +platform: + arch: amd64 + os: linux +services: [] +steps: +- commands: + - apt-get update && apt-get install -yq gettext + - printenv GCP_KEY | base64 -d > /tmp/key.json + - gcloud auth activate-service-account --key-file=/tmp/key.json + - ./scripts/list-release-artifacts.sh ${DRONE_TAG} | xargs -n1 gsutil stat >> /tmp/stat.log + - '! cat /tmp/stat.log | grep "No URLs matched"' + depends_on: + - clone + environment: + BUCKET: grafana-prerelease + GCP_KEY: + from_secret: gcp_key_base64 + image: google/cloud-sdk:431.0.0 + name: gsutil-stat +trigger: + ref: + - refs/heads/v[0-9]* +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker --- -{"kind": "pipeline", "type": "docker", "name": "nightly-test-frontend", "trigger": {"event": {"include": ["cron"]}, "cron": {"include": ["nightly-release"]}}, "services": [], "steps": [{"name": "identify-runner", "image": "alpine:3.19.1", "commands": ["echo $DRONE_RUNNER_NAME"]}, {"name": "yarn-install", "image": "node:20.9.0-alpine", "commands": ["yarn install --immutable"], "depends_on": []}, {"name": "betterer-frontend", "image": "node:20.9.0-alpine", "depends_on": ["yarn-install"], "commands": ["apk add --update git bash", "yarn betterer ci"]}, {"name": "test-frontend", "image": "node:20.9.0-alpine", "environment": {"TEST_MAX_WORKERS": "50%"}, "depends_on": ["yarn-install"], "commands": ["yarn run ci:test-frontend"]}], "clone": {"retries": 3}, "volumes": [{"name": "docker", "host": {"path": "/var/run/docker.sock"}}], "depends_on": [], "image_pull_secrets": ["gcr", "gar"], "environment": {"EDITION": "oss"}, "platform": {"os": "linux", "arch": "amd64"}, "node": {"type": "no-parallel"}} +clone: + retries: 3 +depends_on: [] +environment: + EDITION: oss +image_pull_secrets: +- gcr +- gar +kind: pipeline +name: nightly-test-frontend +node: + type: no-parallel +platform: + arch: amd64 + os: linux +services: [] +steps: +- commands: + - echo $DRONE_RUNNER_NAME + image: alpine:3.19.1 + name: identify-runner +- commands: + - yarn install --immutable + depends_on: [] + image: node:20.9.0-alpine + name: yarn-install +- commands: + - apk add --update git bash + - yarn betterer ci + depends_on: + - yarn-install + image: node:20.9.0-alpine + name: betterer-frontend +- commands: + - yarn run ci:test-frontend + depends_on: + - yarn-install + environment: + TEST_MAX_WORKERS: 50% + image: node:20.9.0-alpine + name: test-frontend +trigger: + cron: + include: + - nightly-release + event: + include: + - cron +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker --- -{"kind": "pipeline", "type": "docker", "name": "nightly-test-backend", "trigger": {"event": {"include": ["cron"]}, "cron": {"include": ["nightly-release"]}}, "services": [], "steps": [{"name": "identify-runner", "image": "alpine:3.19.1", "commands": ["echo $DRONE_RUNNER_NAME"]}, {"name": "verify-gen-cue", "image": "golang:1.23.0-alpine", "depends_on": [], "commands": ["# It is required that code generated from Thema/CUE be committed and in sync with its inputs.", "# The following command will fail if running code generators produces any diff in output.", "apk add --update make", "CODEGEN_VERIFY=1 make gen-cue"]}, {"name": "verify-gen-jsonnet", "image": "golang:1.23.0-alpine", "depends_on": [], "commands": ["# It is required that generated jsonnet is committed and in sync with its inputs.", "# The following command will fail if running code generators produces any diff in output.", "apk add --update make", "CODEGEN_VERIFY=1 make gen-jsonnet"]}, {"name": "wire-install", "image": "golang:1.23.0-alpine", "commands": ["apk add --update make", "make gen-go"], "depends_on": ["verify-gen-cue"]}, {"name": "test-backend", "image": "golang:1.23.0-alpine", "depends_on": ["wire-install"], "commands": ["apk add --update build-base shared-mime-info shared-mime-info-lang", "go list -f '{{.Dir}}/...' -m | xargs go test -tags requires_buildifer -short -covermode=atomic -timeout=5m"]}, {"name": "test-backend-integration", "image": "golang:1.23.0-alpine", "depends_on": ["wire-install"], "commands": ["apk add --update build-base", "go test -count=1 -covermode=atomic -timeout=5m -run '^TestIntegration' $(find ./pkg -type f -name '*_test.go' -exec grep -l '^func TestIntegration' '{}' '+' | grep -o '\\(.*\\)/' | sort -u)"]}], "clone": {"retries": 3}, "volumes": [{"name": "docker", "host": {"path": "/var/run/docker.sock"}}], "depends_on": [], "image_pull_secrets": ["gcr", "gar"], "environment": {"EDITION": "oss"}, "platform": {"os": "linux", "arch": "amd64"}, "node": {"type": "no-parallel"}} +clone: + retries: 3 +depends_on: [] +environment: + EDITION: oss +image_pull_secrets: +- gcr +- gar +kind: pipeline +name: nightly-test-backend +node: + type: no-parallel +platform: + arch: amd64 + os: linux +services: [] +steps: +- commands: + - echo $DRONE_RUNNER_NAME + image: alpine:3.19.1 + name: identify-runner +- commands: + - '# It is required that code generated from Thema/CUE be committed and in sync + with its inputs.' + - '# The following command will fail if running code generators produces any diff + in output.' + - apk add --update make + - CODEGEN_VERIFY=1 make gen-cue + depends_on: [] + image: golang:1.22.5-alpine + name: verify-gen-cue +- commands: + - '# It is required that generated jsonnet is committed and in sync with its inputs.' + - '# The following command will fail if running code generators produces any diff + in output.' + - apk add --update make + - CODEGEN_VERIFY=1 make gen-jsonnet + depends_on: [] + image: golang:1.22.5-alpine + name: verify-gen-jsonnet +- commands: + - apk add --update make + - make gen-go + depends_on: + - verify-gen-cue + image: golang:1.22.5-alpine + name: wire-install +- commands: + - apk add --update build-base shared-mime-info shared-mime-info-lang + - go list -f '{{.Dir}}/...' -m | xargs go test -tags requires_buildifer -short -covermode=atomic + -timeout=5m + depends_on: + - wire-install + image: golang:1.22.5-alpine + name: test-backend +- commands: + - apk add --update build-base + - go test -count=1 -covermode=atomic -timeout=5m -run '^TestIntegration' $(find + ./pkg -type f -name '*_test.go' -exec grep -l '^func TestIntegration' '{}' '+' + | grep -o '\(.*\)/' | sort -u) + depends_on: + - wire-install + image: golang:1.22.5-alpine + name: test-backend-integration +trigger: + cron: + include: + - nightly-release + event: + include: + - cron +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker --- -{"kind": "pipeline", "type": "docker", "name": "rgm-nightly-build", "trigger": {"event": {"include": ["cron"]}, "cron": {"include": ["nightly-release"]}}, "services": [], "steps": [{"name": "rgm-build", "image": "grafana/grafana-build:main", "pull": "always", "commands": ["export GRAFANA_DIR=$$(pwd)", "cd /src && ./scripts/drone_build_nightly_grafana.sh"], "environment": {"GO_VERSION": "1.23.0", "ALPINE_BASE": "alpine:3.19.1", "UBUNTU_BASE": "ubuntu:22.04", "DESTINATION": {"from_secret": "destination"}, "STORYBOOK_DESTINATION": {"from_secret": "rgm_storybook_destination"}, "CDN_DESTINATION": {"from_secret": "rgm_cdn_destination"}, "DOWNLOADS_DESTINATION": {"from_secret": "rgm_downloads_destination"}, "GCP_KEY_BASE64": {"from_secret": "gcp_key_base64"}, "GITHUB_TOKEN": {"from_secret": "github_token"}, "_EXPERIMENTAL_DAGGER_CLOUD_TOKEN": {"from_secret": "dagger_token"}, "GPG_PRIVATE_KEY": {"from_secret": "packages_gpg_private_key"}, "GPG_PUBLIC_KEY": {"from_secret": "packages_gpg_public_key"}, "GPG_PASSPHRASE": {"from_secret": "packages_gpg_passphrase"}, "DOCKER_USERNAME": {"from_secret": "docker_username"}, "DOCKER_PASSWORD": {"from_secret": "docker_password"}, "NPM_TOKEN": {"from_secret": "npm_token"}, "GCOM_API_KEY": {"from_secret": "grafana_api_key"}}, "volumes": [{"name": "docker", "path": "/var/run/docker.sock"}]}, {"name": "rgm-copy", "image": "google/cloud-sdk:alpine", "commands": ["mkdir -p $${DESTINATION}/$${DRONE_BUILD_EVENT}", "printenv GCP_KEY_BASE64 | base64 -d > /tmp/key.json", "gcloud auth activate-service-account --key-file=/tmp/key.json", "gcloud storage cp -r $${DRONE_WORKSPACE}/dist/* $${DESTINATION}/$${DRONE_BUILD_EVENT}"], "environment": {"DESTINATION": {"from_secret": "destination"}, "STORYBOOK_DESTINATION": {"from_secret": "rgm_storybook_destination"}, "CDN_DESTINATION": {"from_secret": "rgm_cdn_destination"}, "DOWNLOADS_DESTINATION": {"from_secret": "rgm_downloads_destination"}, "GCP_KEY_BASE64": {"from_secret": "gcp_key_base64"}, "GITHUB_TOKEN": {"from_secret": "github_token"}, "_EXPERIMENTAL_DAGGER_CLOUD_TOKEN": {"from_secret": "dagger_token"}, "GPG_PRIVATE_KEY": {"from_secret": "packages_gpg_private_key"}, "GPG_PUBLIC_KEY": {"from_secret": "packages_gpg_public_key"}, "GPG_PASSPHRASE": {"from_secret": "packages_gpg_passphrase"}, "DOCKER_USERNAME": {"from_secret": "docker_username"}, "DOCKER_PASSWORD": {"from_secret": "docker_password"}, "NPM_TOKEN": {"from_secret": "npm_token"}, "GCOM_API_KEY": {"from_secret": "grafana_api_key"}}, "depends_on": ["rgm-build"]}], "clone": {"retries": 3}, "volumes": [{"name": "docker", "host": {"path": "/var/run/docker.sock"}}], "depends_on": ["nightly-test-backend", "nightly-test-frontend"], "image_pull_secrets": ["gcr", "gar"], "platform": {"os": "linux", "arch": "amd64"}, "node": {"type": "no-parallel"}} +clone: + retries: 3 +depends_on: +- nightly-test-backend +- nightly-test-frontend +image_pull_secrets: +- gcr +- gar +kind: pipeline +name: rgm-nightly-build +node: + type: no-parallel +platform: + arch: amd64 + os: linux +services: [] +steps: +- commands: + - export GRAFANA_DIR=$$(pwd) + - cd /src && ./scripts/drone_build_nightly_grafana.sh + environment: + _EXPERIMENTAL_DAGGER_CLOUD_TOKEN: + from_secret: dagger_token + ALPINE_BASE: alpine:3.19.1 + CDN_DESTINATION: + from_secret: rgm_cdn_destination + DESTINATION: + from_secret: destination + DOCKER_PASSWORD: + from_secret: docker_password + DOCKER_USERNAME: + from_secret: docker_username + DOWNLOADS_DESTINATION: + from_secret: rgm_downloads_destination + GCOM_API_KEY: + from_secret: grafana_api_key + GCP_KEY_BASE64: + from_secret: gcp_key_base64 + GITHUB_TOKEN: + from_secret: github_token + GO_VERSION: 1.22.5 + GPG_PASSPHRASE: + from_secret: packages_gpg_passphrase + GPG_PRIVATE_KEY: + from_secret: packages_gpg_private_key + GPG_PUBLIC_KEY: + from_secret: packages_gpg_public_key + NPM_TOKEN: + from_secret: npm_token + STORYBOOK_DESTINATION: + from_secret: rgm_storybook_destination + UBUNTU_BASE: ubuntu:22.04 + image: grafana/grafana-build:main + name: rgm-build + pull: always + volumes: + - name: docker + path: /var/run/docker.sock +- commands: + - mkdir -p $${DESTINATION}/$${DRONE_BUILD_EVENT} + - printenv GCP_KEY_BASE64 | base64 -d > /tmp/key.json + - gcloud auth activate-service-account --key-file=/tmp/key.json + - gcloud storage cp -r $${DRONE_WORKSPACE}/dist/* $${DESTINATION}/$${DRONE_BUILD_EVENT} + depends_on: + - rgm-build + environment: + _EXPERIMENTAL_DAGGER_CLOUD_TOKEN: + from_secret: dagger_token + CDN_DESTINATION: + from_secret: rgm_cdn_destination + DESTINATION: + from_secret: destination + DOCKER_PASSWORD: + from_secret: docker_password + DOCKER_USERNAME: + from_secret: docker_username + DOWNLOADS_DESTINATION: + from_secret: rgm_downloads_destination + GCOM_API_KEY: + from_secret: grafana_api_key + GCP_KEY_BASE64: + from_secret: gcp_key_base64 + GITHUB_TOKEN: + from_secret: github_token + GPG_PASSPHRASE: + from_secret: packages_gpg_passphrase + GPG_PRIVATE_KEY: + from_secret: packages_gpg_private_key + GPG_PUBLIC_KEY: + from_secret: packages_gpg_public_key + NPM_TOKEN: + from_secret: npm_token + STORYBOOK_DESTINATION: + from_secret: rgm_storybook_destination + image: google/cloud-sdk:alpine + name: rgm-copy +trigger: + cron: + include: + - nightly-release + event: + include: + - cron +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker --- -{"kind": "pipeline", "type": "docker", "name": "rgm-nightly-publish", "trigger": {"event": {"include": ["cron"]}, "cron": {"include": ["nightly-release"]}}, "services": [], "steps": [{"name": "rgm-copy", "image": "google/cloud-sdk:alpine", "commands": ["mkdir -p $${DRONE_WORKSPACE}/dist", "printenv GCP_KEY_BASE64 | base64 -d > /tmp/key.json", "gcloud auth activate-service-account --key-file=/tmp/key.json", "gcloud storage cp -r $${DESTINATION}/$${DRONE_BUILD_EVENT}/*_$${DRONE_BUILD_NUMBER}_* $${DRONE_WORKSPACE}/dist"], "environment": {"DESTINATION": {"from_secret": "destination"}, "STORYBOOK_DESTINATION": {"from_secret": "rgm_storybook_destination"}, "CDN_DESTINATION": {"from_secret": "rgm_cdn_destination"}, "DOWNLOADS_DESTINATION": {"from_secret": "rgm_downloads_destination"}, "GCP_KEY_BASE64": {"from_secret": "gcp_key_base64"}, "GITHUB_TOKEN": {"from_secret": "github_token"}, "_EXPERIMENTAL_DAGGER_CLOUD_TOKEN": {"from_secret": "dagger_token"}, "GPG_PRIVATE_KEY": {"from_secret": "packages_gpg_private_key"}, "GPG_PUBLIC_KEY": {"from_secret": "packages_gpg_public_key"}, "GPG_PASSPHRASE": {"from_secret": "packages_gpg_passphrase"}, "DOCKER_USERNAME": {"from_secret": "docker_username"}, "DOCKER_PASSWORD": {"from_secret": "docker_password"}, "NPM_TOKEN": {"from_secret": "npm_token"}, "GCOM_API_KEY": {"from_secret": "grafana_api_key"}}}, {"name": "rgm-publish", "image": "grafana/grafana-build:main", "pull": "always", "commands": ["export GRAFANA_DIR=$$(pwd)", "cd /src && ./scripts/drone_publish_nightly_grafana.sh"], "environment": {"GO_VERSION": "1.23.0", "ALPINE_BASE": "alpine:3.19.1", "UBUNTU_BASE": "ubuntu:22.04", "DESTINATION": {"from_secret": "destination"}, "STORYBOOK_DESTINATION": {"from_secret": "rgm_storybook_destination"}, "CDN_DESTINATION": {"from_secret": "rgm_cdn_destination"}, "DOWNLOADS_DESTINATION": {"from_secret": "rgm_downloads_destination"}, "GCP_KEY_BASE64": {"from_secret": "gcp_key_base64"}, "GITHUB_TOKEN": {"from_secret": "github_token"}, "_EXPERIMENTAL_DAGGER_CLOUD_TOKEN": {"from_secret": "dagger_token"}, "GPG_PRIVATE_KEY": {"from_secret": "packages_gpg_private_key"}, "GPG_PUBLIC_KEY": {"from_secret": "packages_gpg_public_key"}, "GPG_PASSPHRASE": {"from_secret": "packages_gpg_passphrase"}, "DOCKER_USERNAME": {"from_secret": "docker_username"}, "DOCKER_PASSWORD": {"from_secret": "docker_password"}, "NPM_TOKEN": {"from_secret": "npm_token"}, "GCOM_API_KEY": {"from_secret": "grafana_api_key"}}, "volumes": [{"name": "docker", "path": "/var/run/docker.sock"}], "depends_on": ["rgm-copy"]}, {"name": "publish-deb", "image": "us.gcr.io/kubernetes-dev/package-publish:latest", "privileged": true, "settings": {"access_key_id": {"from_secret": "packages_access_key_id"}, "secret_access_key": {"from_secret": "packages_secret_access_key"}, "service_account_json": {"from_secret": "packages_service_account"}, "target_bucket": "grafana-packages", "gpg_passphrase": {"from_secret": "packages_gpg_passphrase"}, "gpg_public_key": {"from_secret": "packages_gpg_public_key"}, "gpg_private_key": {"from_secret": "packages_gpg_private_key"}, "package_path": "file:///drone/src/dist/*.deb"}, "depends_on": ["rgm-publish"]}, {"name": "publish-rpm", "image": "us.gcr.io/kubernetes-dev/package-publish:latest", "privileged": true, "settings": {"access_key_id": {"from_secret": "packages_access_key_id"}, "secret_access_key": {"from_secret": "packages_secret_access_key"}, "service_account_json": {"from_secret": "packages_service_account"}, "target_bucket": "grafana-packages", "gpg_passphrase": {"from_secret": "packages_gpg_passphrase"}, "gpg_public_key": {"from_secret": "packages_gpg_public_key"}, "gpg_private_key": {"from_secret": "packages_gpg_private_key"}, "package_path": "file:///drone/src/dist/*.rpm"}, "depends_on": ["rgm-publish"]}], "clone": {"retries": 3}, "volumes": [{"name": "docker", "host": {"path": "/var/run/docker.sock"}}], "depends_on": ["rgm-nightly-build"], "image_pull_secrets": ["gcr", "gar"], "platform": {"os": "linux", "arch": "amd64"}, "node": {"type": "no-parallel"}} +clone: + retries: 3 +depends_on: +- rgm-nightly-build +image_pull_secrets: +- gcr +- gar +kind: pipeline +name: rgm-nightly-publish +node: + type: no-parallel +platform: + arch: amd64 + os: linux +services: [] +steps: +- commands: + - mkdir -p $${DRONE_WORKSPACE}/dist + - printenv GCP_KEY_BASE64 | base64 -d > /tmp/key.json + - gcloud auth activate-service-account --key-file=/tmp/key.json + - gcloud storage cp -r $${DESTINATION}/$${DRONE_BUILD_EVENT}/*_$${DRONE_BUILD_NUMBER}_* + $${DRONE_WORKSPACE}/dist + environment: + _EXPERIMENTAL_DAGGER_CLOUD_TOKEN: + from_secret: dagger_token + CDN_DESTINATION: + from_secret: rgm_cdn_destination + DESTINATION: + from_secret: destination + DOCKER_PASSWORD: + from_secret: docker_password + DOCKER_USERNAME: + from_secret: docker_username + DOWNLOADS_DESTINATION: + from_secret: rgm_downloads_destination + GCOM_API_KEY: + from_secret: grafana_api_key + GCP_KEY_BASE64: + from_secret: gcp_key_base64 + GITHUB_TOKEN: + from_secret: github_token + GPG_PASSPHRASE: + from_secret: packages_gpg_passphrase + GPG_PRIVATE_KEY: + from_secret: packages_gpg_private_key + GPG_PUBLIC_KEY: + from_secret: packages_gpg_public_key + NPM_TOKEN: + from_secret: npm_token + STORYBOOK_DESTINATION: + from_secret: rgm_storybook_destination + image: google/cloud-sdk:alpine + name: rgm-copy +- commands: + - export GRAFANA_DIR=$$(pwd) + - cd /src && ./scripts/drone_publish_nightly_grafana.sh + depends_on: + - rgm-copy + environment: + _EXPERIMENTAL_DAGGER_CLOUD_TOKEN: + from_secret: dagger_token + ALPINE_BASE: alpine:3.19.1 + CDN_DESTINATION: + from_secret: rgm_cdn_destination + DESTINATION: + from_secret: destination + DOCKER_PASSWORD: + from_secret: docker_password + DOCKER_USERNAME: + from_secret: docker_username + DOWNLOADS_DESTINATION: + from_secret: rgm_downloads_destination + GCOM_API_KEY: + from_secret: grafana_api_key + GCP_KEY_BASE64: + from_secret: gcp_key_base64 + GITHUB_TOKEN: + from_secret: github_token + GO_VERSION: 1.22.5 + GPG_PASSPHRASE: + from_secret: packages_gpg_passphrase + GPG_PRIVATE_KEY: + from_secret: packages_gpg_private_key + GPG_PUBLIC_KEY: + from_secret: packages_gpg_public_key + NPM_TOKEN: + from_secret: npm_token + STORYBOOK_DESTINATION: + from_secret: rgm_storybook_destination + UBUNTU_BASE: ubuntu:22.04 + image: grafana/grafana-build:main + name: rgm-publish + pull: always + volumes: + - name: docker + path: /var/run/docker.sock +- depends_on: + - rgm-publish + image: us.gcr.io/kubernetes-dev/package-publish:latest + name: publish-deb + privileged: true + settings: + access_key_id: + from_secret: packages_access_key_id + gpg_passphrase: + from_secret: packages_gpg_passphrase + gpg_private_key: + from_secret: packages_gpg_private_key + gpg_public_key: + from_secret: packages_gpg_public_key + package_path: file:///drone/src/dist/*.deb + secret_access_key: + from_secret: packages_secret_access_key + service_account_json: + from_secret: packages_service_account + target_bucket: grafana-packages +- depends_on: + - rgm-publish + image: us.gcr.io/kubernetes-dev/package-publish:latest + name: publish-rpm + privileged: true + settings: + access_key_id: + from_secret: packages_access_key_id + gpg_passphrase: + from_secret: packages_gpg_passphrase + gpg_private_key: + from_secret: packages_gpg_private_key + gpg_public_key: + from_secret: packages_gpg_public_key + package_path: file:///drone/src/dist/*.rpm + secret_access_key: + from_secret: packages_secret_access_key + service_account_json: + from_secret: packages_service_account + target_bucket: grafana-packages +trigger: + cron: + include: + - nightly-release + event: + include: + - cron +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker --- -{"kind": "pipeline", "type": "docker", "name": "testing-test-backend-windows", "trigger": {"event": ["promote"], "target": ["test-windows"]}, "services": [], "steps": [{"name": "clone", "image": "grafana/ci-wix:0.1.1", "environment": {"GITHUB_TOKEN": {"from_secret": "github_token"}}, "commands": ["git clone \"https://$$env:GITHUB_TOKEN@github.com/$$env:DRONE_REPO.git\" .", "git checkout -f $$env:DRONE_COMMIT"]}, {"name": "windows-init", "image": "golang:1.23.0-windowsservercore-1809", "depends_on": ["clone"], "commands": []}, {"name": "wire-install", "image": "golang:1.23.0-windowsservercore-1809", "commands": ["go install github.com/google/wire/cmd/wire@v0.5.0", "wire gen -tags oss ./pkg/server"], "depends_on": ["windows-init"]}, {"name": "test-backend", "image": "golang:1.23.0-windowsservercore-1809", "depends_on": ["wire-install"], "commands": ["go test -tags requires_buildifer -short -covermode=atomic -timeout=5m ./pkg/..."]}], "clone": {"disable": true}, "volumes": [{"name": "docker", "host": {"path": "//./pipe/docker_engine/"}}], "depends_on": [], "image_pull_secrets": ["gcr", "gar"], "environment": {"EDITION": "oss"}, "platform": {"os": "windows", "arch": "amd64", "version": "1809"}} +clone: + disable: true +depends_on: [] +environment: + EDITION: oss +image_pull_secrets: +- gcr +- gar +kind: pipeline +name: testing-test-backend-windows +platform: + arch: amd64 + os: windows + version: "1809" +services: [] +steps: +- commands: + - git clone "https://$$env:GITHUB_TOKEN@github.com/$$env:DRONE_REPO.git" . + - git checkout -f $$env:DRONE_COMMIT + environment: + GITHUB_TOKEN: + from_secret: github_token + image: grafana/ci-wix:0.1.1 + name: clone +- commands: [] + depends_on: + - clone + image: golang:1.22.5-windowsservercore-1809 + name: windows-init +- commands: + - go install github.com/google/wire/cmd/wire@v0.5.0 + - wire gen -tags oss ./pkg/server + depends_on: + - windows-init + image: golang:1.22.5-windowsservercore-1809 + name: wire-install +- commands: + - go test -tags requires_buildifer -short -covermode=atomic -timeout=5m ./pkg/... + depends_on: + - wire-install + image: golang:1.22.5-windowsservercore-1809 + name: test-backend +trigger: + event: + - promote + target: + - test-windows +type: docker +volumes: +- host: + path: //./pipe/docker_engine/ + name: docker --- -{"kind": "pipeline", "type": "docker", "name": "integration-tests", "trigger": {"event": ["promote"], "target": "integration-tests"}, "services": [{"name": "postgres", "image": "postgres:12.3-alpine", "environment": {"POSTGRES_USER": "grafanatest", "POSTGRES_PASSWORD": "grafanatest", "POSTGRES_DB": "grafanatest", "PGDATA": "/var/lib/postgresql/data/pgdata"}, "volumes": [{"name": "postgres", "path": "/var/lib/postgresql/data/pgdata"}]}, {"name": "mysql57", "image": "mysql:5.7.39", "environment": {"MYSQL_ROOT_PASSWORD": "rootpass", "MYSQL_DATABASE": "grafana_tests", "MYSQL_USER": "grafana", "MYSQL_PASSWORD": "password"}, "volumes": [{"name": "mysql57", "path": "/var/lib/mysql"}], "commands": ["docker-entrypoint.sh mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci"]}, {"name": "mysql80", "image": "mysql:8.0.32", "environment": {"MYSQL_ROOT_PASSWORD": "rootpass", "MYSQL_DATABASE": "grafana_tests", "MYSQL_USER": "grafana", "MYSQL_PASSWORD": "password"}, "volumes": [{"name": "mysql80", "path": "/var/lib/mysql"}], "commands": ["docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password"]}, {"name": "mimir_backend", "image": "us.gcr.io/kubernetes-dev/mimir:gotjosh-state-config-grafana-663a0ae78", "environment": {}, "commands": ["/bin/mimir -target=backend"]}, {"name": "redis", "image": "redis:6.2.11-alpine", "environment": {}}, {"name": "memcached", "image": "memcached:1.6.9-alpine", "environment": {}}], "steps": [{"name": "grabpl", "image": "byrnedo/alpine-curl:0.1.8", "commands": ["mkdir -p bin", "curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.50/grabpl", "chmod +x bin/grabpl"]}, {"name": "identify-runner", "image": "alpine:3.19.1", "commands": ["echo $DRONE_RUNNER_NAME"]}, {"name": "verify-gen-cue", "image": "golang:1.23.0-alpine", "depends_on": [], "commands": ["# It is required that code generated from Thema/CUE be committed and in sync with its inputs.", "# The following command will fail if running code generators produces any diff in output.", "apk add --update make", "CODEGEN_VERIFY=1 make gen-cue"]}, {"name": "verify-gen-jsonnet", "image": "golang:1.23.0-alpine", "depends_on": [], "commands": ["# It is required that generated jsonnet is committed and in sync with its inputs.", "# The following command will fail if running code generators produces any diff in output.", "apk add --update make", "CODEGEN_VERIFY=1 make gen-jsonnet"]}, {"name": "wire-install", "image": "golang:1.23.0-alpine", "commands": ["apk add --update make", "make gen-go"], "depends_on": ["verify-gen-cue"]}, {"name": "wait-for-postgres", "image": "jwilder/dockerize:0.6.1", "commands": ["dockerize -wait tcp://postgres:5432 -timeout 120s"]}, {"name": "postgres-integration-tests", "image": "golang:1.23.0-alpine", "depends_on": ["wire-install", "wait-for-postgres"], "commands": ["apk add --update build-base", "apk add --update postgresql-client", "psql -p 5432 -h postgres -U grafanatest -d grafanatest -f devenv/docker/blocks/postgres_tests/setup.sql", "go clean -testcache", "go test -p=1 -count=1 -covermode=atomic -timeout=5m -run '^TestIntegration' $(find ./pkg -type f -name '*_test.go' -exec grep -l '^func TestIntegration' '{}' '+' | grep -o '\\(.*\\)/' | sort -u)"], "environment": {"PGPASSWORD": "grafanatest", "GRAFANA_TEST_DB": "postgres", "POSTGRES_HOST": "postgres"}}, {"name": "wait-for-mysql-5.7", "image": "jwilder/dockerize:0.6.1", "commands": ["dockerize -wait tcp://mysql57:3306 -timeout 120s"]}, {"name": "mysql-5.7-integration-tests", "image": "golang:1.23.0-alpine", "depends_on": ["wire-install", "wait-for-mysql-5.7"], "commands": ["apk add --update build-base", "apk add --update mysql-client", "cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql57 -P 3306 -u root -prootpass", "go clean -testcache", "go test -p=1 -count=1 -covermode=atomic -timeout=5m -run '^TestIntegration' $(find ./pkg -type f -name '*_test.go' -exec grep -l '^func TestIntegration' '{}' '+' | grep -o '\\(.*\\)/' | sort -u)"], "environment": {"GRAFANA_TEST_DB": "mysql", "MYSQL_HOST": "mysql57"}}, {"name": "wait-for-mysql-8.0", "image": "jwilder/dockerize:0.6.1", "commands": ["dockerize -wait tcp://mysql80:3306 -timeout 120s"]}, {"name": "mysql-8.0-integration-tests", "image": "golang:1.23.0-alpine", "depends_on": ["wire-install", "wait-for-mysql-8.0"], "commands": ["apk add --update build-base", "apk add --update mysql-client", "cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql80 -P 3306 -u root -prootpass", "go clean -testcache", "go test -p=1 -count=1 -covermode=atomic -timeout=5m -run '^TestIntegration' $(find ./pkg -type f -name '*_test.go' -exec grep -l '^func TestIntegration' '{}' '+' | grep -o '\\(.*\\)/' | sort -u)"], "environment": {"GRAFANA_TEST_DB": "mysql", "MYSQL_HOST": "mysql80"}}, {"name": "wait-for-redis", "image": "jwilder/dockerize:0.6.1", "commands": ["dockerize -wait tcp://redis:6379 -timeout 120s"]}, {"name": "redis-integration-tests", "image": "golang:1.23.0-alpine", "depends_on": ["wire-install", "wait-for-redis"], "commands": ["apk add --update build-base", "go clean -testcache", "go list -f '{{.Dir}}/...' -m | xargs go test -run IntegrationRedis -covermode=atomic -timeout=2m"], "environment": {"REDIS_URL": "redis://redis:6379/0"}}, {"name": "wait-for-memcached", "image": "jwilder/dockerize:0.6.1", "commands": ["dockerize -wait tcp://memcached:11211 -timeout 120s"]}, {"name": "memcached-integration-tests", "image": "golang:1.23.0-alpine", "depends_on": ["wire-install", "wait-for-memcached"], "commands": ["apk add --update build-base", "go clean -testcache", "go list -f '{{.Dir}}/...' -m | xargs go test -run IntegrationMemcached -covermode=atomic -timeout=2m"], "environment": {"MEMCACHED_HOSTS": "memcached:11211"}}, {"name": "wait-for-remote-alertmanager", "image": "jwilder/dockerize:0.6.1", "commands": ["dockerize -wait tcp://mimir_backend:8080 -timeout 120s"]}, {"name": "remote-alertmanager-integration-tests", "image": "golang:1.23.0-alpine", "depends_on": ["wire-install", "wait-for-remote-alertmanager"], "commands": ["apk add --update build-base", "go clean -testcache", "go test -run TestIntegrationRemoteAlertmanager -covermode=atomic -timeout=2m ./pkg/services/ngalert/..."], "environment": {"AM_TENANT_ID": "test", "AM_URL": "http://mimir_backend:8080"}}], "clone": {"retries": 3}, "volumes": [{"name": "docker", "host": {"path": "/var/run/docker.sock"}}, {"name": "postgres", "temp": {"medium": "memory"}}, {"name": "mysql57", "temp": {"medium": "memory"}}, {"name": "mysql80", "temp": {"medium": "memory"}}], "depends_on": [], "image_pull_secrets": ["gcr", "gar"], "environment": {"EDITION": "oss"}, "platform": {"os": "linux", "arch": "amd64"}, "node": {"type": "no-parallel"}} +clone: + retries: 3 +depends_on: [] +environment: + EDITION: oss +image_pull_secrets: +- gcr +- gar +kind: pipeline +name: integration-tests +node: + type: no-parallel +platform: + arch: amd64 + os: linux +services: +- environment: + PGDATA: /var/lib/postgresql/data/pgdata + POSTGRES_DB: grafanatest + POSTGRES_PASSWORD: grafanatest + POSTGRES_USER: grafanatest + image: postgres:12.3-alpine + name: postgres + volumes: + - name: postgres + path: /var/lib/postgresql/data/pgdata +- commands: + - docker-entrypoint.sh mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci + environment: + MYSQL_DATABASE: grafana_tests + MYSQL_PASSWORD: password + MYSQL_ROOT_PASSWORD: rootpass + MYSQL_USER: grafana + image: mysql:5.7.39 + name: mysql57 + volumes: + - name: mysql57 + path: /var/lib/mysql +- commands: + - docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password + environment: + MYSQL_DATABASE: grafana_tests + MYSQL_PASSWORD: password + MYSQL_ROOT_PASSWORD: rootpass + MYSQL_USER: grafana + image: mysql:8.0.32 + name: mysql80 + volumes: + - name: mysql80 + path: /var/lib/mysql +- commands: + - /bin/mimir -target=backend + environment: {} + image: us.gcr.io/kubernetes-dev/mimir:gotjosh-state-config-grafana-663a0ae78 + name: mimir_backend +- environment: {} + image: redis:6.2.11-alpine + name: redis +- environment: {} + image: memcached:1.6.9-alpine + name: memcached +steps: +- commands: + - mkdir -p bin + - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.50/grabpl + - chmod +x bin/grabpl + image: byrnedo/alpine-curl:0.1.8 + name: grabpl +- commands: + - echo $DRONE_RUNNER_NAME + image: alpine:3.19.1 + name: identify-runner +- commands: + - '# It is required that code generated from Thema/CUE be committed and in sync + with its inputs.' + - '# The following command will fail if running code generators produces any diff + in output.' + - apk add --update make + - CODEGEN_VERIFY=1 make gen-cue + depends_on: [] + image: golang:1.22.5-alpine + name: verify-gen-cue +- commands: + - '# It is required that generated jsonnet is committed and in sync with its inputs.' + - '# The following command will fail if running code generators produces any diff + in output.' + - apk add --update make + - CODEGEN_VERIFY=1 make gen-jsonnet + depends_on: [] + image: golang:1.22.5-alpine + name: verify-gen-jsonnet +- commands: + - apk add --update make + - make gen-go + depends_on: + - verify-gen-cue + image: golang:1.22.5-alpine + name: wire-install +- commands: + - dockerize -wait tcp://postgres:5432 -timeout 120s + image: jwilder/dockerize:0.6.1 + name: wait-for-postgres +- commands: + - apk add --update build-base + - apk add --update postgresql-client + - psql -p 5432 -h postgres -U grafanatest -d grafanatest -f devenv/docker/blocks/postgres_tests/setup.sql + - go clean -testcache + - go test -p=1 -count=1 -covermode=atomic -timeout=5m -run '^TestIntegration' $(find + ./pkg -type f -name '*_test.go' -exec grep -l '^func TestIntegration' '{}' '+' + | grep -o '\(.*\)/' | sort -u) + depends_on: + - wire-install + - wait-for-postgres + environment: + GRAFANA_TEST_DB: postgres + PGPASSWORD: grafanatest + POSTGRES_HOST: postgres + image: golang:1.22.5-alpine + name: postgres-integration-tests +- commands: + - dockerize -wait tcp://mysql57:3306 -timeout 120s + image: jwilder/dockerize:0.6.1 + name: wait-for-mysql-5.7 +- commands: + - apk add --update build-base + - apk add --update mysql-client + - cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql57 -P 3306 -u root + -prootpass + - go clean -testcache + - go test -p=1 -count=1 -covermode=atomic -timeout=5m -run '^TestIntegration' $(find + ./pkg -type f -name '*_test.go' -exec grep -l '^func TestIntegration' '{}' '+' + | grep -o '\(.*\)/' | sort -u) + depends_on: + - wire-install + - wait-for-mysql-5.7 + environment: + GRAFANA_TEST_DB: mysql + MYSQL_HOST: mysql57 + image: golang:1.22.5-alpine + name: mysql-5.7-integration-tests +- commands: + - dockerize -wait tcp://mysql80:3306 -timeout 120s + image: jwilder/dockerize:0.6.1 + name: wait-for-mysql-8.0 +- commands: + - apk add --update build-base + - apk add --update mysql-client + - cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql80 -P 3306 -u root + -prootpass + - go clean -testcache + - go test -p=1 -count=1 -covermode=atomic -timeout=5m -run '^TestIntegration' $(find + ./pkg -type f -name '*_test.go' -exec grep -l '^func TestIntegration' '{}' '+' + | grep -o '\(.*\)/' | sort -u) + depends_on: + - wire-install + - wait-for-mysql-8.0 + environment: + GRAFANA_TEST_DB: mysql + MYSQL_HOST: mysql80 + image: golang:1.22.5-alpine + name: mysql-8.0-integration-tests +- commands: + - dockerize -wait tcp://redis:6379 -timeout 120s + image: jwilder/dockerize:0.6.1 + name: wait-for-redis +- commands: + - apk add --update build-base + - go clean -testcache + - go list -f '{{.Dir}}/...' -m | xargs go test -run IntegrationRedis -covermode=atomic + -timeout=2m + depends_on: + - wire-install + - wait-for-redis + environment: + REDIS_URL: redis://redis:6379/0 + image: golang:1.22.5-alpine + name: redis-integration-tests +- commands: + - dockerize -wait tcp://memcached:11211 -timeout 120s + image: jwilder/dockerize:0.6.1 + name: wait-for-memcached +- commands: + - apk add --update build-base + - go clean -testcache + - go list -f '{{.Dir}}/...' -m | xargs go test -run IntegrationMemcached -covermode=atomic + -timeout=2m + depends_on: + - wire-install + - wait-for-memcached + environment: + MEMCACHED_HOSTS: memcached:11211 + image: golang:1.22.5-alpine + name: memcached-integration-tests +- commands: + - dockerize -wait tcp://mimir_backend:8080 -timeout 120s + image: jwilder/dockerize:0.6.1 + name: wait-for-remote-alertmanager +- commands: + - apk add --update build-base + - go clean -testcache + - go test -run TestIntegrationRemoteAlertmanager -covermode=atomic -timeout=2m ./pkg/services/ngalert/... + depends_on: + - wire-install + - wait-for-remote-alertmanager + environment: + AM_TENANT_ID: test + AM_URL: http://mimir_backend:8080 + image: golang:1.22.5-alpine + name: remote-alertmanager-integration-tests +trigger: + event: + - promote + target: integration-tests +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker +- name: postgres + temp: + medium: memory +- name: mysql57 + temp: + medium: memory +- name: mysql80 + temp: + medium: memory --- -{"kind": "pipeline", "type": "docker", "name": "publish-ci-windows-test-image", "trigger": {"event": ["promote"], "target": ["ci-windows-test-image"]}, "services": [], "steps": [{"name": "clone", "image": "grafana/ci-wix:0.1.1", "environment": {"GITHUB_TOKEN": {"from_secret": "github_token"}}, "commands": ["git clone \"https://$$env:GITHUB_TOKEN@github.com/grafana/grafana-ci-sandbox.git\" .", "git checkout -f $$env:DRONE_COMMIT"]}, {"name": "build-and-publish", "image": "docker:windowsservercore-1809", "environment": {"DOCKER_USERNAME": {"from_secret": "docker_username"}, "DOCKER_PASSWORD": {"from_secret": "docker_password"}}, "commands": ["cd scripts\\build\\ci-windows-test", "docker login -u $$env:DOCKER_USERNAME -p $$env:DOCKER_PASSWORD", "docker build -t grafana/grafana-ci-windows-test:$$env:TAG .", "docker push grafana/grafana-ci-windows-test:$$env:TAG"], "volumes": [{"name": "docker", "path": "//./pipe/docker_engine/"}]}], "clone": {"disable": true}, "volumes": [{"name": "docker", "host": {"path": "//./pipe/docker_engine/"}}], "depends_on": [], "image_pull_secrets": ["gcr", "gar"], "platform": {"os": "windows", "arch": "amd64", "version": "1809"}} +clone: + disable: true +depends_on: [] +image_pull_secrets: +- gcr +- gar +kind: pipeline +name: publish-ci-windows-test-image +platform: + arch: amd64 + os: windows + version: "1809" +services: [] +steps: +- commands: + - git clone "https://$$env:GITHUB_TOKEN@github.com/grafana/grafana-ci-sandbox.git" + . + - git checkout -f $$env:DRONE_COMMIT + environment: + GITHUB_TOKEN: + from_secret: github_token + image: grafana/ci-wix:0.1.1 + name: clone +- commands: + - cd scripts\build\ci-windows-test + - docker login -u $$env:DOCKER_USERNAME -p $$env:DOCKER_PASSWORD + - docker build -t grafana/grafana-ci-windows-test:$$env:TAG . + - docker push grafana/grafana-ci-windows-test:$$env:TAG + environment: + DOCKER_PASSWORD: + from_secret: docker_password + DOCKER_USERNAME: + from_secret: docker_username + image: docker:windowsservercore-1809 + name: build-and-publish + volumes: + - name: docker + path: //./pipe/docker_engine/ +trigger: + event: + - promote + target: + - ci-windows-test-image +type: docker +volumes: +- host: + path: //./pipe/docker_engine/ + name: docker --- -{"kind": "pipeline", "type": "docker", "platform": {"os": "linux", "arch": "amd64"}, "name": "scan-grafana/grafana:latest-image", "trigger": {"event": "cron", "cron": "nightly"}, "clone": {"retries": 3}, "steps": [{"name": "authenticate-gcr", "image": "docker:dind", "commands": ["echo $${GCR_CREDENTIALS} | docker login -u _json_key --password-stdin https://us.gcr.io"], "environment": {"GCR_CREDENTIALS": {"from_secret": "gcr_credentials"}}, "volumes": [{"name": "docker", "path": "/var/run/docker.sock"}, {"name": "config", "path": "/root/.docker/"}]}, {"name": "scan-unknown-low-medium-vulnerabilities", "image": "aquasec/trivy:0.21.0", "commands": ["trivy image --exit-code 0 --severity UNKNOWN,LOW,MEDIUM grafana/grafana:latest"], "depends_on": ["authenticate-gcr"], "volumes": [{"name": "docker", "path": "/var/run/docker.sock"}, {"name": "config", "path": "/root/.docker/"}]}, {"name": "scan-high-critical-vulnerabilities", "image": "aquasec/trivy:0.21.0", "commands": ["trivy image --exit-code 1 --severity HIGH,CRITICAL grafana/grafana:latest"], "depends_on": ["authenticate-gcr"], "environment": {"GOOGLE_APPLICATION_CREDENTIALS": {"from_secret": "gcr_credentials_json"}}, "volumes": [{"name": "docker", "path": "/var/run/docker.sock"}, {"name": "config", "path": "/root/.docker/"}]}, {"name": "slack-notify-failure", "image": "plugins/slack", "settings": {"webhook": {"from_secret": "slack_webhook_backend"}, "channel": "grafana-backend-ops", "template": "Nightly docker image scan job for grafana/grafana:latest failed: {{build.link}}"}, "when": {"status": "failure"}}], "volumes": [{"name": "docker", "host": {"path": "/var/run/docker.sock"}}, {"name": "config", "temp": {}}]} +clone: + retries: 3 +kind: pipeline +name: scan-grafana/grafana:latest-image +platform: + arch: amd64 + os: linux +steps: +- commands: + - echo $${GCR_CREDENTIALS} | docker login -u _json_key --password-stdin https://us.gcr.io + environment: + GCR_CREDENTIALS: + from_secret: gcr_credentials + image: docker:dind + name: authenticate-gcr + volumes: + - name: docker + path: /var/run/docker.sock + - name: config + path: /root/.docker/ +- commands: + - trivy image --exit-code 0 --severity UNKNOWN,LOW,MEDIUM grafana/grafana:latest + depends_on: + - authenticate-gcr + image: aquasec/trivy:0.21.0 + name: scan-unknown-low-medium-vulnerabilities + volumes: + - name: docker + path: /var/run/docker.sock + - name: config + path: /root/.docker/ +- commands: + - trivy image --exit-code 1 --severity HIGH,CRITICAL grafana/grafana:latest + depends_on: + - authenticate-gcr + environment: + GOOGLE_APPLICATION_CREDENTIALS: + from_secret: gcr_credentials_json + image: aquasec/trivy:0.21.0 + name: scan-high-critical-vulnerabilities + volumes: + - name: docker + path: /var/run/docker.sock + - name: config + path: /root/.docker/ +- image: plugins/slack + name: slack-notify-failure + settings: + channel: grafana-backend-ops + template: 'Nightly docker image scan job for grafana/grafana:latest failed: {{build.link}}' + webhook: + from_secret: slack_webhook_backend + when: + status: failure +trigger: + cron: nightly + event: cron +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker +- name: config + temp: {} --- -{"kind": "pipeline", "type": "docker", "platform": {"os": "linux", "arch": "amd64"}, "name": "scan-grafana/grafana:main-image", "trigger": {"event": "cron", "cron": "nightly"}, "clone": {"retries": 3}, "steps": [{"name": "authenticate-gcr", "image": "docker:dind", "commands": ["echo $${GCR_CREDENTIALS} | docker login -u _json_key --password-stdin https://us.gcr.io"], "environment": {"GCR_CREDENTIALS": {"from_secret": "gcr_credentials"}}, "volumes": [{"name": "docker", "path": "/var/run/docker.sock"}, {"name": "config", "path": "/root/.docker/"}]}, {"name": "scan-unknown-low-medium-vulnerabilities", "image": "aquasec/trivy:0.21.0", "commands": ["trivy image --exit-code 0 --severity UNKNOWN,LOW,MEDIUM grafana/grafana:main"], "depends_on": ["authenticate-gcr"], "volumes": [{"name": "docker", "path": "/var/run/docker.sock"}, {"name": "config", "path": "/root/.docker/"}]}, {"name": "scan-high-critical-vulnerabilities", "image": "aquasec/trivy:0.21.0", "commands": ["trivy image --exit-code 1 --severity HIGH,CRITICAL grafana/grafana:main"], "depends_on": ["authenticate-gcr"], "environment": {"GOOGLE_APPLICATION_CREDENTIALS": {"from_secret": "gcr_credentials_json"}}, "volumes": [{"name": "docker", "path": "/var/run/docker.sock"}, {"name": "config", "path": "/root/.docker/"}]}, {"name": "slack-notify-failure", "image": "plugins/slack", "settings": {"webhook": {"from_secret": "slack_webhook_backend"}, "channel": "grafana-backend-ops", "template": "Nightly docker image scan job for grafana/grafana:main failed: {{build.link}}"}, "when": {"status": "failure"}}], "volumes": [{"name": "docker", "host": {"path": "/var/run/docker.sock"}}, {"name": "config", "temp": {}}]} +clone: + retries: 3 +kind: pipeline +name: scan-grafana/grafana:main-image +platform: + arch: amd64 + os: linux +steps: +- commands: + - echo $${GCR_CREDENTIALS} | docker login -u _json_key --password-stdin https://us.gcr.io + environment: + GCR_CREDENTIALS: + from_secret: gcr_credentials + image: docker:dind + name: authenticate-gcr + volumes: + - name: docker + path: /var/run/docker.sock + - name: config + path: /root/.docker/ +- commands: + - trivy image --exit-code 0 --severity UNKNOWN,LOW,MEDIUM grafana/grafana:main + depends_on: + - authenticate-gcr + image: aquasec/trivy:0.21.0 + name: scan-unknown-low-medium-vulnerabilities + volumes: + - name: docker + path: /var/run/docker.sock + - name: config + path: /root/.docker/ +- commands: + - trivy image --exit-code 1 --severity HIGH,CRITICAL grafana/grafana:main + depends_on: + - authenticate-gcr + environment: + GOOGLE_APPLICATION_CREDENTIALS: + from_secret: gcr_credentials_json + image: aquasec/trivy:0.21.0 + name: scan-high-critical-vulnerabilities + volumes: + - name: docker + path: /var/run/docker.sock + - name: config + path: /root/.docker/ +- image: plugins/slack + name: slack-notify-failure + settings: + channel: grafana-backend-ops + template: 'Nightly docker image scan job for grafana/grafana:main failed: {{build.link}}' + webhook: + from_secret: slack_webhook_backend + when: + status: failure +trigger: + cron: nightly + event: cron +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker +- name: config + temp: {} --- -{"kind": "pipeline", "type": "docker", "platform": {"os": "linux", "arch": "amd64"}, "name": "scan-grafana/grafana:latest-ubuntu-image", "trigger": {"event": "cron", "cron": "nightly"}, "clone": {"retries": 3}, "steps": [{"name": "authenticate-gcr", "image": "docker:dind", "commands": ["echo $${GCR_CREDENTIALS} | docker login -u _json_key --password-stdin https://us.gcr.io"], "environment": {"GCR_CREDENTIALS": {"from_secret": "gcr_credentials"}}, "volumes": [{"name": "docker", "path": "/var/run/docker.sock"}, {"name": "config", "path": "/root/.docker/"}]}, {"name": "scan-unknown-low-medium-vulnerabilities", "image": "aquasec/trivy:0.21.0", "commands": ["trivy image --exit-code 0 --severity UNKNOWN,LOW,MEDIUM grafana/grafana:latest-ubuntu"], "depends_on": ["authenticate-gcr"], "volumes": [{"name": "docker", "path": "/var/run/docker.sock"}, {"name": "config", "path": "/root/.docker/"}]}, {"name": "scan-high-critical-vulnerabilities", "image": "aquasec/trivy:0.21.0", "commands": ["trivy image --exit-code 1 --severity HIGH,CRITICAL grafana/grafana:latest-ubuntu"], "depends_on": ["authenticate-gcr"], "environment": {"GOOGLE_APPLICATION_CREDENTIALS": {"from_secret": "gcr_credentials_json"}}, "volumes": [{"name": "docker", "path": "/var/run/docker.sock"}, {"name": "config", "path": "/root/.docker/"}]}, {"name": "slack-notify-failure", "image": "plugins/slack", "settings": {"webhook": {"from_secret": "slack_webhook_backend"}, "channel": "grafana-backend-ops", "template": "Nightly docker image scan job for grafana/grafana:latest-ubuntu failed: {{build.link}}"}, "when": {"status": "failure"}}], "volumes": [{"name": "docker", "host": {"path": "/var/run/docker.sock"}}, {"name": "config", "temp": {}}]} +clone: + retries: 3 +kind: pipeline +name: scan-grafana/grafana:latest-ubuntu-image +platform: + arch: amd64 + os: linux +steps: +- commands: + - echo $${GCR_CREDENTIALS} | docker login -u _json_key --password-stdin https://us.gcr.io + environment: + GCR_CREDENTIALS: + from_secret: gcr_credentials + image: docker:dind + name: authenticate-gcr + volumes: + - name: docker + path: /var/run/docker.sock + - name: config + path: /root/.docker/ +- commands: + - trivy image --exit-code 0 --severity UNKNOWN,LOW,MEDIUM grafana/grafana:latest-ubuntu + depends_on: + - authenticate-gcr + image: aquasec/trivy:0.21.0 + name: scan-unknown-low-medium-vulnerabilities + volumes: + - name: docker + path: /var/run/docker.sock + - name: config + path: /root/.docker/ +- commands: + - trivy image --exit-code 1 --severity HIGH,CRITICAL grafana/grafana:latest-ubuntu + depends_on: + - authenticate-gcr + environment: + GOOGLE_APPLICATION_CREDENTIALS: + from_secret: gcr_credentials_json + image: aquasec/trivy:0.21.0 + name: scan-high-critical-vulnerabilities + volumes: + - name: docker + path: /var/run/docker.sock + - name: config + path: /root/.docker/ +- image: plugins/slack + name: slack-notify-failure + settings: + channel: grafana-backend-ops + template: 'Nightly docker image scan job for grafana/grafana:latest-ubuntu failed: + {{build.link}}' + webhook: + from_secret: slack_webhook_backend + when: + status: failure +trigger: + cron: nightly + event: cron +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker +- name: config + temp: {} --- -{"kind": "pipeline", "type": "docker", "platform": {"os": "linux", "arch": "amd64"}, "name": "scan-grafana/grafana:main-ubuntu-image", "trigger": {"event": "cron", "cron": "nightly"}, "clone": {"retries": 3}, "steps": [{"name": "authenticate-gcr", "image": "docker:dind", "commands": ["echo $${GCR_CREDENTIALS} | docker login -u _json_key --password-stdin https://us.gcr.io"], "environment": {"GCR_CREDENTIALS": {"from_secret": "gcr_credentials"}}, "volumes": [{"name": "docker", "path": "/var/run/docker.sock"}, {"name": "config", "path": "/root/.docker/"}]}, {"name": "scan-unknown-low-medium-vulnerabilities", "image": "aquasec/trivy:0.21.0", "commands": ["trivy image --exit-code 0 --severity UNKNOWN,LOW,MEDIUM grafana/grafana:main-ubuntu"], "depends_on": ["authenticate-gcr"], "volumes": [{"name": "docker", "path": "/var/run/docker.sock"}, {"name": "config", "path": "/root/.docker/"}]}, {"name": "scan-high-critical-vulnerabilities", "image": "aquasec/trivy:0.21.0", "commands": ["trivy image --exit-code 1 --severity HIGH,CRITICAL grafana/grafana:main-ubuntu"], "depends_on": ["authenticate-gcr"], "environment": {"GOOGLE_APPLICATION_CREDENTIALS": {"from_secret": "gcr_credentials_json"}}, "volumes": [{"name": "docker", "path": "/var/run/docker.sock"}, {"name": "config", "path": "/root/.docker/"}]}, {"name": "slack-notify-failure", "image": "plugins/slack", "settings": {"webhook": {"from_secret": "slack_webhook_backend"}, "channel": "grafana-backend-ops", "template": "Nightly docker image scan job for grafana/grafana:main-ubuntu failed: {{build.link}}"}, "when": {"status": "failure"}}], "volumes": [{"name": "docker", "host": {"path": "/var/run/docker.sock"}}, {"name": "config", "temp": {}}]} +clone: + retries: 3 +kind: pipeline +name: scan-grafana/grafana:main-ubuntu-image +platform: + arch: amd64 + os: linux +steps: +- commands: + - echo $${GCR_CREDENTIALS} | docker login -u _json_key --password-stdin https://us.gcr.io + environment: + GCR_CREDENTIALS: + from_secret: gcr_credentials + image: docker:dind + name: authenticate-gcr + volumes: + - name: docker + path: /var/run/docker.sock + - name: config + path: /root/.docker/ +- commands: + - trivy image --exit-code 0 --severity UNKNOWN,LOW,MEDIUM grafana/grafana:main-ubuntu + depends_on: + - authenticate-gcr + image: aquasec/trivy:0.21.0 + name: scan-unknown-low-medium-vulnerabilities + volumes: + - name: docker + path: /var/run/docker.sock + - name: config + path: /root/.docker/ +- commands: + - trivy image --exit-code 1 --severity HIGH,CRITICAL grafana/grafana:main-ubuntu + depends_on: + - authenticate-gcr + environment: + GOOGLE_APPLICATION_CREDENTIALS: + from_secret: gcr_credentials_json + image: aquasec/trivy:0.21.0 + name: scan-high-critical-vulnerabilities + volumes: + - name: docker + path: /var/run/docker.sock + - name: config + path: /root/.docker/ +- image: plugins/slack + name: slack-notify-failure + settings: + channel: grafana-backend-ops + template: 'Nightly docker image scan job for grafana/grafana:main-ubuntu failed: + {{build.link}}' + webhook: + from_secret: slack_webhook_backend + when: + status: failure +trigger: + cron: nightly + event: cron +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker +- name: config + temp: {} --- -{"kind": "pipeline", "type": "docker", "platform": {"os": "linux", "arch": "amd64"}, "name": "scan-build-test-and-publish-docker-images", "trigger": {"event": "cron", "cron": "nightly"}, "clone": {"retries": 3}, "steps": [{"name": "authenticate-gcr", "image": "docker:dind", "commands": ["echo $${GCR_CREDENTIALS} | docker login -u _json_key --password-stdin https://us.gcr.io"], "environment": {"GCR_CREDENTIALS": {"from_secret": "gcr_credentials"}}, "volumes": [{"name": "docker", "path": "/var/run/docker.sock"}, {"name": "config", "path": "/root/.docker/"}]}, {"name": "scan-unknown-low-medium-vulnerabilities", "image": "aquasec/trivy:0.21.0", "commands": ["trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM docker:27-cli", "trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM alpine/git:2.40.1", "trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM golang:1.23.0-alpine", "trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM node:20.9.0-alpine", "trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM google/cloud-sdk:431.0.0", "trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM grafana/grafana-ci-deploy:1.3.3", "trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM alpine:3.19.1", "trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM ubuntu:22.04", "trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM byrnedo/alpine-curl:0.1.8", "trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM plugins/slack", "trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM python:3.8", "trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM postgres:12.3-alpine", "trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM us.gcr.io/kubernetes-dev/mimir:gotjosh-state-config-grafana-663a0ae78", "trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM mysql:5.7.39", "trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM mysql:8.0.32", "trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM redis:6.2.11-alpine", "trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM memcached:1.6.9-alpine", "trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM us.gcr.io/kubernetes-dev/package-publish:latest", "trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM osixia/openldap:1.4.0", "trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM grafana/drone-downstream", "trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM grafana/docker-puppeteer:1.1.0", "trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM grafana/docs-base:latest", "trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM cypress/included:13.1.0", "trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM jwilder/dockerize:0.6.1", "trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM koalaman/shellcheck:stable", "trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM rockylinux:9"], "depends_on": ["authenticate-gcr"], "volumes": [{"name": "docker", "path": "/var/run/docker.sock"}, {"name": "config", "path": "/root/.docker/"}]}, {"name": "scan-high-critical-vulnerabilities", "image": "aquasec/trivy:0.21.0", "commands": ["trivy --exit-code 1 --severity HIGH,CRITICAL docker:27-cli", "trivy --exit-code 1 --severity HIGH,CRITICAL alpine/git:2.40.1", "trivy --exit-code 1 --severity HIGH,CRITICAL golang:1.23.0-alpine", "trivy --exit-code 1 --severity HIGH,CRITICAL node:20.9.0-alpine", "trivy --exit-code 1 --severity HIGH,CRITICAL google/cloud-sdk:431.0.0", "trivy --exit-code 1 --severity HIGH,CRITICAL grafana/grafana-ci-deploy:1.3.3", "trivy --exit-code 1 --severity HIGH,CRITICAL alpine:3.19.1", "trivy --exit-code 1 --severity HIGH,CRITICAL ubuntu:22.04", "trivy --exit-code 1 --severity HIGH,CRITICAL byrnedo/alpine-curl:0.1.8", "trivy --exit-code 1 --severity HIGH,CRITICAL plugins/slack", "trivy --exit-code 1 --severity HIGH,CRITICAL python:3.8", "trivy --exit-code 1 --severity HIGH,CRITICAL postgres:12.3-alpine", "trivy --exit-code 1 --severity HIGH,CRITICAL us.gcr.io/kubernetes-dev/mimir:gotjosh-state-config-grafana-663a0ae78", "trivy --exit-code 1 --severity HIGH,CRITICAL mysql:5.7.39", "trivy --exit-code 1 --severity HIGH,CRITICAL mysql:8.0.32", "trivy --exit-code 1 --severity HIGH,CRITICAL redis:6.2.11-alpine", "trivy --exit-code 1 --severity HIGH,CRITICAL memcached:1.6.9-alpine", "trivy --exit-code 1 --severity HIGH,CRITICAL us.gcr.io/kubernetes-dev/package-publish:latest", "trivy --exit-code 1 --severity HIGH,CRITICAL osixia/openldap:1.4.0", "trivy --exit-code 1 --severity HIGH,CRITICAL grafana/drone-downstream", "trivy --exit-code 1 --severity HIGH,CRITICAL grafana/docker-puppeteer:1.1.0", "trivy --exit-code 1 --severity HIGH,CRITICAL grafana/docs-base:latest", "trivy --exit-code 1 --severity HIGH,CRITICAL cypress/included:13.1.0", "trivy --exit-code 1 --severity HIGH,CRITICAL jwilder/dockerize:0.6.1", "trivy --exit-code 1 --severity HIGH,CRITICAL koalaman/shellcheck:stable", "trivy --exit-code 1 --severity HIGH,CRITICAL rockylinux:9"], "depends_on": ["authenticate-gcr"], "environment": {"GOOGLE_APPLICATION_CREDENTIALS": {"from_secret": "gcr_credentials_json"}}, "volumes": [{"name": "docker", "path": "/var/run/docker.sock"}, {"name": "config", "path": "/root/.docker/"}]}, {"name": "slack-notify-failure", "image": "plugins/slack", "settings": {"webhook": {"from_secret": "slack_webhook_backend"}, "channel": "grafana-backend-ops", "template": "Nightly docker image scan job for build-images failed: {{build.link}}"}, "when": {"status": "failure"}}], "volumes": [{"name": "docker", "host": {"path": "/var/run/docker.sock"}}, {"name": "config", "temp": {}}]} +clone: + retries: 3 +kind: pipeline +name: scan-build-test-and-publish-docker-images +platform: + arch: amd64 + os: linux +steps: +- commands: + - echo $${GCR_CREDENTIALS} | docker login -u _json_key --password-stdin https://us.gcr.io + environment: + GCR_CREDENTIALS: + from_secret: gcr_credentials + image: docker:dind + name: authenticate-gcr + volumes: + - name: docker + path: /var/run/docker.sock + - name: config + path: /root/.docker/ +- commands: + - trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM docker:27-cli + - trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM alpine/git:2.40.1 + - trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM golang:1.22.5-alpine + - trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM node:20.9.0-alpine + - trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM google/cloud-sdk:431.0.0 + - trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM grafana/grafana-ci-deploy:1.3.3 + - trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM alpine:3.19.1 + - trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM ubuntu:22.04 + - trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM byrnedo/alpine-curl:0.1.8 + - trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM plugins/slack + - trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM python:3.8 + - trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM postgres:12.3-alpine + - trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM us.gcr.io/kubernetes-dev/mimir:gotjosh-state-config-grafana-663a0ae78 + - trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM mysql:5.7.39 + - trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM mysql:8.0.32 + - trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM redis:6.2.11-alpine + - trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM memcached:1.6.9-alpine + - trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM us.gcr.io/kubernetes-dev/package-publish:latest + - trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM osixia/openldap:1.4.0 + - trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM grafana/drone-downstream + - trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM grafana/docker-puppeteer:1.1.0 + - trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM grafana/docs-base:latest + - trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM cypress/included:13.1.0 + - trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM jwilder/dockerize:0.6.1 + - trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM koalaman/shellcheck:stable + - trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM rockylinux:9 + depends_on: + - authenticate-gcr + image: aquasec/trivy:0.21.0 + name: scan-unknown-low-medium-vulnerabilities + volumes: + - name: docker + path: /var/run/docker.sock + - name: config + path: /root/.docker/ +- commands: + - trivy --exit-code 1 --severity HIGH,CRITICAL docker:27-cli + - trivy --exit-code 1 --severity HIGH,CRITICAL alpine/git:2.40.1 + - trivy --exit-code 1 --severity HIGH,CRITICAL golang:1.22.5-alpine + - trivy --exit-code 1 --severity HIGH,CRITICAL node:20.9.0-alpine + - trivy --exit-code 1 --severity HIGH,CRITICAL google/cloud-sdk:431.0.0 + - trivy --exit-code 1 --severity HIGH,CRITICAL grafana/grafana-ci-deploy:1.3.3 + - trivy --exit-code 1 --severity HIGH,CRITICAL alpine:3.19.1 + - trivy --exit-code 1 --severity HIGH,CRITICAL ubuntu:22.04 + - trivy --exit-code 1 --severity HIGH,CRITICAL byrnedo/alpine-curl:0.1.8 + - trivy --exit-code 1 --severity HIGH,CRITICAL plugins/slack + - trivy --exit-code 1 --severity HIGH,CRITICAL python:3.8 + - trivy --exit-code 1 --severity HIGH,CRITICAL postgres:12.3-alpine + - trivy --exit-code 1 --severity HIGH,CRITICAL us.gcr.io/kubernetes-dev/mimir:gotjosh-state-config-grafana-663a0ae78 + - trivy --exit-code 1 --severity HIGH,CRITICAL mysql:5.7.39 + - trivy --exit-code 1 --severity HIGH,CRITICAL mysql:8.0.32 + - trivy --exit-code 1 --severity HIGH,CRITICAL redis:6.2.11-alpine + - trivy --exit-code 1 --severity HIGH,CRITICAL memcached:1.6.9-alpine + - trivy --exit-code 1 --severity HIGH,CRITICAL us.gcr.io/kubernetes-dev/package-publish:latest + - trivy --exit-code 1 --severity HIGH,CRITICAL osixia/openldap:1.4.0 + - trivy --exit-code 1 --severity HIGH,CRITICAL grafana/drone-downstream + - trivy --exit-code 1 --severity HIGH,CRITICAL grafana/docker-puppeteer:1.1.0 + - trivy --exit-code 1 --severity HIGH,CRITICAL grafana/docs-base:latest + - trivy --exit-code 1 --severity HIGH,CRITICAL cypress/included:13.1.0 + - trivy --exit-code 1 --severity HIGH,CRITICAL jwilder/dockerize:0.6.1 + - trivy --exit-code 1 --severity HIGH,CRITICAL koalaman/shellcheck:stable + - trivy --exit-code 1 --severity HIGH,CRITICAL rockylinux:9 + depends_on: + - authenticate-gcr + environment: + GOOGLE_APPLICATION_CREDENTIALS: + from_secret: gcr_credentials_json + image: aquasec/trivy:0.21.0 + name: scan-high-critical-vulnerabilities + volumes: + - name: docker + path: /var/run/docker.sock + - name: config + path: /root/.docker/ +- image: plugins/slack + name: slack-notify-failure + settings: + channel: grafana-backend-ops + template: 'Nightly docker image scan job for build-images failed: {{build.link}}' + webhook: + from_secret: slack_webhook_backend + when: + status: failure +trigger: + cron: nightly + event: cron +type: docker +volumes: +- host: + path: /var/run/docker.sock + name: docker +- name: config + temp: {} --- -{"kind": "secret", "name": "gcp_grafanauploads", "get": {"path": "infra/data/ci/grafana-release-eng/grafanauploads", "name": "credentials.json"}} +get: + name: credentials.json + path: infra/data/ci/grafana-release-eng/grafanauploads +kind: secret +name: gcp_grafanauploads --- -{"kind": "secret", "name": "gcp_grafanauploads_base64", "get": {"path": "infra/data/ci/grafana-release-eng/grafanauploads", "name": "credentials_base64"}} +get: + name: credentials_base64 + path: infra/data/ci/grafana-release-eng/grafanauploads +kind: secret +name: gcp_grafanauploads_base64 --- -{"kind": "secret", "name": "grafana_api_key", "get": {"path": "infra/data/ci/grafana-release-eng/grafanacom", "name": "api_key"}} +get: + name: api_key + path: infra/data/ci/grafana-release-eng/grafanacom +kind: secret +name: grafana_api_key --- -{"kind": "secret", "name": "gcr", "get": {"path": "secret/data/common/gcr", "name": ".dockerconfigjson"}} +get: + name: .dockerconfigjson + path: secret/data/common/gcr +kind: secret +name: gcr --- -{"kind": "secret", "name": "gar", "get": {"path": "secret/data/common/gar", "name": ".dockerconfigjson"}} +get: + name: .dockerconfigjson + path: secret/data/common/gar +kind: secret +name: gar --- -{"kind": "secret", "name": "github_token", "get": {"path": "infra/data/ci/github/grafanabot", "name": "pat"}} +get: + name: pat + path: infra/data/ci/github/grafanabot +kind: secret +name: github_token --- -{"kind": "secret", "name": "drone_token", "get": {"path": "infra/data/ci/drone", "name": "machine-user-token"}} +get: + name: machine-user-token + path: infra/data/ci/drone +kind: secret +name: drone_token --- -{"kind": "secret", "name": "prerelease_bucket", "get": {"path": "infra/data/ci/grafana/prerelease", "name": "bucket"}} +get: + name: bucket + path: infra/data/ci/grafana/prerelease +kind: secret +name: prerelease_bucket --- -{"kind": "secret", "name": "docker_username", "get": {"path": "infra/data/ci/grafanaci-docker-hub", "name": "username"}} +get: + name: username + path: infra/data/ci/grafanaci-docker-hub +kind: secret +name: docker_username --- -{"kind": "secret", "name": "docker_password", "get": {"path": "infra/data/ci/grafanaci-docker-hub", "name": "password"}} +get: + name: password + path: infra/data/ci/grafanaci-docker-hub +kind: secret +name: docker_password --- -{"kind": "secret", "name": "gcp_upload_artifacts_key", "get": {"path": "infra/data/ci/grafana/releng/artifacts-uploader-service-account", "name": "credentials.json"}} +get: + name: credentials.json + path: infra/data/ci/grafana/releng/artifacts-uploader-service-account +kind: secret +name: gcp_upload_artifacts_key --- -{"kind": "secret", "name": "gcp_download_build_container_assets_key", "get": {"path": "infra/data/ci/grafana/assets-downloader-build-container-service-account", "name": "credentials.json"}} +get: + name: credentials.json + path: infra/data/ci/grafana/assets-downloader-build-container-service-account +kind: secret +name: gcp_download_build_container_assets_key --- -{"kind": "secret", "name": "azure_sp_app_id", "get": {"path": "infra/data/ci/datasources/cpp-azure-resourcemanager-credentials", "name": "application_id"}} +get: + name: application_id + path: infra/data/ci/datasources/cpp-azure-resourcemanager-credentials +kind: secret +name: azure_sp_app_id --- -{"kind": "secret", "name": "azure_sp_app_pw", "get": {"path": "infra/data/ci/datasources/cpp-azure-resourcemanager-credentials", "name": "application_secret"}} +get: + name: application_secret + path: infra/data/ci/datasources/cpp-azure-resourcemanager-credentials +kind: secret +name: azure_sp_app_pw --- -{"kind": "secret", "name": "azure_tenant", "get": {"path": "infra/data/ci/datasources/cpp-azure-resourcemanager-credentials", "name": "tenant_id"}} +get: + name: tenant_id + path: infra/data/ci/datasources/cpp-azure-resourcemanager-credentials +kind: secret +name: azure_tenant --- -{"kind": "secret", "name": "npm_token", "get": {"path": "infra/data/ci/grafana-release-eng/npm", "name": "token"}} +get: + name: token + path: infra/data/ci/grafana-release-eng/npm +kind: secret +name: npm_token --- -{"kind": "secret", "name": "packages_gpg_public_key", "get": {"path": "infra/data/ci/packages-publish/gpg", "name": "public-key-b64"}} +get: + name: public-key-b64 + path: infra/data/ci/packages-publish/gpg +kind: secret +name: packages_gpg_public_key --- -{"kind": "secret", "name": "packages_gpg_private_key", "get": {"path": "infra/data/ci/packages-publish/gpg", "name": "private-key-b64"}} +get: + name: private-key-b64 + path: infra/data/ci/packages-publish/gpg +kind: secret +name: packages_gpg_private_key --- -{"kind": "secret", "name": "packages_gpg_passphrase", "get": {"path": "infra/data/ci/packages-publish/gpg", "name": "passphrase"}} +get: + name: passphrase + path: infra/data/ci/packages-publish/gpg +kind: secret +name: packages_gpg_passphrase --- -{"kind": "secret", "name": "packages_service_account", "get": {"path": "infra/data/ci/packages-publish/service-account", "name": "credentials.json"}} +get: + name: credentials.json + path: infra/data/ci/packages-publish/service-account +kind: secret +name: packages_service_account --- -{"kind": "secret", "name": "packages_access_key_id", "get": {"path": "infra/data/ci/packages-publish/bucket-credentials", "name": "AccessID"}} +get: + name: AccessID + path: infra/data/ci/packages-publish/bucket-credentials +kind: secret +name: packages_access_key_id --- -{"kind": "secret", "name": "packages_secret_access_key", "get": {"path": "infra/data/ci/packages-publish/bucket-credentials", "name": "Secret"}} +get: + name: Secret + path: infra/data/ci/packages-publish/bucket-credentials +kind: secret +name: packages_secret_access_key --- -{"kind": "secret", "name": "static_asset_editions", "get": {"path": "infra/data/ci/grafana-release-eng/artifact-publishing", "name": "static_asset_editions"}} +get: + name: static_asset_editions + path: infra/data/ci/grafana-release-eng/artifact-publishing +kind: secret +name: static_asset_editions --- -{"kind": "secret", "name": "gcp_key_base64", "get": {"path": "infra/data/ci/grafana-release-eng/rgm", "name": "gcp_service_account_prod_base64"}} +get: + name: gcp_service_account_prod_base64 + path: infra/data/ci/grafana-release-eng/rgm +kind: secret +name: gcp_key_base64 --- -{"kind": "secret", "name": "destination", "get": {"path": "infra/data/ci/grafana-release-eng/rgm", "name": "destination_prod"}} +get: + name: destination_prod + path: infra/data/ci/grafana-release-eng/rgm +kind: secret +name: destination --- -{"kind": "secret", "name": "rgm_storybook_destination", "get": {"path": "infra/data/ci/grafana-release-eng/rgm", "name": "storybook_destination"}} +get: + name: storybook_destination + path: infra/data/ci/grafana-release-eng/rgm +kind: secret +name: rgm_storybook_destination --- -{"kind": "secret", "name": "rgm_cdn_destination", "get": {"path": "infra/data/ci/grafana-release-eng/rgm", "name": "cdn_destination"}} +get: + name: cdn_destination + path: infra/data/ci/grafana-release-eng/rgm +kind: secret +name: rgm_cdn_destination --- -{"kind": "secret", "name": "rgm_downloads_destination", "get": {"path": "infra/data/ci/grafana-release-eng/rgm", "name": "downloads_destination"}} +get: + name: downloads_destination + path: infra/data/ci/grafana-release-eng/rgm +kind: secret +name: rgm_downloads_destination --- -{"kind": "secret", "name": "dagger_token", "get": {"path": "infra/data/ci/grafana-release-eng/rgm", "name": "dagger_token"}} +get: + name: dagger_token + path: infra/data/ci/grafana-release-eng/rgm +kind: secret +name: dagger_token --- -{"kind": "secret", "name": "delivery-bot-app-id", "get": {"path": "infra/data/ci/grafana-release-eng/grafana-delivery-bot", "name": "app-id"}} +get: + name: app-id + path: infra/data/ci/grafana-release-eng/grafana-delivery-bot +kind: secret +name: delivery-bot-app-id --- -{"kind": "secret", "name": "delivery-bot-app-installation-id", "get": {"path": "infra/data/ci/grafana-release-eng/grafana-delivery-bot", "name": "app-installation-id"}} +get: + name: app-installation-id + path: infra/data/ci/grafana-release-eng/grafana-delivery-bot +kind: secret +name: delivery-bot-app-installation-id --- -{"kind": "secret", "name": "delivery-bot-app-private-key", "get": {"path": "infra/data/ci/grafana-release-eng/grafana-delivery-bot", "name": "app-private-key"}} +get: + name: app-private-key + path: infra/data/ci/grafana-release-eng/grafana-delivery-bot +kind: secret +name: delivery-bot-app-private-key --- -{"kind": "secret", "name": "gcr_credentials", "get": {"path": "secret/data/common/gcr", "name": "service-account"}} +get: + name: service-account + path: secret/data/common/gcr +kind: secret +name: gcr_credentials +--- +kind: signature +hmac: 575ce271cc87b6db1ac6ce4962d97b67f842bfc656774c4065b0096ffbb93f12 + +... diff --git a/.golangci.toml b/.golangci.toml index 0ff9b67aef3..a363bf21c7a 100644 --- a/.golangci.toml +++ b/.golangci.toml @@ -79,13 +79,13 @@ enable = [ "goimports", "goprintffuncname", "gosec", - # "gosimple", # Disabled for security support branch to avoid breaking backports - # "govet", # Disabled for security support branch to avoid breaking backports + "gosimple", + "govet", "ineffassign", "misspell", "nakedret", "exportloopref", - # "staticcheck", # Disabled for security support branch to avoid breaking backports + "staticcheck", "stylecheck", "typecheck", "unconvert", diff --git a/Dockerfile b/Dockerfile index b07702d6cc2..453230c9d3c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ ARG BASE_IMAGE=alpine:3.19.1 ARG JS_IMAGE=node:20-alpine ARG JS_PLATFORM=linux/amd64 -ARG GO_IMAGE=golang:1.23.0-alpine +ARG GO_IMAGE=golang:1.21.10-alpine ARG GO_SRC=go-builder ARG JS_SRC=js-builder @@ -40,8 +40,8 @@ ARG BINGO="true" # Install build dependencies RUN if grep -i -q alpine /etc/issue; then \ - apk add --no-cache gcc g++ make git; \ - fi + apk add --no-cache gcc g++ make git; \ + fi WORKDIR /tmp/grafana @@ -53,9 +53,9 @@ COPY pkg/util/xorm/go.* pkg/util/xorm/ RUN go mod download RUN if [[ "$BINGO" = "true" ]]; then \ - go install github.com/bwplotka/bingo@latest && \ - bingo get -v; \ - fi + go install github.com/bwplotka/bingo@latest && \ + bingo get -v; \ + fi COPY embed.go Makefile build.go package.json ./ COPY cue.mod cue.mod @@ -99,74 +99,74 @@ ARG GF_UID="472" ARG GF_GID="0" ENV PATH="/usr/share/grafana/bin:$PATH" \ - GF_PATHS_CONFIG="/etc/grafana/grafana.ini" \ - GF_PATHS_DATA="/var/lib/grafana" \ - GF_PATHS_HOME="/usr/share/grafana" \ - GF_PATHS_LOGS="/var/log/grafana" \ - GF_PATHS_PLUGINS="/var/lib/grafana/plugins" \ - GF_PATHS_PROVISIONING="/etc/grafana/provisioning" + GF_PATHS_CONFIG="/etc/grafana/grafana.ini" \ + GF_PATHS_DATA="/var/lib/grafana" \ + GF_PATHS_HOME="/usr/share/grafana" \ + GF_PATHS_LOGS="/var/log/grafana" \ + GF_PATHS_PLUGINS="/var/lib/grafana/plugins" \ + GF_PATHS_PROVISIONING="/etc/grafana/provisioning" WORKDIR $GF_PATHS_HOME # Install dependencies RUN if grep -i -q alpine /etc/issue; then \ - apk add --no-cache ca-certificates bash curl tzdata musl-utils && \ - apk info -vv | sort; \ - elif grep -i -q ubuntu /etc/issue; then \ - DEBIAN_FRONTEND=noninteractive && \ - apt-get update && \ - apt-get install -y ca-certificates curl tzdata musl && \ - apt-get autoremove -y && \ - rm -rf /var/lib/apt/lists/*; \ - else \ - echo 'ERROR: Unsupported base image' && /bin/false; \ - fi + apk add --no-cache ca-certificates bash curl tzdata musl-utils && \ + apk info -vv | sort; \ + elif grep -i -q ubuntu /etc/issue; then \ + DEBIAN_FRONTEND=noninteractive && \ + apt-get update && \ + apt-get install -y ca-certificates curl tzdata musl && \ + apt-get autoremove -y && \ + rm -rf /var/lib/apt/lists/*; \ + else \ + echo 'ERROR: Unsupported base image' && /bin/false; \ + fi # glibc support for alpine x86_64 only RUN if grep -i -q alpine /etc/issue && [ `arch` = "x86_64" ]; then \ - wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \ - wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r0/glibc-2.35-r0.apk \ - -O /tmp/glibc-2.35-r0.apk && \ - wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r0/glibc-bin-2.35-r0.apk \ - -O /tmp/glibc-bin-2.35-r0.apk && \ - apk add --force-overwrite --no-cache /tmp/glibc-2.35-r0.apk /tmp/glibc-bin-2.35-r0.apk && \ - rm -f /lib64/ld-linux-x86-64.so.2 && \ - ln -s /usr/glibc-compat/lib64/ld-linux-x86-64.so.2 /lib64/ld-linux-x86-64.so.2 && \ - rm -f /tmp/glibc-2.35-r0.apk && \ - rm -f /tmp/glibc-bin-2.35-r0.apk && \ - rm -f /lib/ld-linux-x86-64.so.2 && \ - rm -f /etc/ld.so.cache; \ - fi + wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \ + wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r0/glibc-2.35-r0.apk \ + -O /tmp/glibc-2.35-r0.apk && \ + wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r0/glibc-bin-2.35-r0.apk \ + -O /tmp/glibc-bin-2.35-r0.apk && \ + apk add --force-overwrite --no-cache /tmp/glibc-2.35-r0.apk /tmp/glibc-bin-2.35-r0.apk && \ + rm -f /lib64/ld-linux-x86-64.so.2 && \ + ln -s /usr/glibc-compat/lib64/ld-linux-x86-64.so.2 /lib64/ld-linux-x86-64.so.2 && \ + rm -f /tmp/glibc-2.35-r0.apk && \ + rm -f /tmp/glibc-bin-2.35-r0.apk && \ + rm -f /lib/ld-linux-x86-64.so.2 && \ + rm -f /etc/ld.so.cache; \ + fi COPY --from=go-src /tmp/grafana/conf ./conf RUN if [ ! $(getent group "$GF_GID") ]; then \ - if grep -i -q alpine /etc/issue; then \ - addgroup -S -g $GF_GID grafana; \ - else \ - addgroup --system --gid $GF_GID grafana; \ - fi; \ - fi && \ - GF_GID_NAME=$(getent group $GF_GID | cut -d':' -f1) && \ - mkdir -p "$GF_PATHS_HOME/.aws" && \ - if grep -i -q alpine /etc/issue; then \ - adduser -S -u $GF_UID -G "$GF_GID_NAME" grafana; \ - else \ - adduser --system --uid $GF_UID --ingroup "$GF_GID_NAME" grafana; \ - fi && \ - mkdir -p "$GF_PATHS_PROVISIONING/datasources" \ - "$GF_PATHS_PROVISIONING/dashboards" \ - "$GF_PATHS_PROVISIONING/notifiers" \ - "$GF_PATHS_PROVISIONING/plugins" \ - "$GF_PATHS_PROVISIONING/access-control" \ - "$GF_PATHS_PROVISIONING/alerting" \ - "$GF_PATHS_LOGS" \ - "$GF_PATHS_PLUGINS" \ - "$GF_PATHS_DATA" && \ - cp conf/sample.ini "$GF_PATHS_CONFIG" && \ - cp conf/ldap.toml /etc/grafana/ldap.toml && \ - chown -R "grafana:$GF_GID_NAME" "$GF_PATHS_DATA" "$GF_PATHS_HOME/.aws" "$GF_PATHS_LOGS" "$GF_PATHS_PLUGINS" "$GF_PATHS_PROVISIONING" && \ - chmod -R 777 "$GF_PATHS_DATA" "$GF_PATHS_HOME/.aws" "$GF_PATHS_LOGS" "$GF_PATHS_PLUGINS" "$GF_PATHS_PROVISIONING" + if grep -i -q alpine /etc/issue; then \ + addgroup -S -g $GF_GID grafana; \ + else \ + addgroup --system --gid $GF_GID grafana; \ + fi; \ + fi && \ + GF_GID_NAME=$(getent group $GF_GID | cut -d':' -f1) && \ + mkdir -p "$GF_PATHS_HOME/.aws" && \ + if grep -i -q alpine /etc/issue; then \ + adduser -S -u $GF_UID -G "$GF_GID_NAME" grafana; \ + else \ + adduser --system --uid $GF_UID --ingroup "$GF_GID_NAME" grafana; \ + fi && \ + mkdir -p "$GF_PATHS_PROVISIONING/datasources" \ + "$GF_PATHS_PROVISIONING/dashboards" \ + "$GF_PATHS_PROVISIONING/notifiers" \ + "$GF_PATHS_PROVISIONING/plugins" \ + "$GF_PATHS_PROVISIONING/access-control" \ + "$GF_PATHS_PROVISIONING/alerting" \ + "$GF_PATHS_LOGS" \ + "$GF_PATHS_PLUGINS" \ + "$GF_PATHS_DATA" && \ + cp conf/sample.ini "$GF_PATHS_CONFIG" && \ + cp conf/ldap.toml /etc/grafana/ldap.toml && \ + chown -R "grafana:$GF_GID_NAME" "$GF_PATHS_DATA" "$GF_PATHS_HOME/.aws" "$GF_PATHS_LOGS" "$GF_PATHS_PLUGINS" "$GF_PATHS_PROVISIONING" && \ + chmod -R 777 "$GF_PATHS_DATA" "$GF_PATHS_HOME/.aws" "$GF_PATHS_LOGS" "$GF_PATHS_PLUGINS" "$GF_PATHS_PROVISIONING" COPY --from=go-src /tmp/grafana/bin/grafana* /tmp/grafana/bin/*/grafana* ./bin/ COPY --from=js-src /tmp/grafana/public ./public diff --git a/go.mod b/go.mod index 86bb4a2395f..ca6959c768c 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/grafana/grafana -go 1.23.0 +go 1.22.0 // Override docker/docker to avoid: // go: github.com/drone-runners/drone-runner-docker@v1.8.2 requires diff --git a/go.sum b/go.sum index 4a264ec2a45..9cf4f5b640e 100644 --- a/go.sum +++ b/go.sum @@ -844,7 +844,6 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v0.19.0/go.mod h1:h6H6c8enJmmocHUbL github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0/go.mod h1:ON4tFdPTwRcgWEaVDrN3584Ef+b7GgSJaXxe5fW9t4M= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.0/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.8.0 h1:9kDVnTz3vbfweTqAUmk/a/pH5pWFCHtvRpHYC0G/dcA= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.8.0/go.mod h1:3Ug6Qzto9anB6mGlEdgYMDF5zHQ+wwhEaYR4s17PHMw= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1 h1:E+OJmp2tPvt1W+amx48v1eqbjDYsgN+RzP4q16yV5eM= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1/go.mod h1:a6xsAQUZg+VsS3TJ05SRp524Hs4pZ/AeFSr5ENf0Yjo= @@ -852,7 +851,6 @@ github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.11.0/go.mod h1:HcM1YX14R7CJc github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0/go.mod h1:+6sju8gk8FRmSajX3Oz4G5Gm7P+mbqE9FVaXXFYTkCM= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0/go.mod h1:NBanQUfSWiWn3QEpWDTCU0IjBECKOYvl2R8xdRtMtiM= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0/go.mod h1:OQeznEEkTZ9OrhHJoDD8ZDq51FHgXjqtP9z6bEwBq9U= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0 h1:BMAjVKJM0U/CYF27gA0ZMmXGkOcvfFtD0oHVZ1TIPRI= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0/go.mod h1:1fXstnBMas5kzG+S3q8UoJcmyU6nUeunJcMDHcRYHhs= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 h1:tfLQ34V6F7tVSwoTf/4lH5sE0o6eCJuNDTmH09nDpbc= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0/go.mod h1:9kIvujWAA58nmPmWB1m23fyWic1kYZMxD9CxaWn4Qpg= @@ -860,7 +858,6 @@ github.com/Azure/azure-sdk-for-go/sdk/internal v0.7.0/go.mod h1:yqy467j36fJxcRV2 github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= github.com/Azure/azure-sdk-for-go/sdk/internal v1.1.2/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM= github.com/Azure/azure-sdk-for-go/sdk/internal v1.8.0 h1:jBQA3cKT4L2rWMpgE7Yt3Hwh2aUj8KXjIGLxjHeYNNo= github.com/Azure/azure-sdk-for-go/sdk/internal v1.8.0/go.mod h1:4OG6tQ9EOP/MT0NMjDlRzWoVFxfu9rN9B2X+tlSVktg= @@ -920,7 +917,6 @@ github.com/Azure/go-ntlmssp v0.0.0-20220621081337-cb9428e4ac1e/go.mod h1:chxPXzS github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= github.com/AzureAD/microsoft-authentication-library-for-go v0.7.0/go.mod h1:BDJ5qMFKx9DugEg3+uQSDCdbYPr5s9vBTrL9P8TpqOU= github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= -github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1 h1:WpB/QDNLpMw72xHJc34BNNykqSOeEJDAWkhf0u12/Jk= github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU= github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= @@ -1294,7 +1290,6 @@ github.com/dimchansky/utfbom v1.1.1/go.mod h1:SxdoEBH5qIqFocHMyGOXVAybYJdr71b1Q/ github.com/dlmiddlecote/sqlstats v1.0.2 h1:gSU11YN23D/iY50A2zVYwgXgy072khatTsIW6UPjUtI= github.com/dlmiddlecote/sqlstats v1.0.2/go.mod h1:0CWaIh/Th+z2aI6Q9Jpfg/o21zmGxWhbByHgQSCUQvY= github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= -github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= github.com/docker/distribution v2.7.0+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= @@ -2474,7 +2469,6 @@ github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4 github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA= github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= diff --git a/go.work b/go.work index 9a7ca52d84d..c15c09cf921 100644 --- a/go.work +++ b/go.work @@ -1,4 +1,4 @@ -go 1.23.0 +go 1.22.0 use ( . diff --git a/pkg/build/go.mod b/pkg/build/go.mod index 2eba9c24f08..b0fb510f67a 100644 --- a/pkg/build/go.mod +++ b/pkg/build/go.mod @@ -1,8 +1,8 @@ module github.com/grafana/grafana/pkg/build -go 1.23 +go 1.22 -toolchain go1.23.0 +toolchain go1.22.5 // Override docker/docker to avoid: // go: github.com/drone-runners/drone-runner-docker@v1.8.2 requires diff --git a/pkg/util/xorm/go.mod b/pkg/util/xorm/go.mod index 8862d49a2aa..78f85ed97f7 100644 --- a/pkg/util/xorm/go.mod +++ b/pkg/util/xorm/go.mod @@ -1,6 +1,6 @@ module github.com/grafana/grafana/pkg/util/xorm -go 1.23 +go 1.21 require ( github.com/mattn/go-sqlite3 v1.14.19 diff --git a/public/api-enterprise-spec.json b/public/api-enterprise-spec.json index f9428773c07..6dc7834b4d2 100644 --- a/public/api-enterprise-spec.json +++ b/public/api-enterprise-spec.json @@ -2934,7 +2934,7 @@ "description": "Policies contains all policy identifiers included in the certificate.\nIn Go 1.22, encoding/gob cannot handle and ignores this field.", "type": "array", "items": { - "type": "string" + "$ref": "#/definitions/OID" } }, "PolicyIdentifiers": { @@ -5289,6 +5289,10 @@ } } }, + "OID": { + "type": "object", + "title": "An OID represents an ASN.1 OBJECT IDENTIFIER." + }, "ObjectIdentifier": { "type": "array", "title": "An ObjectIdentifier represents an ASN.1 OBJECT IDENTIFIER.", diff --git a/public/api-merged.json b/public/api-merged.json index 5a75403fb5e..a7006b13678 100644 --- a/public/api-merged.json +++ b/public/api-merged.json @@ -13014,7 +13014,7 @@ "description": "Policies contains all policy identifiers included in the certificate.\nIn Go 1.22, encoding/gob cannot handle and ignores this field.", "type": "array", "items": { - "type": "string" + "$ref": "#/definitions/OID" } }, "PolicyIdentifiers": { @@ -16672,6 +16672,10 @@ } } }, + "OID": { + "type": "object", + "title": "An OID represents an ASN.1 OBJECT IDENTIFIER." + }, "ObjectIdentifier": { "type": "array", "title": "An ObjectIdentifier represents an ASN.1 OBJECT IDENTIFIER.", diff --git a/public/openapi3.json b/public/openapi3.json index 738449ee807..39e2e3f566e 100644 --- a/public/openapi3.json +++ b/public/openapi3.json @@ -3560,7 +3560,7 @@ "Policies": { "description": "Policies contains all policy identifiers included in the certificate.\nIn Go 1.22, encoding/gob cannot handle and ignores this field.", "items": { - "type": "string" + "$ref": "#/components/schemas/OID" }, "type": "array" }, @@ -7221,6 +7221,10 @@ "title": "OAuth2 is the oauth2 client configuration.", "type": "object" }, + "OID": { + "title": "An OID represents an ASN.1 OBJECT IDENTIFIER.", + "type": "object" + }, "ObjectIdentifier": { "items": { "format": "int64", diff --git a/scripts/drone/variables.star b/scripts/drone/variables.star index 6dcc72a7a1b..0becfd2ce91 100644 --- a/scripts/drone/variables.star +++ b/scripts/drone/variables.star @@ -3,7 +3,7 @@ global variables """ grabpl_version = "v3.0.50" -golang_version = "1.23.0" +golang_version = "1.22.5" # nodejs_version should match what's in ".nvmrc", but without the v prefix. nodejs_version = "20.9.0"