Skip to content

Commit 89f2d0b

Browse files
committed
doc: update README.md
1 parent 13301d8 commit 89f2d0b

File tree

1 file changed

+18
-24
lines changed

1 file changed

+18
-24
lines changed

README.md

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -37,29 +37,32 @@ When running in `prod` Logs are sent to [Cloud Logging](https://cloud.google.com
3737
The Logback plugin only reports logs from the LF4J logging API, so we only use the `org.slf4j.Logger` interface for logging.
3838
When running in `dev` profile, logs are configured to write to the console.
3939

40-
4140
Use this [setup to configure Docker](https://docs.docker.com/config/containers/logging/gcplogs/) to work with Cloud Logging when moving to a new VM
4241

43-
#### Deploying custom config for Google's Ops Agent
44-
Our custom Ops Agent config can be found in the ``config.yaml`` file. Use the following command to Update the Ops Agent config when setting up a new VM
45-
```shell
46-
$ gcloud compute scp config.yaml gated-vm:/etc/google-cloud-ops-agent/config.yaml
47-
```
48-
4942
### Secrets Management 🔒
5043
We use Google Cloud Secrets Manager to manage secrets (API keys, passwords, database URLs, etc.)
5144

52-
### Deployments
45+
## Deployments
5346

5447
Deployments are currently automated via GitHub actions. The workflow file is located at ``/.github/workflows/deploy.yml``
48+
The app runs on a Google Compute Engine VM with full GCP API permissions and required scopes.
49+
50+
### Building the production docker image on a new machine
51+
1. Install Docker and Gcloud CLI
52+
2. Run ``gcloud auth application-default login`` to authenticate with Google Cloud Platform
53+
3. Run ``CP $HOME/.config/gcloud/application_default_credentials.json cred.json`` from the project root folder.
54+
4. Run ``docker build -t <IMAGE_NAME> -f Dockerfile . --build-arg PROJECT_ID=<GCP_PROJECT_ID>`` to build the docker image.\
55+
Replace the `<GCP_PROJECT_ID>` with the appropriate Google Cloud Project ID.\
56+
Replace `Dockerfile` with `native.Dockerfile` if you want to build the GraalVM native docker image.\
57+
Replace `IMAGE_NAME` with `jvm` or `native` to match the service name in the `docker-compose.yml` file if you want to run the images locally.
58+
5. Temporarily allow the production MongoDB Atlas to accept traffic from your local machine's IP address.
59+
6. Run ``docker-compose up <service-name>`` from the project root folder. Use `jvm` or `native` as the service name.
5560

56-
The app runs on a Google Compute Engine VM with full GCP API permissions and required scopes
5761

5862
### Publishing a new version to Google Artifact Registry
5963
You will need to have write access to our Google Artifact Registry on Google Cloud Platform and install docker on your machine.
6064
1. Run ``gcloud auth configure-docker us-central1-docker.pkg.dev`` to enable [Google Cloud CLI to authenticate requests to Artifact Registry](https://cloud.google.com/artifact-registry/docs/docker/store-docker-container-images#linux).
61-
2. Run the ``mvn clean package`` command to publish the new version to Google Artifact Registry. The required repository path is
62-
configured in the [Jib Maven plugin](https://github.com/GoogleContainerTools/jib/tree/master/jib-maven-plugin) in pom.xml file
65+
2. Run the ``docker tag web <GCP_IMAGE_NAME> && docker push <GCP_IMAGE_NAME>`` command to publish the new version to Google Artifact Registry.
6366

6467

6568
### Updating the container image with the new image version
@@ -77,16 +80,6 @@ While will not need to log into the VM to get Telementry information, you can SS
7780

7881
Use Cloud logging to inspect the logs and health of the machine.
7982

80-
### Building the production docker image on local machine
81-
1. Install Docker and Gcloud CLI
82-
2. Run ``gcloud auth application-default login`` to authenticate with Google Cloud Platform
83-
3. Run ``CP $HOME/.config/gcloud/application_default_credentials.json cred.json`` from the project root folder.
84-
4. Run ``docker build -t jvm -f Dockerfile . --build-arg PROJECT_ID=<GCP_PROJECT_ID>`` to build the docker image.\
85-
Replace the `<GCP_PROJECT_ID>` with the appropriate Google Cloud Project ID.\
86-
Replace `Dockerfile` with `native.Dockerfile` if you want to build the GraalVM native docker image.
87-
5. Temporarily allow the production MongoDB Atlas to accept traffic from your local machine's IP address.
88-
6. Run ``docker-compose up`` from the project root folder.
89-
9083

9184
### Tests 🧪
9285
#### Unit test
@@ -97,11 +90,12 @@ an [Embedded DB](https://github.com/flapdoodle-oss/de.flapdoodle.embed.mongo) th
9790
1. `Mockito` is used for Mocking external services
9891
2. `MockMvc` is used for the Integration test
9992

100-
While ``mvn clean test`` is good for running the tests during development, we advise you use the following command to run the `Dockerfile` to verify that the test can run in an
101-
isolated environment without any preconfiguration on your local machine.
93+
While ``mvn clean test`` is good for running the tests during development, we advise you use the following command to build the `test.Dockerfile`
94+
to verify that the test can run in an isolated environment without any preconfiguration on your local machine.
10295
```shell
103-
docker build -t java-docker-image-test --progress=plain --no-cache --target=test .
96+
docker build -t test -f test.Dockerfile .
10497
```
98+
A successful build from the above command indicates that all tests are passing on your local machine.
10599

106100
---
107101

0 commit comments

Comments
 (0)