Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
carles-grafana committed Jan 3, 2025
1 parent 6362a33 commit 7456a8f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 56 deletions.
18 changes: 5 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,25 +40,17 @@ jobs:

- name: test deb package
run: |
ls -l ./dist
docker run --name debcontainer -it --detach jrei/systemd-debian:12 /bin/sh
docker cp ./dist/tempo_*_linux_amd64.deb debcontainer:.
docker cp ./tools/packaging/wait-for-ready.sh debcontainer:.
docker exec debcontainer dpkg -i ./dist/tempo_*_linux_amd64.deb
docker exec debcontainer [ "$(systemctl is-active tempo)" = "active" ] || (echo "tempo is inactive" && exit 1)
docker exec debcontainer apt update && apt install -y curl
docker exec debcontainer ./wait-for-ready.sh)
docker cp ./tools/packaging/verify-deb-install.sh debcontainer:.
docker exec debcontainer ./verify-deb-install.sh
- name: test rpm package
run: |
docker run --name rpmcontainer -it --detach jrei/systemd-centos:8 /bin/sh
docker cp ./dist/tempo*_amd64.rpm rpmcontainer:.
docker cp ./tools/packaging/wait-for-ready.sh rpmcontainer:.
docker exec rpmcontainer rpm --import https://packages.grafana.com/gpg.key
docker exec rpmcontainer rpm -i ./tempo*_amd64.rpm
docker exec rpmcontainer [ "$(systemctl is-active tempo)" = "active" ] || (echo "tempo is inactive" && exit 1)
docker exec rpmcontainer apt update && apt install -y curl
docker exec rpmcontainer ./wait-for-ready.sh)
docker cp ./dist/tempo_*_linux_amd64.rpm rpmcontainer:.
docker cp ./tools/packaging/verify-rpm-install.sh rpmcontainer:.
docker exec rpmcontainer ./verify-rpm-install.sh
- name: release
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
Expand Down
28 changes: 7 additions & 21 deletions tools/packaging/verify-deb-install.sh
Original file line number Diff line number Diff line change
@@ -1,25 +1,11 @@
#!/usr/bin/env sh
#!/usr/bin/env bash

set -euxo pipefail

docker ps
image="$(docker ps --filter ancestor=jrei/systemd-debian:12 --latest --format "{{.ID}}")"
echo "Running on container: ${image}"
# Install tempo and check it's running
dpkg -i ./tempo_*_linux_amd64.deb
[ "\$(systemctl is-active tempo)" = "active" ] || (echo "tempo is inactive" && exit 1)

dir="."
if [ -n "${CI}" ]; then
dir="/drone/src"
fi
echo "Running on directory: ${dir}"

cat <<EOF | docker exec --interactive "${image}" sh
set -x
# Install tempo and check it's running
dpkg -i ${dir}/dist/tempo*_amd64.deb
[ "\$(systemctl is-active tempo)" = "active" ] || (echo "tempo is inactive" && exit 1)
# Wait for tempo to be ready. The script is cat-ed because it is passed to docker exec
apt update && apt install -y curl
$(cat ${dir}/tools/packaging/wait-for-ready.sh)
EOF
# Wait for tempo to be ready.
apt update && apt install -y curl
./wait-for-ready.sh
30 changes: 8 additions & 22 deletions tools/packaging/verify-rpm-install.sh
Original file line number Diff line number Diff line change
@@ -1,27 +1,13 @@
#!/usr/bin/env sh
#!/usr/bin/env bash

set -euxo pipefail

docker ps
image="$(docker ps --filter ancestor=jrei/systemd-centos:8 --latest --format "{{.ID}}")"
echo "Running on container: ${image}"
# Import the Grafana GPG key
rpm --import https://packages.grafana.com/gpg.key

dir="."
if [ -n "${CI}" ]; then
dir="/drone/src"
fi
echo "Running on directory: ${dir}"
# Install tempo and check it's running
rpm -i ./tempo_*_linux_amd64.rpm
[ "\$(systemctl is-active tempo)" = "active" ] || (echo "tempo is inactive" && exit 1)

cat <<EOF | docker exec --interactive "${image}" sh
set -x
# Import the Grafana GPG key
rpm --import https://packages.grafana.com/gpg.key
# Install tempo and check it's running
rpm -i ${dir}/dist/tempo*_amd64.rpm
[ "\$(systemctl is-active tempo)" = "active" ] || (echo "tempo is inactive" && exit 1)
# Wait for tempo to be ready. The script is cat-ed because it is passed to docker exec
$(cat ${dir}/tools/packaging/wait-for-ready.sh)
EOF
# Wait for tempo to be ready.
./wait-for-ready.sh

0 comments on commit 7456a8f

Please sign in to comment.