CI Job ends early, but "succeeds"
I'm having a baffling issue that I have yet to see outside of this single repository. Basically, this repo consists of a bash script whose job it is to build a container with a (much smaller) development version of our database for developers to work with. Normally, this works pretty well, but when attempting to do so in a runner, the script terminates early in, and Gitlab declares the job a success, without running any of the steps that are supposed to happen afterwards.
My .gitlab-ci.yml
:
image: "impact.azurecr.io/impact-dev:ubuntu18.04-jdk11"
services:
- docker:dind
build:
stage: deploy
only:
- master@IRIS/IRIS-docker
variables:
DOCKER_HOST: tcp://localhost:2375/
DOCKER_DRIVER: overlay2
tags:
- kubernetes
script:
- ./build-image.sh
- docker login impact.azurecr.io --username impact --password $REPO_ACCESS_KEY
- docker image push impact.azurecr.io/irisdb
build-image.sh
isn't something I can't provide here, but I also don't think it's content is relevant to the issue.
The lengths of the runs vary, but here's one of the shorter ones (took about 3 minutes a full run should take just shy of an hour)
on gitlab-runner-gitlab-runner-6594fdb56c-wkfm5 a1c03967
Using Kubernetes namespace: gitlab-ci-builds
Using Kubernetes executor with image impact.azurecr.io/impact-dev:ubuntu18.04-jdk11 ...
Waiting for pod gitlab-ci-builds/runner-a1c03967-project-197-concurrent-02l6cx to be running, status is Pending
Waiting for pod gitlab-ci-builds/runner-a1c03967-project-197-concurrent-02l6cx to be running, status is Pending
Waiting for pod gitlab-ci-builds/runner-a1c03967-project-197-concurrent-02l6cx to be running, status is Pending
Running on runner-a1c03967-project-197-concurrent-02l6cx via gitlab-runner-gitlab-runner-6594fdb56c-wkfm5...
Cloning into '/IRIS/IRIS-docker'...
Cloning repository...
Checking out 0d3cc22a as master...
Skipping Git submodules setup
$ ./build-image.sh
Obtaining database backup
Latest backup: IRIS_backup_2018_10_16_001500_7945750.bak
Downloading...
Job succeeded
That run made it about 25 lines out of 110, exactly how far it goes varies from run to run. While I can readily believe there is a bug in my script, what I can't make sense of is a) the lack of error messages, and b) that it doesn't run any of the steps after build-image.sh
, aka, it doesn't attempt to push the created image. If build-image.sh
failed, the run should've failed, and if Gitlab thought it succeeded, it should've run the rest of the job.
I'm not sure where to look next.