items:
    1:
        title: '1. Build'
        env: 'dev'
        commands: 
            - 'docker-compose --project-name %(appName)s --file conf/docker/docker-compose_dev.yml build --no-cache'
        vars:
            - appName
    2:
        title: '2. InitDB'
        env: 'dev'
        commands: 
            - 'docker run -v %(currentDir)s/data/mysql:/var/lib/mysql -v %(currentDir)s/dumps:/home/dumps -v %(currentDir)s/conf/scripts/mysql:/home/scripts -it %(appName)s_db sh /home/scripts/initDB.sh'
        vars:
            - appName
    3:
        title: '3. Deploy and Up'
        env: 'dev'
        commands:
            # - 'mkdir -p data/mysql'
            # - 'mkdir -p app'
            # - 'docker run -v %(currentDir)s/data/mysql:/var/lib/mysql -v %(currentDir)s/dumps:/home/dumps -v %(currentDir)s/conf/scripts/mysql:/home/scripts -it %(appName)s_db sh /home/scripts/initDB.sh'
            # - 'sh conf/scripts/deploy/dev.sh'
            # - 'docker network create -d bridge --subnet 192.168.0.0/24 --gateway 192.168.0.1 dockernet' 
            # - 'docker-compose --project-name %(appName)s --file conf/docker/docker-compose_dev.yml up --force-recreate -d'
            # - 'docker exec -it %(appName)s_workspace_1 sh /home/scripts/deploy_dev.sh'
            - 'echo "Просто склонируйте в ./app https://git.h07.ru/hrustbb2/exampleapp.git и сделайте compose install (ну, и про миграции с конфигом не забудте)"'
        vars:
            - appName
    4:
        title: '4. Up'
        env: 'dev'
        commands: 
            # - 'docker stop $(docker ps -q)'
            # - 'docker network prune -f'
            - 'docker network create -d bridge --subnet 192.168.0.0/24 --gateway 192.168.0.1 dockernet'
            - 'docker-compose --project-name %(appName)s --file conf/docker/docker-compose_dev.yml up --force-recreate -d'
        vars:
            - appName
    5:
        title: '5. Stop'
        env: 'dev'
        commands: 
            - 'docker-compose --project-name %(appName)s --file conf/docker/docker-compose_dev.yml stop'
            - 'sleep 3'
            - 'docker network rm dockernet'
        vars:
            - appName
    6:
        title: '6. Stop all'
        env: 'dev'
        commands: 
            - 'docker stop $(docker ps -q)'
            - 'docker network prune -f'
        vars:
            - appName
    7:
        title: '7. Remove'
        env: 'dev'
        commands: 
            - 'docker rm %(appName)s_php_1 --force'
            - 'docker rm %(appName)s_workspace_1 --force'
            - 'docker rm %(appName)s_db_1 --force'
            - 'docker rm %(appName)s_nginx_1 --force'
            - 'docker rm %(appName)s_nodejs_1 --force'
            - 'docker rm %(appName)s_centrifugo_1 --force'
            - 'docker rmi %(appName)s_php --force'
            - 'docker rmi %(appName)s_workspace --force'
            - 'docker rmi %(appName)s_db --force'
            - 'docker rmi %(appName)s_nginx --force'
            - 'docker rmi %(appName)s_nodejs --force'
            - 'docker rmi %(appName)s_centrifugo --force'
        vars:
            - appName
    8:
        title: '8. In php workspace'
        env: 'dev'
        commands: 
            - 'docker exec -it %(appName)s_workspace_1 /bin/bash'
        vars:
            - appName
    9:
        title: '9. In nodejs workspace'
        env: 'dev'
        commands: 
            - 'docker exec -it %(appName)s_nodejs_1 /bin/bash'
        vars:
            - appName
    10:
        title: '10. Make Dump'
        env: 'dev'
        commands: 
            - 'docker exec -it %(appName)s_db_1 sh /home/scripts/makeDump.sh %(fileName).sql'
        vars:
            - appName
            - fileName
    11:
        title: '11. SSHFS'
        items:
            1:
                title: '1. Mount'
                env: 'dev'
                commands:
                    - 'sshfs %(user)s@%(ip)s:%(remotePath)s %(currentDir)s/server'
                vars:
                    - appName
                    - user
                    - ip
                    - remotePath
            2:
                title: '2. Umount'
                env: 'dev'
                commands:
                    - 'sudo umount -l %(currentDir)s/server'
                vars:
                    - appName