You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+18-24Lines changed: 18 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -37,29 +37,32 @@ When running in `prod` Logs are sent to [Cloud Logging](https://cloud.google.com
37
37
The Logback plugin only reports logs from the LF4J logging API, so we only use the `org.slf4j.Logger` interface for logging.
38
38
When running in `dev` profile, logs are configured to write to the console.
39
39
40
-
41
40
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
42
41
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
We use Google Cloud Secrets Manager to manage secrets (API keys, passwords, database URLs, etc.)
51
44
52
-
###Deployments
45
+
## Deployments
53
46
54
47
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.
55
60
56
-
The app runs on a Google Compute Engine VM with full GCP API permissions and required scopes
57
61
58
62
### Publishing a new version to Google Artifact Registry
59
63
You will need to have write access to our Google Artifact Registry on Google Cloud Platform and install docker on your machine.
60
64
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.
63
66
64
67
65
68
### 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
77
80
78
81
Use Cloud logging to inspect the logs and health of the machine.
79
82
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
-
90
83
91
84
### Tests 🧪
92
85
#### Unit test
@@ -97,11 +90,12 @@ an [Embedded DB](https://github.com/flapdoodle-oss/de.flapdoodle.embed.mongo) th
97
90
1.`Mockito` is used for Mocking external services
98
91
2.`MockMvc` is used for the Integration test
99
92
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.
0 commit comments