mirror of
https://github.com/makeplane/plane
synced 2025-08-07 19:59:33 +00:00
[INFRA-208] Reorganize deployment structure and update build workflows (#7391)
* refactor: reorganize deployment structure and update build workflows - Restructure deployment directories from deploy/ to deployments/ - Move selfhost files to deployments/cli/community/ - Add new AIO community deployment setup - Update GitHub Actions workflows for new directory structure - Add Caddy proxy configuration for CE deployment - Remove deprecated AIO build files and workflows - Update build context paths in install scripts * chore: update Dockerfile and supervisor configuration - Changed `apk add` command in Dockerfile to use `--no-cache` for better image size management. - Updated `build.sh` to ensure proper directory navigation with quotes around `dirname "$0"`. - Modified `supervisor.conf` to set `stderr_logfile_maxbytes` to 50MB and added `stderr_logfile_backups` for better log management across multiple services. * chore: consistent node and python version --------- Co-authored-by: sriramveeraghanta <veeraghanta.sriram@gmail.com>
This commit is contained in:
118
deployments/cli/community/migration-0.13-0.14.sh
Executable file
118
deployments/cli/community/migration-0.13-0.14.sh
Executable file
@@ -0,0 +1,118 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo '
|
||||
******************************************************************
|
||||
|
||||
This script is solely for the migration purpose only.
|
||||
This is a 1 time migration of volume data from v0.13.2 => v0.14.x
|
||||
|
||||
Assumption:
|
||||
1. Postgres data volume name ends with _pgdata
|
||||
2. Minio data volume name ends with _uploads
|
||||
3. Redis data volume name ends with _redisdata
|
||||
|
||||
Any changes to this script can break the migration.
|
||||
|
||||
Before you proceed, make sure you run the below command
|
||||
to know the docker volumes
|
||||
|
||||
docker volume ls -q | grep -i "_pgdata"
|
||||
docker volume ls -q | grep -i "_uploads"
|
||||
docker volume ls -q | grep -i "_redisdata"
|
||||
|
||||
*******************************************************
|
||||
'
|
||||
|
||||
DOWNLOAD_FOL=./download
|
||||
rm -rf ${DOWNLOAD_FOL}
|
||||
mkdir -p ${DOWNLOAD_FOL}
|
||||
|
||||
function volumeExists {
|
||||
if [ "$(docker volume ls -f name=$1 | awk '{print $NF}' | grep -E '^'$1'$')" ]; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
function readPrefixes(){
|
||||
echo ''
|
||||
echo 'Given below list of REDIS volumes, identify the prefix of source and destination volumes leaving "_redisdata" '
|
||||
echo '---------------------'
|
||||
docker volume ls -q | grep -i "_redisdata"
|
||||
echo ''
|
||||
|
||||
read -p "Provide the Source Volume Prefix : " SRC_VOL_PREFIX
|
||||
until [ "$SRC_VOL_PREFIX" ]; do
|
||||
read -p "Provide the Source Volume Prefix : " SRC_VOL_PREFIX
|
||||
done
|
||||
|
||||
read -p "Provide the Destination Volume Prefix : " DEST_VOL_PREFIX
|
||||
until [ "$DEST_VOL_PREFIX" ]; do
|
||||
read -p "Provide the Source Volume Prefix : " DEST_VOL_PREFIX
|
||||
done
|
||||
|
||||
echo ''
|
||||
echo 'Prefix Provided '
|
||||
echo " Source : ${SRC_VOL_PREFIX}"
|
||||
echo " Destination : ${DEST_VOL_PREFIX}"
|
||||
echo '---------------------------------------'
|
||||
}
|
||||
|
||||
function migrate(){
|
||||
|
||||
SRC_VOLUME=${SRC_VOL_PREFIX}_${VOL_NAME_SUFFIX}
|
||||
DEST_VOLUME=${DEST_VOL_PREFIX}_${VOL_NAME_SUFFIX}
|
||||
|
||||
if volumeExists $SRC_VOLUME; then
|
||||
if volumeExists $DEST_VOLUME; then
|
||||
GOOD_TO_GO=1
|
||||
else
|
||||
echo "Destination Volume '$DEST_VOLUME' does not exist"
|
||||
echo ''
|
||||
fi
|
||||
else
|
||||
echo "Source Volume '$SRC_VOLUME' does not exist"
|
||||
echo ''
|
||||
fi
|
||||
|
||||
if [ $GOOD_TO_GO = 1 ]; then
|
||||
|
||||
echo "MIGRATING ${VOL_NAME_SUFFIX} FROM ${SRC_VOLUME} => ${DEST_VOLUME}"
|
||||
|
||||
TEMP_CONTAINER=$(docker run -d -v $SRC_VOLUME:$CONTAINER_VOL_FOLDER busybox true)
|
||||
docker cp -q $TEMP_CONTAINER:$CONTAINER_VOL_FOLDER ${DOWNLOAD_FOL}/${VOL_NAME_SUFFIX}
|
||||
docker rm $TEMP_CONTAINER &> /dev/null
|
||||
|
||||
TEMP_CONTAINER=$(docker run -d -v $DEST_VOLUME:$CONTAINER_VOL_FOLDER busybox true)
|
||||
if [ "$VOL_NAME_SUFFIX" = "pgdata" ]; then
|
||||
docker cp -q ${DOWNLOAD_FOL}/${VOL_NAME_SUFFIX} $TEMP_CONTAINER:$CONTAINER_VOL_FOLDER/_temp
|
||||
docker run --rm -v $DEST_VOLUME:$CONTAINER_VOL_FOLDER \
|
||||
-e DATA_FOLDER="${CONTAINER_VOL_FOLDER}" \
|
||||
busybox /bin/sh -c 'cp -Rf $DATA_FOLDER/_temp/* $DATA_FOLDER '
|
||||
else
|
||||
docker cp -q ${DOWNLOAD_FOL}/${VOL_NAME_SUFFIX} $TEMP_CONTAINER:$CONTAINER_VOL_FOLDER
|
||||
fi
|
||||
docker rm $TEMP_CONTAINER &> /dev/null
|
||||
|
||||
echo ''
|
||||
fi
|
||||
}
|
||||
|
||||
readPrefixes
|
||||
|
||||
# MIGRATE DB
|
||||
CONTAINER_VOL_FOLDER=/var/lib/postgresql/data
|
||||
VOL_NAME_SUFFIX=pgdata
|
||||
migrate
|
||||
|
||||
# MIGRATE REDIS
|
||||
CONTAINER_VOL_FOLDER=/data
|
||||
VOL_NAME_SUFFIX=redisdata
|
||||
migrate
|
||||
|
||||
# MIGRATE MINIO
|
||||
CONTAINER_VOL_FOLDER=/export
|
||||
VOL_NAME_SUFFIX=uploads
|
||||
migrate
|
||||
|
||||
Reference in New Issue
Block a user