From 820535930ad402ae5addacd14643200e5e4f8121 Mon Sep 17 00:00:00 2001 From: Tomokazu Tantaka Date: Tue, 24 Dec 2024 14:32:58 +0900 Subject: [PATCH 1/2] mongo update 7 --- .github/workflows/ci_server.yml | 7 ++----- docker-compose.yml | 2 ++ mongo-init.js | 6 ++++++ 3 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 mongo-init.js diff --git a/.github/workflows/ci_server.yml b/.github/workflows/ci_server.yml index 8b83edf99e..3dccdbcb03 100644 --- a/.github/workflows/ci_server.yml +++ b/.github/workflows/ci_server.yml @@ -25,14 +25,11 @@ jobs: ci-server-test: runs-on: ubuntu-latest - services: - mongo: - image: mongo:5-focal - ports: - - 27017:27017 steps: - name: checkout uses: actions/checkout@v3 + - name: Docker Compose start + run: docker compose -f $GITHUB_WORKSPACE/docker-compose.yml up -d reearth-mongo - name: set up uses: actions/setup-go@v4 with: diff --git a/docker-compose.yml b/docker-compose.yml index f764f2a101..2437f8e0db 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -20,3 +20,5 @@ services: - 27017:27017 volumes: - ./mongo:/data/db + - ./mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro + command: ["mongod", "--replSet", "rs0"] diff --git a/mongo-init.js b/mongo-init.js new file mode 100644 index 0000000000..0b19d02ed9 --- /dev/null +++ b/mongo-init.js @@ -0,0 +1,6 @@ +rs.initiate({ + _id: "rs0", + members: [{ _id: 0, host: "localhost:27017" }], +}); + +rs.status(); From 73bfa3d710da80f1d32c51895a07a61646cb9f1d Mon Sep 17 00:00:00 2001 From: Tomokazu Tantaka Date: Tue, 24 Dec 2024 15:46:26 +0900 Subject: [PATCH 2/2] remove replica --- .github/workflows/ci_server.yml | 7 +++++-- docker-compose.yml | 2 -- mongo-init.js | 6 ------ 3 files changed, 5 insertions(+), 10 deletions(-) delete mode 100644 mongo-init.js diff --git a/.github/workflows/ci_server.yml b/.github/workflows/ci_server.yml index 3dccdbcb03..fbb7df89ab 100644 --- a/.github/workflows/ci_server.yml +++ b/.github/workflows/ci_server.yml @@ -25,11 +25,14 @@ jobs: ci-server-test: runs-on: ubuntu-latest + services: + mongo: + image: mongo:7 + ports: + - 27017:27017 steps: - name: checkout uses: actions/checkout@v3 - - name: Docker Compose start - run: docker compose -f $GITHUB_WORKSPACE/docker-compose.yml up -d reearth-mongo - name: set up uses: actions/setup-go@v4 with: diff --git a/docker-compose.yml b/docker-compose.yml index 2437f8e0db..f764f2a101 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -20,5 +20,3 @@ services: - 27017:27017 volumes: - ./mongo:/data/db - - ./mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro - command: ["mongod", "--replSet", "rs0"] diff --git a/mongo-init.js b/mongo-init.js deleted file mode 100644 index 0b19d02ed9..0000000000 --- a/mongo-init.js +++ /dev/null @@ -1,6 +0,0 @@ -rs.initiate({ - _id: "rs0", - members: [{ _id: 0, host: "localhost:27017" }], -}); - -rs.status();