-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: build Docker image containing seed data (#81)
- Loading branch information
1 parent
0e4cb9d
commit b5f232d
Showing
5 changed files
with
49 additions
and
10 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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- "[0-9]+.[0-9]+.[0-9]+" | ||
paths: | ||
- .github/workflows/build-seed-data.yaml | ||
- "resources/Dockerfile" | ||
- "resources/seed/**" | ||
|
||
env: | ||
docker_image_tag: ${{ github.ref == 'refs/heads/main' && github.sha || github.ref_name }} | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
id-token: write | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: integration-os/google-artifact-registry-action@v2 | ||
with: | ||
image: "us-docker.pkg.dev/integrationos/docker-oss/seed-data:${{ env.docker_image_tag }}" | ||
service_account: [email protected] | ||
workload_identity_provider: projects/356173785332/locations/global/workloadIdentityPools/github-actions/providers/github-actions | ||
context: resources | ||
file: resources/Dockerfile |
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
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
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
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM mongo:6.0 | ||
|
||
COPY seed /app/integrationos/resources/seed | ||
WORKDIR /app/integrationos/ | ||
|
||
ENTRYPOINT ["/bin/bash", "-c", "set -u && mongorestore --host ${MONGO_HOST} --nsFrom=seed.* --nsTo=${MONGO_DATABASE}.* --authenticationDatabase admin -u ${MONGO_USERNAME} -p ${MONGO_PASSWORD} ./resources"] |