-
Notifications
You must be signed in to change notification settings - Fork 3
Migrate from version 1.x to 2.x
If you are using ce-dev 1.x and you want to migrate to 2.x, there are some previous steps before installing 2.x
The containers created for your current projects must be destroyed, because ce-dev 2.x uses new Docker images. If you have work in progress, or you need to take a database dump, please save it before destroying.
Now you can destroy the containers with:
cd path/to/your/project
ce-dev stop (to stop running containers)
ce-dev destroy
it will destroy any {project}-x container (e.g: hello-web, hello-db)
ce-dev 2.x uses ce-provision 2.x and ce-deploy 1.x under the hood.
ce-provision 2.x introduces some significant changes, so we need to apply these changes in the 'ce-dev/ansible/provision.yml' file
ce-provision 2.x categorizes now the roles (e.g, debian/, contrib/). We need to update the 'tasks' section in the 'ce-dev/ansible/provision.yml' to reflect the new structure:
- import_role:
name: _init
- import_role:
name: _meta/common_base
- import_role:
name: debian/mysql_client
- import_role:
name: debian/php-cli
- import_role:
name: debian/php-fpm
- import_role:
name: debian/nginx
- import_role:
name: debian/nodejs
- import_role:
name: _exit
if you are using any extra roles in your project, please check the new roles structure and include them accordingly
We need to include new variables inside the 'vars:' section. These new variables can be added after _env_type for clarity.
_ce_provision_username: ce-dev
_venv_path: "/home/ce-dev/ansible"
_venv_command: /usr/bin/python3 -m venv
_venv_install_username: ce-dev
_ce_ansible_timer_name: upgrade_ce_provision_ansible
Now the 'vars' section is a dictionary instead of list of vars. it means:
This
vars:
- _domain_name: www.hello.local
- _env_type: dev
- project_name: hello
becomes
vars:
_domain_name: www.hello.local
_env_type: dev
project_name: hello
For a full reference of these changes, you can check the current templates for the provision.yml and deploy.yml
if you need to keep ce-dev 1.x for some reason, you can rename the current installation before installing the new one. ce-dev is installed in '/opt/ce-dev:
cd /opt
mv ce-dev ce-dev-1
And change the symbolic link:
cd /usr/local/bin
sudo ln -s /opt/ce-dev-1/bin/ce-dev ce-dev-1
From now, ce-dev 1.x is available using 'ce-dev-1' as command