chore(upgrade): upgrade script fixes.
This commit is contained in:
parent
ed56867ad7
commit
b55c4e7545
2 changed files with 15 additions and 12 deletions
|
|
@ -8,7 +8,7 @@
|
|||
- block:
|
||||
- name: generating migration db paths
|
||||
set_fact:
|
||||
db_path: "{{dst_list | default([])}} + [ '{{ item[0] }}/*.sql' ]"
|
||||
db_path: "{{dst_list | default([])}} + [ '{{playbook_dir}}/db/init_dbs/postgresql/{{ item }}/*.sql' ]"
|
||||
with_items: "{{ migration_versions.split(',') }}"
|
||||
- name: Migrate postgresql
|
||||
shell: |
|
||||
|
|
@ -18,8 +18,7 @@
|
|||
kubectl exec -n db postgresql-postgresql-0 -- /bin/bash -c "PGPASSWORD=asayerPostgres psql -U postgres -f /tmp/$file" &> "{{ playbook_dir }}"/postgresql_init.log
|
||||
args:
|
||||
chdir: db/init_dbs/postgresql
|
||||
with_fileglob:
|
||||
- "{{ db_path }}"
|
||||
with_fileglob: "{{ db_path }}"
|
||||
tags:
|
||||
- postgresql
|
||||
- block:
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ vars_file_path=$1/scripts/helm/vars.yaml
|
|||
echo -e "OpenReplay previous version path not given.\nUsage: bash $0 /path/to/previous_openreplay_code_path"
|
||||
exit 1
|
||||
}
|
||||
[[ -f $1 ]] || {
|
||||
[[ -d $1 ]] || {
|
||||
echo -e "$1 doesn't exist. Please check the path and run\n \`bash upgrade.sh </path/to/previous/vars.yaml> \`"
|
||||
}
|
||||
which ansible &> /dev/null || {
|
||||
|
|
@ -26,6 +26,9 @@ echo -e"Updating vars.yaml\n"
|
|||
}
|
||||
|
||||
old_version=`grep openreplay_version ${vars_file_path} | cut -d "v" -f 3 | cut -d '"' -f 1`
|
||||
[[ -z $old_version ]] && {
|
||||
old_version=`grep image_tag ${vars_file_path} | cut -d "v" -f 2 | cut -d '"' -f 1`
|
||||
}
|
||||
enterprise_edition=`grep enterprise_edition_license ${vars_file_path} | cut -d ":" -f 2 | xargs`
|
||||
migration(){
|
||||
# Ref: https://stackoverflow.com/questions/1527049/how-can-i-join-elements-of-an-array-in-bash
|
||||
|
|
@ -40,13 +43,14 @@ migration(){
|
|||
echo -e "Starting db migrations"
|
||||
echo -e "Migrating versions $migration_versions"
|
||||
|
||||
ansible-playbook -c local migration.yaml -e vars.yaml -e migration_versions=${joined_migration_versions} --tags $db
|
||||
ansible-playbook -c local migration.yaml -e @vars.yaml -e migration_versions=${joined_migration_versions} --tags $db -v
|
||||
}
|
||||
}
|
||||
# As of now, we don't have any migrations to do, as there is no delta files,
|
||||
# We'll have to do full installation.
|
||||
#
|
||||
# echo -e "Migrating postgresql"
|
||||
# migration postgresql
|
||||
# Re installing everything.
|
||||
./install.sh
|
||||
echo -e "Migrating postgresql"
|
||||
migration postgresql
|
||||
# Re installing apps.
|
||||
apps=($(ls app/*.yaml|cut -d "." -f1|cut -d '/' -f2))
|
||||
apps+=(frontend nginx)
|
||||
for app in ${apps}; do
|
||||
bash -x kube-install.sh --app $app
|
||||
done
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue