Commit 7799dd84 by Arve Knudsen Committed by GitHub

Chore: Upgrade to Go 1.14 (#23371)

* Chore: Upgrade to Go 1.14
* Chore: Bump version of grafana/grafana-ci-deploy Docker image
* Chore: Fix/bump version of grafana/build-container Docker image
* CircleCI: Upgrade build Docker images
parent bd276475
[run]
init_cmds = [
["go", "run", "-mod=vendor", "build.go", "-dev", "build-cli"],
["go", "run", "-mod=vendor", "build.go", "-dev", "build-server"],
["./bin/grafana-server", "-packaging=dev", "cfg:app_mode=development"]
["go", "run", "build.go", "-dev", "build-cli"],
["go", "run", "build.go", "-dev", "build-server"],
["./bin/grafana-server", "-packaging=dev", "cfg:app_mode=development"]
]
watch_all = true
follow_symlinks = true
watch_dirs = [
"$WORKDIR/pkg",
"$WORKDIR/public/views",
"$WORKDIR/conf",
"$WORKDIR/pkg",
"$WORKDIR/public/views",
"$WORKDIR/conf",
]
watch_exts = [".go", ".ini", ".toml", ".template.html"]
build_delay = 1500
cmds = [
["go", "run", "-mod=vendor", "build.go", "-dev", "build-server"],
["./bin/grafana-server", "-packaging=dev", "cfg:app_mode=development"]
["go", "run", "build.go", "-dev", "build-server"],
["./bin/grafana-server", "-packaging=dev", "cfg:app_mode=development"]
]
......@@ -35,10 +35,10 @@ executors:
- image: cimg/go:1.14
grafana-build:
docker:
- image: grafana/build-container:1.2.13
- image: grafana/build-container:1.2.14
grafana-publish:
docker:
- image: grafana/grafana-ci-deploy:1.2.4
- image: grafana/grafana-ci-deploy:1.2.5
windows-installer:
docker:
- image: grafana/wix-toolset-ci:v3
......@@ -789,8 +789,7 @@ jobs:
when: on_success
build-docs-website:
docker:
- image: grafana/build-container:1.2.13
executor: grafana-build
working_directory: /docs
steps:
- checkout
......
# Golang build container
FROM golang:1.13.4-alpine
FROM golang:1.14.1-alpine
RUN apk add --no-cache gcc g++
......
FROM golang:1.13.4 AS go-builder
FROM golang:1.14.1 AS go-builder
WORKDIR /src/grafana
......
# This Dockerfile builds an image for a client_golang example.
# Builder image, where we build the example.
FROM golang:1.13.4 AS builder
FROM golang:1.14.1 AS builder
# Download prometheus/client_golang/examples/random first
RUN go get github.com/prometheus/client_golang/examples/random
WORKDIR /go/src/github.com/prometheus/client_golang
......
module github.com/grafana/grafana
go 1.13
go 1.14
require (
cloud.google.com/go v0.38.0 // indirect
......
FROM ubuntu:18.04 as toolchain
ENV OSX_SDK_URL=https://s3.dockerproject.org/darwin/v2/ \
ENV OSX_SDK_URL=https://s3.dockerproject.org/darwin/v2 \
OSX_SDK=MacOSX10.10.sdk \
OSX_MIN=10.10 \
CTNG=1.24.0 \
......@@ -42,19 +42,18 @@ RUN apt-get update && \
xz-utils \
lzma-dev
RUN git clone https://github.com/tpoechtrager/osxcross.git /tmp/osxcross && \
cd /tmp/osxcross && git reset --hard $OSX_CROSS_REV && \
curl -L ${OSX_SDK_URL}/${OSX_SDK}.tar.xz -o /tmp/osxcross/tarballs/${OSX_SDK}.tar.xz && \
ln -s /usr/bin/llvm-dsymutil-6.0 /usr/bin/dsymutil
cd /tmp/osxcross && git reset --hard $OSX_CROSS_REV
RUN curl -fL ${OSX_SDK_URL}/${OSX_SDK}.tar.xz -o /tmp/osxcross/tarballs/${OSX_SDK}.tar.xz
RUN ln -s /usr/bin/llvm-dsymutil-6.0 /usr/bin/dsymutil
RUN UNATTENDED=yes OSX_VERSION_MIN=${OSX_MIN} /tmp/osxcross/build.sh
RUN rm -rf /tmp/osxcross/target/SDK/${OSX_SDK}/usr/share && \
cd /tmp && \
tar cfJ osxcross.tar.xz osxcross/target && \
rm -rf /tmp/osxcross && \
apt-get install -y \
unzip libtool-bin bison curl flex gawk gcc g++ gperf help2man libncurses5-dev make patch python-dev texinfo xz-utils && \
curl -L http://crosstool-ng.org/download/crosstool-ng/crosstool-ng-${CTNG}.tar.xz \
| tar -xJ -C /tmp/ && \
cd /tmp/crosstool-ng-${CTNG} && \
rm -rf /tmp/osxcross
RUN apt-get install -y \
unzip libtool-bin bison flex gawk gcc g++ gperf help2man libncurses5-dev make patch python-dev texinfo xz-utils
RUN curl -fL http://crosstool-ng.org/download/crosstool-ng/crosstool-ng-${CTNG}.tar.xz | tar -xJ -C /tmp/
RUN cd /tmp/crosstool-ng-${CTNG} && \
./configure --enable-local && \
make && \
./ct-ng x86_64-centos6-linux-gnu && \
......@@ -63,8 +62,8 @@ RUN rm -rf /tmp/osxcross/target/SDK/${OSX_SDK}/usr/share && \
echo 'CT_EXPERIMENTAL=y' >> .config && \
echo 'CT_ALLOW_BUILD_AS_ROOT=y' >> .config && \
echo 'CT_ALLOW_BUILD_AS_ROOT_SURE=y' >> .config && \
./ct-ng build && \
cd /tmp && \
./ct-ng build
RUN cd /tmp && \
rm /tmp/x86_64-centos6-linux-gnu/build.log.bz2 && \
tar cfJ x86_64-centos6-linux-gnu.tar.xz x86_64-centos6-linux-gnu/ && \
rm -rf /tmp/x86_64-centos6-linux-gnu/ && \
......@@ -73,7 +72,7 @@ RUN rm -rf /tmp/osxcross/target/SDK/${OSX_SDK}/usr/share && \
# base image to crossbuild grafana
FROM ubuntu:18.04
ENV GOVERSION=1.13.4 \
ENV GOVERSION=1.14.1 \
PATH=/usr/local/go/bin:$PATH \
GOPATH=/go \
NODEVERSION=12.13.0
......@@ -100,38 +99,38 @@ RUN apt-get update && \
gnupg2 \
unzip && \
ln -s /usr/bin/llvm-dsymutil-6.0 /usr/bin/dsymutil && \
curl -L https://nodejs.org/dist/v${NODEVERSION}/node-v${NODEVERSION}-linux-x64.tar.xz \
curl -fL https://nodejs.org/dist/v${NODEVERSION}/node-v${NODEVERSION}-linux-x64.tar.xz \
| tar -xJ --strip-components=1 -C /usr/local && \
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
curl -fsS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo "deb [arch=amd64] https://dl.yarnpkg.com/debian/ stable main" \
| tee /etc/apt/sources.list.d/yarn.list && \
apt-get update && apt-get install -yq --no-install-recommends yarn && \
curl -L https://storage.googleapis.com/golang/go${GOVERSION}.linux-amd64.tar.gz \
curl -fL https://storage.googleapis.com/golang/go${GOVERSION}.linux-amd64.tar.gz \
| tar -xz -C /usr/local && \
git clone https://github.com/raspberrypi/tools.git /opt/rpi-tools --depth=1
ARG CHKSUM_ARMV7_MUSL=1b52816ac68d85de19c5248636034105440ea46708062a92cf8f8438fcce70269d44e30b7b39b67e4816db5178e5df9c32000aadd19a43e0ac42cfeac36f72c0
ARG CHKSUM_ARMV8_MUSL=54f49ee7ee828a31687d915a0b94cf2e70d79f6b942e2ebfca973beaabdfb035f441921b4c16d5bdce66f3acc902d17b54bb9ebefa12d06c1c6c448435276ae8
ARG CHKSUM_AMD64_MUSL=f7bcb35b4db01c8e1bd65c9e6dc9bc9681dae1e32d00ca094f91f95cad9799ea3251e01c69148f1547fdbf476d7ae1ba5ebf8da8c87cd073e04e0d3c127743e5
ARG CHKSUM_ARMV7_MUSL=5c833e744ee1b8f644e9cb34d0219d5cebcb70cf89e9bf996ae846577f7d96da696dce34fbe6ef3888a70842182195e9308838eaec9107ab660addf952e134bf
ARG CHKSUM_ARMV8_MUSL=50f4899cc2f637dbc39470bbe307074ccf7f40da2ab730218d13a9f75d578266311db6a0785919dcdcb5e7ce4517b13ee8d4a56d76e6fca7c6d4c2510d71aa8b
ARG CHKSUM_AMD64_MUSL=493a79e9e29a1eab3fdff6435bac6509253d2e54ac30ad9098ce5da638bbb8ad18a7ebf3520bcaf2f9588befeff23402d8bbf54fa3809bfe18c984a4ecabcb12
# Install musl cross compilers
RUN cd /tmp && \
curl -fO https://musl.cc/arm-linux-musleabihf-cross.tgz && \
curl -fLO https://grafana-downloads.storage.googleapis.com/compilers/arm-linux-musleabihf-cross.tgz && \
([ "$(sha512sum arm-linux-musleabihf-cross.tgz|cut -f1 -d ' ')" = "$CHKSUM_ARMV7_MUSL" ] || (echo "Mismatching checksums armv7"; exit 1)) && \
tar xf arm-linux-musleabihf-cross.tgz && \
rm arm-linux-musleabihf-cross.tgz && \
curl -fO https://musl.cc/aarch64-linux-musl-cross.tgz && \
curl -fLO https://grafana-downloads.storage.googleapis.com/compilers/aarch64-linux-musl-cross.tgz && \
([ "$(sha512sum aarch64-linux-musl-cross.tgz|cut -f1 -d ' ')" = "$CHKSUM_ARMV8_MUSL" ] || (echo "Mismatching checksums armv8"; exit 1)) && \
tar xf aarch64-linux-musl-cross.tgz && \
rm aarch64-linux-musl-cross.tgz && \
curl -fO https://musl.cc/x86_64-linux-musl-cross.tgz && \
curl -fLO https://grafana-downloads.storage.googleapis.com/compilers/x86_64-linux-musl-cross.tgz && \
([ "$(sha512sum x86_64-linux-musl-cross.tgz|cut -f1 -d ' ')" = "$CHKSUM_AMD64_MUSL" ] || (echo "Mismatching checksums amd64"; exit 1)) && \
tar xf x86_64-linux-musl-cross.tgz && \
rm x86_64-linux-musl-cross.tgz
RUN apt-get install -yq gcc libc-dev make && \
gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB && \
curl -sSL https://get.rvm.io | bash -s stable && \
curl -fsSL https://get.rvm.io | bash -s stable && \
/bin/bash -l -c "rvm requirements && rvm install 2.2 && gem install -N fpm"
COPY ./bootstrap.sh /tmp/bootstrap.sh
#!/bin/bash
set -eo pipefail
_version="1.2.13"
_version="1.2.14"
_tag="grafana/build-container:${_version}"
_dpath=$(dirname "${BASH_SOURCE[0]}")
......
FROM circleci/golang:1.13
FROM cimg/go:1.14
RUN git clone https://github.com/aptly-dev/aptly $GOPATH/src/github.com/aptly-dev/aptly && \
cd $GOPATH/src/github.com/aptly-dev/aptly && \
RUN git clone https://github.com/aptly-dev/aptly $GOPATH/src/github.com/aptly-dev/aptly
RUN cd $GOPATH/src/github.com/aptly-dev/aptly && \
# pin aptly to a specific commit after 1.3.0 that contains gpg2 support
git reset --hard a64807efdaf5e380bfa878c71bc88eae10d62be1 && \
make install
......@@ -22,6 +22,6 @@ RUN pip install -U awscli crcmod && \
mkdir -p /deb-repo /rpm-repo && \
chown circleci:circleci /deb-repo /rpm-repo
COPY --from=0 /go/bin/aptly /usr/local/bin/aptly
COPY --from=0 /home/circleci/go/bin/aptly /usr/local/bin/aptly
USER circleci
#!/bin/bash
_version="1.2.4"
_version="1.2.5"
_tag="grafana/grafana-ci-deploy:${_version}"
docker build -t $_tag .
......
......@@ -7,7 +7,7 @@ clone_folder: c:\gopath\src\github.com\grafana\grafana
environment:
nodejs_version: "12"
GOPATH: C:\gopath
GOVERSION: 1.13.4
GOVERSION: 1.14.1
install:
- rmdir c:\go /s /q
......
......@@ -3,9 +3,6 @@
# shellcheck source=./scripts/helpers/exit-if-fail.sh
source "$(dirname "$0")/helpers/exit-if-fail.sh"
# use vendor folder for packages
export GOFLAGS=-mod=vendor
echo "building backend with install to cache pkgs"
exit_if_fail time go install ./pkg/cmd/grafana-server
......
module github.com/grafana/grafana/scripts/go
go 1.13
go 1.14
require (
github.com/golangci/golangci-lint v1.24.0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment