Commit 4e547980 by Leonard Gram Committed by GitHub

build: Script to check that our repos work and what the latest package version is (#16350)

* build: Easy version check of deb & rpm repos
parent 2e59166d
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
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
deb https://packages.grafana.com/enterprise/deb beta main
deb https://packages.grafana.com/enterprise/deb stable main
deb https://packages.grafana.com/oss/deb beta main
deb https://packages.grafana.com/oss/deb stable main
[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
[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
[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
[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
# 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
#!/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}
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