Skip to content

Commit

Permalink
Merge pull request #9 from realm/create_cluster_if_not_exists
Browse files Browse the repository at this point in the history
Create cluster with specific name if not exists
  • Loading branch information
desistefanova authored Jul 5, 2022
2 parents 82bec25 + 63fb0c1 commit 3f810b2
Show file tree
Hide file tree
Showing 15 changed files with 3,257 additions and 3,216 deletions.
4 changes: 3 additions & 1 deletion mdb-realm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,12 @@ The action takes the following parameters:
1. *(Required)* `projectId`: the Id of the Atlas project where the cluster will be created.
1. *(Required)* `apiKey`: the public [Atlas API key](https://docs.atlas.mongodb.com/configure-api-access/).
1. *(Required)* `privateApiKey`: the private [Atlas API key](https://docs.atlas.mongodb.com/configure-api-access/).
1. *(Required)* `differentiator`: a string to differentiate this deployment from others in the same workflow. This value will be combined with the Github Actions run id to generate a unique string for each run+target combination.
1. *(Optional)* `differentiator`: a string to differentiate this deployment from others in the same workflow. This value will be combined with the Github Actions run id to generate a unique string for each run+target combination. It is not required when a specific cluster name is passed.
1. *(Optional)* `appsPath`: the path where the exported apps are located.
1. *(Optional)* `atlasUrl`: the Atlas URL to deploy against. Default is https://cloud-dev.mongodb.com.
1. *(Optional)* `realmUrl`: the MongoDB Realm URL to deploy against. Default is https://realm-dev.mongodb.com.
1. *(Optional)* `clusterName`: the name of the cluster that to be created. If it is not set it is auto-generated.
1. *(Optional)* `useExistingCluster` the flag that define whether the cluster to be reused in case it already exists. Default is false - always tries to create new cluster.

The action has the following outputs:

Expand Down
1 change: 1 addition & 0 deletions mdb-realm/__tests__/helpers.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class helpersTests {
projectId: "set-your-project-id",
clusterName: "",
realmUrl: "https://realm-qa.mongodb.com",
useExistingCluster: true,
};
}

Expand Down
2 changes: 1 addition & 1 deletion mdb-realm/cleanup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ inputs:
required: true
description: The private API key.
runs:
using: node12
using: node16
main: ../dist/cleanup/index.js
2 changes: 1 addition & 1 deletion mdb-realm/deleteAllClusters/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ inputs:
required: true
description: The private API key.
runs:
using: node12
using: node16
main: ../dist/deleteAllClusters/index.js
12 changes: 9 additions & 3 deletions mdb-realm/deployApps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,19 @@ inputs:
required: false
description: The path to the apps to import into MongoDB Realm.
differentiator:
required: true
description: Provide a differentiator for the build - e.g. "{{ matrix.os }}-{{ matrix.node-version }}" or "integration tests"
required: false
description: Provide a differentiator for the build - e.g. "{{ matrix.os }}-{{ matrix.node-version }}" or "integration tests". The differentiator is used when building cluster name. It is not required when a specific cluster name is passed.
clusterName:
required: false
description: Provide a specific name of cluster that to be created."
useExistingCluster:
required: false
description: Defines whether to reuse the cluster if one with the same name already exists."
outputs:
deployedApps:
description: "A base64-encoded json object keyed on the app name containing the app ids of the deployed apps - e.g. { \"app1\": \"app1-abcde\"}"
clusterName:
description: The name of the created cluster
runs:
using: node12
using: node16
main: ../dist/deployApps/index.js
5,049 changes: 2,527 additions & 2,522 deletions mdb-realm/dist/cleanup/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion mdb-realm/dist/cleanup/index.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit 3f810b2

Please sign in to comment.