-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add docker images for database backups (#2)
* Add docker images for database backups * Bump versions * Update lock files * Reformat values files * Enable image building in pull requests * Set local time before installing tzdata * Fix Mongodb backup image build
- Loading branch information
Showing
17 changed files
with
112 additions
and
27 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,42 @@ | ||
name: Build and release images | ||
|
||
on: push | ||
|
||
concurrency: build-${{ github.sha }} | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Create SHA tag | ||
id: sha_tag | ||
run: | | ||
tag=$(cut -c 1-7 <<< $GITHUB_SHA) | ||
echo "tag=$tag" >> $GITHUB_OUTPUT | ||
- name: Build images | ||
run: | | ||
docker build ./images/postgresql-s3-backup/ -t ghcr.io/quiltmc/postgresql-s3-backup:latest | ||
docker tag ghcr.io/quiltmc/postgresql-s3-backup:latest ghcr.io/quiltmc/postgresql-s3-backup:${{ steps.sha_tag.outputs.tag }} | ||
docker build ./images/mongodb-s3-backup/ -t ghcr.io/quiltmc/mongodb-s3-backup:latest | ||
docker tag ghcr.io/quiltmc/mongodb-s3-backup:latest ghcr.io/quiltmc/mongodb-s3-backup:${{ steps.sha_tag.outputs.tag }} | ||
- name: Login to Github Container Registry | ||
if: github.ref == 'refs/heads/main' | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Push images to the registry | ||
if: github.ref == 'refs/heads/main' | ||
run: | | ||
docker push ghcr.io/quiltmc/postgresql-s3-backup:latest | ||
docker push ghcr.io/quiltmc/postgresql-s3-backup:${{ steps.sha_tag.outputs.tag }} | ||
docker push ghcr.io/quiltmc/mongodb-s3-backup:latest | ||
docker push ghcr.io/quiltmc/mongodb-s3-backup:${{ steps.sha_tag.outputs.tag }} |
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
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
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 @@ | ||
dependencies: | ||
- name: mongodb | ||
repository: https://charts.bitnami.com/bitnami | ||
version: 13.16.2 | ||
digest: sha256:17d8573ce48684adf09ea3684534a85acab1fcbf101d041cdacc65cf87f6c8d3 | ||
generated: "2024-05-12T02:51:37.002346+02:00" |
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
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,19 @@ | ||
FROM ubuntu:22.04 | ||
|
||
WORKDIR /dump | ||
|
||
RUN apt update \ | ||
&& ln -fs /usr/share/zoneinfo/UTC /etc/localtime \ | ||
&& apt-get install -y tzdata gnupg wget curl unzip \ | ||
&& dpkg-reconfigure --frontend noninteractive tzdata \ | ||
&& wget -qO- https://www.mongodb.org/static/pgp/server-7.0.asc | tee /etc/apt/trusted.gpg.d/server-7.0.asc \ | ||
&& echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-7.0.list \ | ||
&& apt update \ | ||
&& apt-get install -y mongodb-mongosh \ | ||
&& curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" \ | ||
&& unzip awscliv2.zip \ | ||
&& ./aws/install \ | ||
&& rm -rf awscliv2.zip aws \ | ||
&& aws --version | ||
|
||
CMD ["bash"] |
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,15 @@ | ||
FROM ubuntu:22.04 | ||
|
||
WORKDIR /dump | ||
|
||
RUN apt update \ | ||
&& ln -fs /usr/share/zoneinfo/UTC /etc/localtime \ | ||
&& apt-get install -y tzdata postgresql-client curl unzip \ | ||
&& dpkg-reconfigure --frontend noninteractive tzdata \ | ||
&& curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" \ | ||
&& unzip awscliv2.zip \ | ||
&& ./aws/install \ | ||
&& rm -rf awscliv2.zip aws \ | ||
&& aws --version | ||
|
||
CMD ["bash"] |