Fixes s3 playbook + adds notice to run migration directly on the servers
This commit is contained in:
parent
5bc985b2a6
commit
8ae3c2b474
|
@ -18,3 +18,5 @@ vars/woodpecker_production.yml
|
||||||
vars/woodpecker_staging.yml
|
vars/woodpecker_staging.yml
|
||||||
|
|
||||||
vars/backup.yml
|
vars/backup.yml
|
||||||
|
|
||||||
|
s3-migration/local-storage/
|
||||||
|
|
|
@ -11,6 +11,8 @@ Steps (in theory):
|
||||||
- Re-deploy a new instance with the new backend version to replace the old instance
|
- Re-deploy a new instance with the new backend version to replace the old instance
|
||||||
- Migrate metadata + bucket data from temporary instance to the new instance
|
- Migrate metadata + bucket data from temporary instance to the new instance
|
||||||
|
|
||||||
|
Please notice: `mc` copies the whole data over the network. Due to slow speeds at home/office, it is recommend to run the migration on one of the servers.
|
||||||
|
|
||||||
|
|
||||||
## Commands/Steps to run
|
## Commands/Steps to run
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
curl https://dl.min.io/client/mc/release/linux-amd64/mc \
|
||||||
|
--create-dirs \
|
||||||
|
-o $HOME/minio-binaries/mc
|
||||||
|
|
||||||
|
chmod +x $HOME/minio-binaries/mc
|
||||||
|
export PATH=$PATH:$HOME/minio-binaries/
|
|
@ -0,0 +1,24 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Check for existing ENVs
|
||||||
|
if [[ -z "$ACCESSKEY" ]]; then
|
||||||
|
echo "=> No ACCESSKEY ENV found. Exit."; exit 1 ;
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z "$SECRETKEY" ]]; then
|
||||||
|
echo "=> No SECRETKEY ENV found. Exit."; exit 1 ;
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z "$SOURCE" ]]; then
|
||||||
|
echo "=> No SOURCE ENV found. Exit."; exit 1 ;
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z "$TARGET" ]]; then
|
||||||
|
echo "=> No TARGET ENV found. Exit."; exit 1 ;
|
||||||
|
fi
|
||||||
|
|
||||||
|
mc alias set s3src $SOURCE $ACCESSKEY $SECRETKEY
|
||||||
|
|
||||||
|
mc mirror -preserve --watch s3src/gitea $TARGET
|
4
s3.yaml
4
s3.yaml
|
@ -2,9 +2,9 @@
|
||||||
- name: Check SSH port
|
- name: Check SSH port
|
||||||
import_playbook: ssh.yaml
|
import_playbook: ssh.yaml
|
||||||
- name: (Re-)Deploy Minio S3
|
- name: (Re-)Deploy Minio S3
|
||||||
hosts: staging
|
hosts: all
|
||||||
roles:
|
roles:
|
||||||
- minio-dc
|
- minio-dc
|
||||||
become: true
|
become: true
|
||||||
vars:
|
vars:
|
||||||
instance_url: "{{staging_url}}"
|
instance_url: "{{prod_url}}"
|
||||||
|
|
Loading…
Reference in New Issue