Refactor to multistage builds

This commit introduces a huge change in the build process.

What changed:

- Dockerfile.ldap was integrated into Dockerfile as a seperate
  [build stage][multistage-build].
- All the build scripts were refactored according to this.
- The `docker-compose.yml` file was adjusted likewise.
- The main build script, `/build.sh`, now always builds all
  targets (formerly called variants).
- The minimal requirements for Docker and docker-compose
  have increased.
- The build on hub.docker.com must be adjusted.

This change should also fix  permanently.

[multistage-build]: https://docs.docker.com/develop/develop-images/multistage-build/
This commit is contained in:
Christian Mäder 2019-10-10 12:42:10 +02:00 committed by Christian Mäder
parent c148d3ceb9
commit d0ebb34432
11 changed files with 259 additions and 246 deletions
hooks

View file

@ -2,11 +2,13 @@
. hooks/common
if [ "${VARIANT}" == "main" ] && [ "${BUILD}" == "BRANCHES" ]; then
if [ "${BUILD}" == "BRANCHES" ]; then
echo "🐳🐳🐳 Testing"
export DOCKER_TARGET="main"
docker-compose pull --parallel
docker-compose build
docker-compose run netbox ./manage.py test
else
echo "🐳🐳🐳 No tests are implemented for build '${BUILD}' with variant '${VARIANT}'."
echo "🐳🐳🐳 No tests are implemented for build '${BUILD}'."
fi