Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e64e717

Browse files
committedFeb 26, 2020
Adding opm e2e test
1 parent 5fde436 commit e64e717

File tree

2 files changed

+65
-16
lines changed

2 files changed

+65
-16
lines changed
 

‎.travis.yml

+20-4
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,27 @@ os:
1010

1111
install:
1212
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install make; fi
13-
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install make; fi
13+
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
14+
sudo apt-get install make;
15+
sudo apt-get update -qq;
16+
sudo apt-get install -qq -y software-properties-common uidmap;
17+
sudo add-apt-repository -y ppa:projectatomic/ppa;
18+
sudo apt-get update -qq;
19+
sudo apt-get -qq -y install podman;
20+
fi
1421

15-
script:
16-
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then mingw32-make build; fi
17-
- if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then make unit build; fi
22+
script: |
23+
if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
24+
mingw32-make build
25+
fi
26+
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
27+
make unit build
28+
fi
29+
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
30+
make unit build
31+
bash opm-test.sh docker "$DOCKER_USERNAME" "$DOCKER_PASSWORD"
32+
bash opm-test.sh podman "$DOCKER_USERNAME" "$DOCKER_PASSWORD"
33+
fi
1834
1935
notifications:
2036
email: false

‎opm-test.sh

+45-12
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,59 @@
11
#!/bin/bash
2-
set -euxo pipefail
32

4-
echo "Setting Variables"
5-
read -p "Bunlde image: " bundleImage
6-
read -p "Index image tag: " indexImage
7-
read -p "docker or podman: " containerTool
3+
username=$2
4+
token=$3
5+
echo "logging in to quay"
6+
docker login -u "$username" -p "$token" quay.io
7+
8+
echo "Generating Random Tag"
9+
bundleTag1=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 6 | head -n 1)
10+
bundleTag2=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 6 | head -n 1)
11+
bundleTag3=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 6 | head -n 1)
12+
indexTag=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 6 | head -n 1)
13+
14+
bundleImage="quay.io/olmtest/e2e-bundle"
15+
indexImage="quay.io/olmtest/e2e-index:$indexTag"
16+
17+
if [ $# -eq 0 ]; then
18+
echo "No container tool argument supplied"
19+
exit 1
20+
fi
21+
22+
if [ "$1" != "docker" && "$1" != "podman" ]; then
23+
echo "container tool argument must be podman or docker"
24+
exit 1
25+
fi
26+
27+
containerTool="$1"
28+
echo "Running with container tool $containerTool"
829

930
echo "building opm"
1031
go build -mod=vendor -o bin/opm ./cmd/opm
32+
echo "building initializer"
33+
go build -mod=vendor -o bin/initializer ./cmd/initializer
34+
1135
echo "building prometheus bundles"
12-
./bin/opm alpha bundle build --directory manifests/prometheus/0.14.0 --tag $bundleImage:0.14.0 --package prometheus --channels preview --default preview
13-
./bin/opm alpha bundle build --directory manifests/prometheus/0.15.0 --tag $bundleImage:0.15.0 --package prometheus --channels preview --default preview
14-
./bin/opm alpha bundle build --directory manifests/prometheus/0.22.2 --tag $bundleImage:0.22.2 --package prometheus --channels preview --default preview
36+
./bin/opm alpha bundle build --directory manifests/prometheus/0.14.0 --tag $bundleImage:$bundleTag1 --package prometheus --channels preview --default preview
37+
./bin/opm alpha bundle build --directory manifests/prometheus/0.15.0 --tag $bundleImage:$bundleTag2 --package prometheus --channels preview --default preview
38+
./bin/opm alpha bundle build --directory manifests/prometheus/0.22.2 --tag $bundleImage:$bundleTag3 --package prometheus --channels preview --default preview
39+
1540
echo "pushing prometheus bundles"
16-
$containerTool push $bundleImage:0.14.0
17-
$containerTool push $bundleImage:0.15.0
18-
$containerTool push $bundleImage:0.22.2
41+
$containerTool push $bundleImage:$bundleTag1
42+
$containerTool push $bundleImage:$bundleTag2
43+
$containerTool push $bundleImage:$bundleTag3
44+
1945
echo "building index image with prometheus"
20-
./bin/opm index add -b="$bundleImage:0.14.0,$bundleImage:0.15.0,$bundleImage:0.22.2" -t "$indexImage" -c="$containerTool"
46+
./bin/opm index add -b="$bundleImage:$bundleTag1,$bundleImage:$bundleTag2,$bundleImage:$bundleTag3" -t "$indexImage" -c="$containerTool"
47+
2148
echo "pushing index image"
49+
$containerTool images
2250
$containerTool push $indexImage
51+
2352
echo "sleep for 30s before pulling image"
2453
sleep 30s
54+
2555
echo "exporting from index"
2656
./bin/opm index export -i="$indexImage" -o="prometheus" -c="$containerTool"
57+
58+
echo "running the initializer on the exported content"
59+
./bin/initializer -m="downloaded"

0 commit comments

Comments
 (0)
Please sign in to comment.