ci: cypress on documentDB init db from backup archive (#26710)
Restoring db of each run from a mongo archive with initial migrations already applied to speed up the tests.
This commit is contained in:
parent
968eb9950b
commit
adedf0c159
15
.github/workflows/ci-test-with-documentdb.yml
vendored
15
.github/workflows/ci-test-with-documentdb.yml
vendored
|
|
@ -126,6 +126,19 @@ jobs:
|
||||||
- name: cat run_result
|
- name: cat run_result
|
||||||
run: echo ${{ steps.run_result.outputs.run_result }}
|
run: echo ${{ steps.run_result.outputs.run_result }}
|
||||||
|
|
||||||
|
- name: Install mongosh
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y wget gnupg
|
||||||
|
wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add -
|
||||||
|
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/5.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: Download mongodb archive
|
||||||
|
run: |
|
||||||
|
curl -o data.gz https://appsmithctl-backup-restore-test.s3.ap-south-1.amazonaws.com/docdb-data.gz
|
||||||
|
|
||||||
- name: Download Docker image artifact
|
- name: Download Docker image artifact
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
|
|
@ -154,6 +167,7 @@ jobs:
|
||||||
chmod 400 ssh_key.pem
|
chmod 400 ssh_key.pem
|
||||||
ssh -4 -o StrictHostKeyChecking=no -o ServerAliveInterval=180 -o ServerAliveCountMax=5 -i "ssh_key.pem" -L 0.0.0.0:27010:docdb-ansible-test-cluster.cluster-cz8diybf9wdj.ap-south-1.docdb.amazonaws.com:27017 ubuntu@65.1.106.35 -N -f
|
ssh -4 -o StrictHostKeyChecking=no -o ServerAliveInterval=180 -o ServerAliveCountMax=5 -i "ssh_key.pem" -L 0.0.0.0:27010:docdb-ansible-test-cluster.cluster-cz8diybf9wdj.ap-south-1.docdb.amazonaws.com:27017 ubuntu@65.1.106.35 -N -f
|
||||||
|
|
||||||
|
|
||||||
- name: Run Appsmith, CS & TED docker image
|
- name: Run Appsmith, CS & TED docker image
|
||||||
if: steps.run_result.outputs.run_result != 'success'
|
if: steps.run_result.outputs.run_result != 'success'
|
||||||
working-directory: "."
|
working-directory: "."
|
||||||
|
|
@ -165,6 +179,7 @@ jobs:
|
||||||
hash=$(echo -n "$timestamp" | sha1sum | awk '{print $1}')
|
hash=$(echo -n "$timestamp" | sha1sum | awk '{print $1}')
|
||||||
current_date=$(date -d "@$timestamp" +"%d-%m")
|
current_date=$(date -d "@$timestamp" +"%d-%m")
|
||||||
DB_NAME="ci${hash:1:3}-${current_date}"
|
DB_NAME="ci${hash:1:3}-${current_date}"
|
||||||
|
mongorestore --uri="${APPSMITH_MONGODB_URI}${DB_NAME}?retryWrites=false&replicaSet=rs0&directConnection=true" --archive=data.gz --gzip --drop --nsInclude=*
|
||||||
sudo /etc/init.d/ssh stop ;
|
sudo /etc/init.d/ssh stop ;
|
||||||
mkdir -p ~/git-server/keys
|
mkdir -p ~/git-server/keys
|
||||||
mkdir -p ~/git-server/repos
|
mkdir -p ~/git-server/repos
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user