-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
5 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,47 +2,13 @@ on: [push] | |
|
||
name: Atlas CLI Action Sample | ||
|
||
env: | ||
MONGODB_ATLAS_PUBLIC_API_KEY: ${{ secrets.PUBLIC_API_KEY }} | ||
MONGODB_ATLAS_PRIVATE_API_KEY: ${{ secrets.PRIVATE_API_KEY }} | ||
MONGODB_ATLAS_ORG_ID: ${{ secrets.ORG_ID }} # default organization ID | ||
MONGODB_ATLAS_PROJECT_ID: ${{ secrets.PROJECT_ID }} # default project ID | ||
|
||
jobs: | ||
setup: | ||
use-atlas-cli: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check Out Repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Authenticate MongoDB Atlas CLI | ||
run: | | ||
atlas config init --publicApiKey "$MONGODB_ATLAS_PUBLIC_API_KEY" --privateApiKey "$MONGODB_ATLAS_PRIVATE_API_KEY" --orgId "$MONGODB_ATLAS_ORG_ID" | ||
- name: Setup AtlasCLI and create a project | ||
id: create-project | ||
- name: Setup AtlasCLI | ||
uses: mongodb/[email protected] | ||
with: | ||
create-project-name: test-setup-project | ||
|
||
- name: Run setup | ||
id: setup | ||
uses: mongodb/[email protected] | ||
with: | ||
run-setup: true | ||
project-id: ${{ steps.create-project.outputs.create-project-id }} | ||
cluster-name: test-cluster | ||
username: ${{ secrets.MONGODB_USER }} | ||
password: ${{ secrets.MONGODB_PASSWORD }} | ||
|
||
- name: Retrieve Connection String | ||
- name: Use AtlasCLI | ||
shell: bash | ||
run: | | ||
echo "${{ steps.setup.outputs.connection-string }}" | ||
- name: Teardown | ||
uses: mongodb/[email protected] | ||
with: | ||
delete-project-id: ${{ steps.create-project.outputs.create-project-id }} | ||
delete-cluster-name: test-cluster | ||
run: atlas --version # Print Atlas CLI Version |