diff --git a/scripts/verify-repo-update/Dockerfile.deb b/scripts/verify-repo-update/Dockerfile.deb new file mode 100644 index 00000000000..3fa5d0649a3 --- /dev/null +++ b/scripts/verify-repo-update/Dockerfile.deb @@ -0,0 +1,16 @@ +FROM ubuntu + +ARG REPO_CONFIG=grafana.list.oss +ARG PACKAGE=grafana + +COPY sources.list /etc/apt/sources.list +RUN apt update && \ + apt install -y curl \ + apt-transport-https \ + ca-certificates \ + gnupg && \ + curl https://packages.grafana.com/gpg.key | apt-key add - + +COPY "./$REPO_CONFIG" /etc/apt/sources.list.d/grafana.list +RUN apt update && \ + apt install -y $PACKAGE diff --git a/scripts/verify-repo-update/Dockerfile.rpm b/scripts/verify-repo-update/Dockerfile.rpm new file mode 100644 index 00000000000..92c8448af9d --- /dev/null +++ b/scripts/verify-repo-update/Dockerfile.rpm @@ -0,0 +1,8 @@ +FROM centos + +ARG REPO_CONFIG=grafana.repo.oss +ARG PACKAGE=grafana + +COPY "./$REPO_CONFIG" /etc/yum.repos.d/grafana.repo + +RUN yum install -y $PACKAGE diff --git a/scripts/verify-repo-update/deb-ee-beta.list b/scripts/verify-repo-update/deb-ee-beta.list new file mode 100644 index 00000000000..1b6406fe112 --- /dev/null +++ b/scripts/verify-repo-update/deb-ee-beta.list @@ -0,0 +1 @@ +deb https://packages.grafana.com/enterprise/deb beta main diff --git a/scripts/verify-repo-update/deb-ee-stable.list b/scripts/verify-repo-update/deb-ee-stable.list new file mode 100644 index 00000000000..0e31d8fec78 --- /dev/null +++ b/scripts/verify-repo-update/deb-ee-stable.list @@ -0,0 +1 @@ +deb https://packages.grafana.com/enterprise/deb stable main diff --git a/scripts/verify-repo-update/deb-oss-beta.list b/scripts/verify-repo-update/deb-oss-beta.list new file mode 100644 index 00000000000..ca2f282cf51 --- /dev/null +++ b/scripts/verify-repo-update/deb-oss-beta.list @@ -0,0 +1 @@ +deb https://packages.grafana.com/oss/deb beta main diff --git a/scripts/verify-repo-update/deb-oss-stable.list b/scripts/verify-repo-update/deb-oss-stable.list new file mode 100644 index 00000000000..adbad20be5b --- /dev/null +++ b/scripts/verify-repo-update/deb-oss-stable.list @@ -0,0 +1 @@ +deb https://packages.grafana.com/oss/deb stable main diff --git a/scripts/verify-repo-update/rpm-ee-beta.list b/scripts/verify-repo-update/rpm-ee-beta.list new file mode 100644 index 00000000000..7f2c2a0f743 --- /dev/null +++ b/scripts/verify-repo-update/rpm-ee-beta.list @@ -0,0 +1,9 @@ +[grafana] +name=grafana +baseurl=https://packages.grafana.com/enterprise/rpm-beta +repo_gpgcheck=1 +enabled=1 +gpgcheck=1 +gpgkey=https://packages.grafana.com/gpg.key +sslverify=1 +sslcacert=/etc/pki/tls/certs/ca-bundle.crt diff --git a/scripts/verify-repo-update/rpm-ee-stable.list b/scripts/verify-repo-update/rpm-ee-stable.list new file mode 100644 index 00000000000..4da5903b27f --- /dev/null +++ b/scripts/verify-repo-update/rpm-ee-stable.list @@ -0,0 +1,9 @@ +[grafana] +name=grafana +baseurl=https://packages.grafana.com/enterprise/rpm +repo_gpgcheck=1 +enabled=1 +gpgcheck=1 +gpgkey=https://packages.grafana.com/gpg.key +sslverify=1 +sslcacert=/etc/pki/tls/certs/ca-bundle.crt diff --git a/scripts/verify-repo-update/rpm-oss-beta.list b/scripts/verify-repo-update/rpm-oss-beta.list new file mode 100644 index 00000000000..980c5cb2bdd --- /dev/null +++ b/scripts/verify-repo-update/rpm-oss-beta.list @@ -0,0 +1,9 @@ +[grafana] +name=grafana +baseurl=https://packages.grafana.com/oss/rpm-beta +repo_gpgcheck=1 +enabled=1 +gpgcheck=1 +gpgkey=https://packages.grafana.com/gpg.key +sslverify=1 +sslcacert=/etc/pki/tls/certs/ca-bundle.crt diff --git a/scripts/verify-repo-update/rpm-oss-stable.list b/scripts/verify-repo-update/rpm-oss-stable.list new file mode 100644 index 00000000000..f4b6f1f3f11 --- /dev/null +++ b/scripts/verify-repo-update/rpm-oss-stable.list @@ -0,0 +1,9 @@ +[grafana] +name=grafana +baseurl=https://packages.grafana.com/oss/rpm +repo_gpgcheck=1 +enabled=1 +gpgcheck=1 +gpgkey=https://packages.grafana.com/gpg.key +sslverify=1 +sslcacert=/etc/pki/tls/certs/ca-bundle.crt diff --git a/scripts/verify-repo-update/sources.list b/scripts/verify-repo-update/sources.list new file mode 100644 index 00000000000..ca786231ec8 --- /dev/null +++ b/scripts/verify-repo-update/sources.list @@ -0,0 +1,49 @@ +# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to +# newer versions of the distribution. +deb http://ubuntu.mirror.su.se/ubuntu/ bionic main restricted +# deb-src http://ubuntu.mirror.su.se/ubuntu/ bionic main restricted + +## Major bug fix updates produced after the final release of the +## distribution. +deb http://ubuntu.mirror.su.se/ubuntu/ bionic-updates main restricted +# deb-src http://ubuntu.mirror.su.se/ubuntu/ bionic-updates main restricted + +## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu +## team. Also, please note that software in universe WILL NOT receive any +## review or updates from the Ubuntu security team. +deb http://ubuntu.mirror.su.se/ubuntu/ bionic universe +# deb-src http://ubuntu.mirror.su.se/ubuntu/ bionic universe +deb http://ubuntu.mirror.su.se/ubuntu/ bionic-updates universe +# deb-src http://ubuntu.mirror.su.se/ubuntu/ bionic-updates universe + +## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu +## team, and may not be under a free licence. Please satisfy yourself as to +## your rights to use the software. Also, please note that software in +## multiverse WILL NOT receive any review or updates from the Ubuntu +## security team. +deb http://ubuntu.mirror.su.se/ubuntu/ bionic multiverse +# deb-src http://ubuntu.mirror.su.se/ubuntu/ bionic multiverse +deb http://ubuntu.mirror.su.se/ubuntu/ bionic-updates multiverse +# deb-src http://ubuntu.mirror.su.se/ubuntu/ bionic-updates multiverse + +## N.B. software from this repository may not have been tested as +## extensively as that contained in the main release, although it includes +## newer versions of some applications which may provide useful features. +## Also, please note that software in backports WILL NOT receive any review +## or updates from the Ubuntu security team. +deb http://ubuntu.mirror.su.se/ubuntu/ bionic-backports main restricted universe multiverse +# deb-src http://ubuntu.mirror.su.se/ubuntu/ bionic-backports main restricted universe multiverse + +## Uncomment the following two lines to add software from Canonical's +## 'partner' repository. +## This software is not part of Ubuntu, but is offered by Canonical and the +## respective vendors as a service to Ubuntu users. +# deb http://archive.canonical.com/ubuntu bionic partner +# deb-src http://archive.canonical.com/ubuntu bionic partner + +deb http://security.ubuntu.com/ubuntu/ bionic-security main restricted +# deb-src http://security.ubuntu.com/ubuntu/ bionic-security main restricted +deb http://security.ubuntu.com/ubuntu/ bionic-security universe +# deb-src http://security.ubuntu.com/ubuntu/ bionic-security universe +deb http://security.ubuntu.com/ubuntu/ bionic-security multiverse +# deb-src http://security.ubuntu.com/ubuntu/ bionic-security multiverse diff --git a/scripts/verify-repo-update/verify-repos.sh b/scripts/verify-repo-update/verify-repos.sh new file mode 100755 index 00000000000..f702ce1170f --- /dev/null +++ b/scripts/verify-repo-update/verify-repos.sh @@ -0,0 +1,54 @@ +#!/usr/bin/env bash + +docker_build () { + dockerfile=$1 + repo_file=$2 + package=$3 + tag=$4 + + docker build -f $dockerfile \ + --build-arg "REPO_CONFIG=$repo_file" \ + --build-arg "PACKAGE=$package" \ + --tag $tag \ + --no-cache \ + . + + retval=$(docker run --rm $tag cat /usr/share/grafana/VERSION) +} + +CHECK_BETA=$1 +if [ $CHECK_BETA == "beta" ]; then + # Testing deb repos + docker_build "Dockerfile.deb" "deb-oss-beta.list" "grafana" "gf-oss-deb-repo-test" + _oss_deb_v=$retval + + docker_build "Dockerfile.deb" "deb-ee-beta.list" "grafana-enterprise" "gf-ee-deb-repo-test" + _ee_deb_v=$retval + + # Testing rpm repos + docker_build "Dockerfile.rpm" "rpm-oss-beta.list" "grafana" "gf-oss-rpm-repo-test" + _oss_rpm_v=$retval + + docker_build "Dockerfile.rpm" "rpm-ee-beta.list" "grafana-enterprise" "gf-ee-rpm-repo-test" + _ee_rpm_v=$retval +else + # Testing deb repos + docker_build "Dockerfile.deb" "deb-oss-stable.list" "grafana" "gf-oss-deb-repo-test" + _oss_deb_v=$retval + + docker_build "Dockerfile.deb" "deb-ee-stable.list" "grafana-enterprise" "gf-ee-deb-repo-test" + _ee_deb_v=$retval + + # Testing rpm repos + docker_build "Dockerfile.rpm" "rpm-oss-stable.list" "grafana" "gf-oss-rpm-repo-test" + _oss_rpm_v=$retval + + docker_build "Dockerfile.rpm" "rpm-ee-stable.list" "grafana-enterprise" "gf-ee-rpm-repo-test" + _ee_rpm_v=$retval +fi + +echo Versions: +echo OSS deb = ${_oss_deb_v} +echo EE deb = ${_ee_deb_v} +echo OSS rpm = ${_oss_rpm_v} +echo EE rpm = ${_ee_rpm_v}