I have two repositories that auto-build and auto-test from corresponding GitHub repositories. One is essentially a simple “hello world” example from here, the other a real project.
In both cases, everything works as expected when the builds are triggered by a “branch” rule in the auto-build configuration. An image is auto-built. That image is cached and used to run auto tests (set up according to discussion here). If the tests are successful, the image is tagged and pushed.
However, when the exact same commit triggers an auto build via a GitHub tag, the build fails when attempting the auto-test. In my hello world example, the error is …
...
Successfully built de91c2b9ebba
Successfully tagged rdzman/test:0.5
Starting Test in docker-compose.test.yml...
Building sut
Couldn't connect to Docker daemon at http+docker://localhost - is it running?
If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
building docker-compose.test.yml (1)
My docker-compose.test.yml
file, which I remind you works just fine for auto builds triggered by a “branch” rule, contains only:
version: '3'
services:
sut:
build: .
image: rdzman/test:${CACHE_TAG}
command: /bin/bash run_docker_tests.sh
And my auto-build configuration is:
[Tag] /^[0-9.]+/, {sourceref}, Dockerfile, /, Autobuild [on], Build Caching [on]
My other repository, which has a similar setup, fails at the same step when triggered by a GitHub tag, but with a different error:
...
Successfully built f6726b74f521
Successfully tagged matpower/matpower-desktop:7.0
Starting Test in docker-compose.test.yml...
sut uses an image, skipping
Creating network "b7rfinanvhkh5qhbjkk8hrq_default" with the default driver
no such image: matpower/matpower-desktop:: invalid reference format
starting "sut" service in docker-compose.test.yml (1)
I’m not sure if the cause of failure is different for the two cases, but would appreciate help getting the hello world case working correctly first.
So, any ideas what I need to do differently to get it to build and test correctly when triggered by a GitHub tag?