items:
    1:
        title: '1. Build'
        env: 'test'
        commands: 
            - 'docker-compose --project-name %(appName)s --file conf/docker/docker-compose_prod.yml build --no-cache'
        vars:
            - appName
    2:
        title: '2. InitDB'
        env: 'test'
        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: 'test'
        commands:
            - 'mkdir -p data/mysql'
            - 'mkdir -p app'
            - 'sh conf/scripts/deploy/test.sh' 
            - 'docker-compose --project-name %(appName)s --file conf/docker/docker-compose_prod.yml up --force-recreate -d'
        vars:
            - appName
    4:
        title: '4. Up'
        env: 'test'
        commands: 
            - 'docker-compose --project-name %(appName)s --file conf/docker/docker-compose_prod.yml up --force-recreate -d'
        vars:
            - appName
    5:
        title: '5. Stop'
        env: 'test'
        commands: 
            - 'docker-compose --project-name %(appName)s --file conf/docker/docker-compose_prod.yml stop'
            - 'sleep 3'
            - 'docker network rm dockernet'
        vars:
            - appName
    6:
        title: '6. Remove'
        env: 'test'
        commands: 
            - 'docker rm %(appName)s_php_1 --force'
            - 'docker rm %(appName)s_db_1 --force'
            - 'docker rm %(appName)s_nginx_1 --force'
            - 'docker rm %(appName)s_ftp_1 --force'
            - 'docker rm %(appName)s_elastic_1 --force'
            - 'docker rm %(appName)s_redis_1 --force'
            - 'docker rmi %(appName)s_php --force'
            - 'docker rmi %(appName)s_db --force'
            - 'docker rmi %(appName)s_nginx --force'
            - 'docker rm %(appName)s_ftp --force'
            - 'docker rm %(appName)s_elastic --force'
            - 'docker rm %(appName)s_redis --force'
        vars:
            - appName