Skip to content

Commit

Permalink
[#246] Add steps for building and pushing base backend image
Browse files Browse the repository at this point in the history
This commit enhances the `scripts/govtool/Makefile` by introducing new targets `build-backend-base` and `push-backend-base`. These additions facilitate the process of building and pushing the base Docker image for the backend, which contains all necessary pre-compiled dependencies to expedite subsequent builds.

- The `build-backend-base` target is responsible for building the base image using the `Dockerfile.base` located in the `govtool/backend` directory. It tags the image with the commit hash, providing a clear linkage between the image and the source code state from which it was built.
- The `push-backend-base` target, dependent on a successful Docker login (`docker-login`), pushes the newly built base image to the configured repository. This ensures that the image is available for use by the CI/CD pipelines and developers for building the actual backend application image.

These targets are crucial for implementing the strategy to speed up the backend build and deployment process by leveraging a Docker image with pre-compiled dependencies. This approach aligns with the acceptance criteria set forth for the project, aiming at reducing build and deployment times through efficient dependency management.
  • Loading branch information
placek committed Feb 23, 2024
1 parent 248529f commit 4ae2c1c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions scripts/govtool/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,25 @@ build-backend:
@:$(call check_defined, env)
$(docker) build --tag "$(repo_url)/backend:$(tag)" ../../govtool/backend

.PHONY: build-backend-base
build-backend-base:
@:$(call check_defined, cardano_network)
@:$(call check_defined, env)
$(docker) build --file ../../govtool/backend/Dockerfile.base --tag "$(repo_url)/backend-base:$(commit)" ../../govtool/backend
@echo "New backend-base image: $(repo_url)/backend-base:$(commit)"

.PHONY: push-backend
push-backend: docker-login
@:$(call check_defined, cardano_network)
@:$(call check_defined, env)
$(docker) push $(repo_url)/backend:$(tag)

.PHONY: push-backend-base
push-backend-base: docker-login
@:$(call check_defined, cardano_network)
@:$(call check_defined, env)
$(docker) push $(repo_url)/backend-base:$(commit)

.PHONY: build-frontend
build-frontend:
@:$(call check_defined, cardano_network)
Expand Down

0 comments on commit 4ae2c1c

Please sign in to comment.