-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stop setting container mongo port to input (#6)
It is always 27017. Only set the host machine port to the input.
- Loading branch information
Showing
7 changed files
with
115 additions
and
91 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 |
---|---|---|
|
@@ -6,6 +6,13 @@ jobs: | |
runs-on: ubuntu-latest | ||
name: Test mongo-action | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Create mongo Docker container | ||
uses: ./ | ||
with: | ||
image_version: latest | ||
port: 27017 | ||
- name: Install mongosh | ||
run: | | ||
sudo apt-get update | ||
|
@@ -14,10 +21,5 @@ jobs: | |
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list | ||
sudo apt-get update | ||
sudo apt-get install -y mongodb-mongosh | ||
- name: Create mongo Docker container | ||
uses: DigiPie/[email protected] | ||
with: | ||
image_version: latest | ||
port: 27017 | ||
- name: Test mongo connection | ||
run: "sudo mongosh localhost:27017" |
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 |
---|---|---|
|
@@ -8,13 +8,13 @@ | |
|
||
### `image_version` | ||
|
||
**Optional:** The `mongo` Docker image version to use. Default: `"latest"`. Refer to the official [Dockerhub image page](https://hub.docker.com/_/mongo). | ||
**Optional:** the mongo Docker image version to use. Default to `latest`. Refer to the official [Dockerhub image page](https://hub.docker.com/_/mongo). | ||
|
||
### `port` | ||
|
||
**Optional:** The `mongo` port to use. Default: `27017`. | ||
**Optional:** the port where the mongo service will be published at. Defaults to `27017`. Refer to the official [docker run page](https://docs.docker.com/engine/reference/commandline/run/#publish). | ||
|
||
## Example usage | ||
## Example usage with mongosh | ||
|
||
```yaml | ||
name: mongo-action CI | ||
|
@@ -25,19 +25,19 @@ jobs: | |
runs-on: ubuntu-latest | ||
name: Test mongo-action | ||
steps: | ||
- name: Install mongosh | ||
- name: Create mongo Docker container | ||
uses: DigiPie/[email protected] | ||
with: | ||
image_version: latest | ||
port: 27017 | ||
- name: Install mongosh command | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y wget gnupg | ||
wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add - | ||
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list | ||
sudo apt-get update | ||
sudo apt-get install -y mongodb-mongosh | ||
- name: Create mongo Docker container | ||
uses: DigiPie/[email protected] | ||
with: | ||
image_version: latest | ||
port: 27017 | ||
- name: Test mongo connection | ||
run: "sudo mongosh localhost:27017" | ||
``` | ||
|
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
Oops, something went wrong.