Skip to content
This repository has been archived by the owner on May 14, 2020. It is now read-only.

mazgi-showcase/202002.dockerized-webapp-project

Repository files navigation

202002.dockerized-webapp-project

GitHub Actions status for "test-all-services"

Prepare

  1. Download cargo-make

Linux:

export CARGO_MAKE_VERSION="0.26.1" \
&& curl -sL https://github.com/sagiegurari/cargo-make/releases/download/${CARGO_MAKE_VERSION}/cargo-make-v${CARGO_MAKE_VERSION}-x86_64-unknown-linux-musl.zip \
| busybox unzip -p - cargo-make-v${CARGO_MAKE_VERSION}-x86_64-unknown-linux-musl/cargo-make > bin/cargo-make && chmod a+x bin/cargo-make

macOS:

export CARGO_MAKE_VERSION="0.26.1" \
&& curl -sL https://github.com/sagiegurari/cargo-make/releases/download/${CARGO_MAKE_VERSION}/cargo-make-v${CARGO_MAKE_VERSION}-x86_64-apple-darwin.zip \
| bsdtar --strip-components 1 -C bin/ -xvf - cargo-make-v${CARGO_MAKE_VERSION}-x86_64-apple-darwin/cargo-make
  1. Set up the project via cargo-make you downloaded.
bin/cargo-make make --makefile tasks/setup-project.toml
  1. Place GCP service account key file.

Place the service account key file as config/credentials/google-cloud-keyfile.json

  1. Up the Docker Compose once.

This step is needed to activate the GCP service account.

docker-compose up

How to build & publish the Docker Images

Run cargo-make to build and push docker images.

bin/cargo-make make --makefile tasks/build-and-push-images.toml

Appendix

You can check the GCP service account that activated as below.

gcloud iam service-accounts list

If you are a user of 1Password, you can get the GCP service account key file that below step.

eval $(op signin my)
op get document [email protected] > config/credentials/google-cloud-keyfile.json