The automatic build is configured in cloud.docker.com.
The following build configuration is expected:
Source Repository: github.com/netbox-community/netbox-docker Build Location: Build on Docker Hub's infrastructure Autotest: Internal and External Pull Requests Repository Links: Enable for Base Image Build Rules: - Source Type: Branch Source: release Docker Tag: branches Dockerfile location: Dockerfile Build Context: / Autobuild: on Build Caching: on - Source Type: Branch Source: release Docker Tag: prerelease Dockerfile location: Dockerfile Build Context: / Autobuild: on Build Caching: on - Source Type: Branch Source: release Docker Tag: release Dockerfile location: Dockerfile Build Context: / Autobuild: on Build Caching: on Build Environment Variables: # Create an app on Github and use it's OATH credentials here - Key: GITHUB_OAUTH_CLIENT_ID Value: <secret> - Key: GITHUB_OAUTH_CLIENT_SECRET Value: <secret> Build Triggers: - Name: Cron Trigger Trigger URL: <generated> # Use this trigger in combination with e.g. https://cron-job.org in order to regularly schedule builds
The build system of cloud.docker.com is not made for this kind of project.
But we found a way to make it work, and this is how:
build, test and push. See /hooks/*.build, test and push is extracted to /hooks/common.build script runs run_build() from /hooks/common./build-branches.sh, /build-latest.sh or directly /build.sh.test script just invokes docker-compose commands.push script runs run_build() from hooks/common with a --push-only flag.build.sh script to not re-build the Docker image, but just the just built image.The Docker Tag configuration setting ($DOCKER_TAG) is only used to select the type (release, prerelease, branches) of the build in hooks/common.
Because it has a different meaning in all the other build scripts, it is unset after it has served it's purpose.