From 4c0aea50aef8bd4821a64b6049a4dc51dd0f47a9 Mon Sep 17 00:00:00 2001 From: Ben Thorner Date: Wed, 17 Feb 2021 15:49:35 +0000 Subject: [PATCH] Remove redundant Docker tasks Nothing and no one uses these. --- Makefile | 49 ----------------------------------------------- docker/Dockerfile | 39 ------------------------------------- 2 files changed, 88 deletions(-) delete mode 100644 docker/Dockerfile diff --git a/Makefile b/Makefile index 63fd612e8..a306b6405 100644 --- a/Makefile +++ b/Makefile @@ -7,15 +7,6 @@ APP_VERSION_FILE = app/version.py GIT_BRANCH ?= $(shell git symbolic-ref --short HEAD 2> /dev/null || echo "detached") GIT_COMMIT ?= $(shell git rev-parse HEAD) -DOCKER_BUILDER_IMAGE_NAME = govuk/notify-api-builder:master - -BUILD_TAG ?= notifications-api-manual -BUILD_NUMBER ?= 0 -DEPLOY_BUILD_NUMBER ?= ${BUILD_NUMBER} -BUILD_URL ?= - -DOCKER_CONTAINER_PREFIX = ${USER}-${BUILD_TAG} - CF_API ?= api.cloud.service.gov.uk CF_ORG ?= govuk-notify CF_SPACE ?= ${DEPLOY_ENV} @@ -61,46 +52,6 @@ test-requirements: echo "Run 'make freeze-requirements' to update."; exit 1; } \ || { echo "requirements.txt is up to date"; exit 0; } -.PHONY: prepare-docker-build-image -prepare-docker-build-image: generate-version-file ## Prepare the Docker builder image - docker build -f docker/Dockerfile \ - --build-arg HTTP_PROXY="${HTTP_PROXY}" \ - --build-arg HTTPS_PROXY="${HTTP_PROXY}" \ - --build-arg NO_PROXY="${NO_PROXY}" \ - -t ${DOCKER_BUILDER_IMAGE_NAME} \ - . - -.PHONY: test-with-docker -test-with-docker: prepare-docker-build-image create-docker-test-db ## Run tests inside a Docker container - @docker run -it --rm \ - --name "${DOCKER_CONTAINER_PREFIX}-test" \ - --link "${DOCKER_CONTAINER_PREFIX}-db:postgres" \ - -e SQLALCHEMY_DATABASE_URI=postgresql://postgres:postgres@postgres/test_notification_api \ - -e GIT_COMMIT=${GIT_COMMIT} \ - -e BUILD_NUMBER=${BUILD_NUMBER} \ - -e BUILD_URL=${BUILD_URL} \ - -e http_proxy="${HTTP_PROXY}" \ - -e HTTP_PROXY="${HTTP_PROXY}" \ - -e https_proxy="${HTTPS_PROXY}" \ - -e HTTPS_PROXY="${HTTPS_PROXY}" \ - -e NO_PROXY="${NO_PROXY}" \ - ${DOCKER_BUILDER_IMAGE_NAME} \ - make test - -.PHONY: create-docker-test-db -create-docker-test-db: ## Start the test database in a Docker container - docker rm -f ${DOCKER_CONTAINER_PREFIX}-db 2> /dev/null || true - @docker run -d \ - --name "${DOCKER_CONTAINER_PREFIX}-db" \ - -e POSTGRES_PASSWORD="postgres" \ - -e POSTGRES_DB=test_notification_api \ - postgres:9.5 - sleep 3 - -.PHONY: clean-docker-containers -clean-docker-containers: ## Clean up any remaining docker containers - docker rm -f $(shell docker ps -q -f "name=${DOCKER_CONTAINER_PREFIX}") 2> /dev/null || true - .PHONY: clean clean: rm -rf node_modules cache target venv .coverage build tests/.cache ${CF_MANIFEST_PATH} diff --git a/docker/Dockerfile b/docker/Dockerfile deleted file mode 100644 index c4dd66460..000000000 --- a/docker/Dockerfile +++ /dev/null @@ -1,39 +0,0 @@ -FROM python:3.6-slim - -ARG HTTP_PROXY -ARG HTTPS_PROXY -ARG NO_PROXY - -ENV PYTHONUNBUFFERED=1 \ - DEBIAN_FRONTEND=noninteractive - -RUN \ - echo "Install base packages" \ - && ([ -z "$HTTP_PROXY" ] || echo "Acquire::http::Proxy \"${HTTP_PROXY}\";" > /etc/apt/apt.conf.d/99HttpProxy) \ - && apt-get update \ - && apt-get install -y --no-install-recommends \ - make \ - curl \ - git \ - build-essential \ - zip \ - libpq-dev \ - && echo "Clean up" \ - && rm -rf /var/lib/apt/lists/* /tmp/* - -RUN \ - echo "Install Cloud Foundry CLI" \ - && curl -sSL "https://cli.run.pivotal.io/stable?release=debian64&source=github" -o /tmp/cloudfoundry-cli.deb \ - && dpkg -i /tmp/cloudfoundry-cli.deb - -# these are declared statically here so that they're cached by the docker image - if we run after the `COPY` command -# they won't be cached so it'll re-download every time. But these don't involve the filesystem -COPY requirements.txt . -COPY requirements_for_test.txt . -RUN \ - echo "Installing python dependencies" \ - && pip install -r requirements_for_test.txt - -WORKDIR /var/project - -COPY . .