Skip to content

Commit 15493f1

Browse files
authored
skip script when missing 8.previous/8.current/8.next snapshot docker images (#65)
1 parent feba31a commit 15493f1

File tree

3 files changed

+34
-12
lines changed

3 files changed

+34
-12
lines changed

docker-compose.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: '3'
2-
31
# run tests: cd ci/unit; docker-compose up --build --force-recreate
42
# manual: cd ci/unit; docker-compose run logstash bash
53
services:

docker-setup.sh

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,12 @@ pull_docker_snapshot() {
1212
echo "docker pull successful"
1313
else
1414
case "$ELASTIC_STACK_VERSION_ARG" in
15-
"8.previous"|"8.current"|"8.next")
16-
echo "Failed to pull logstash-${ELASTIC_STACK_VERSION}. Likely due to missing DRA build, skipping."
17-
exit 0
18-
;;
19-
*)
20-
echo "Failed to pull logstash-${ELASTIC_STACK_VERSION}. The image should exist, failing the build.."
21-
exit 1
22-
;;
15+
"8.previous"|"8.current"|"8.next")
16+
exit 1
17+
;;
18+
*)
19+
exit 2
20+
;;
2321
esac
2422
fi
2523
}

travis/exec.yml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,30 @@
11
before_install:
22
- mkdir -p .ci && curl -sL https://github.com/logstash-plugins/.ci/archive/1.x.tar.gz | tar zxvf - --skip-old-files --strip-components=1 -C .ci --wildcards "*Dockerfile*" "*docker*" "*.sh"
3-
install: .ci/docker-setup.sh
4-
script: .ci/docker-run.sh
3+
install:
4+
- .ci/docker-setup.sh
5+
- exit_code=$?
6+
- |
7+
case $exit_code in
8+
0)
9+
echo "Install succeeded."
10+
;;
11+
1)
12+
echo "Failed to pull logstash-${ELASTIC_STACK_VERSION}. Likely due to missing DRA build."
13+
export SKIP_SCRIPT=true
14+
;;
15+
2)
16+
echo "Failed to pull logstash-${ELASTIC_STACK_VERSION}. The image should exist. Aborting build."
17+
exit $exit_code
18+
;;
19+
*)
20+
echo "Install failed with an unexpected code: $exit_code. Stopping build."
21+
exit $exit_code
22+
;;
23+
esac
24+
script:
25+
- |
26+
if [ "$SKIP_SCRIPT" = "true" ]; then
27+
exit 0
28+
else
29+
.ci/docker-run.sh
30+
fi

0 commit comments

Comments
 (0)