image: jimmybeats/php7-mysql-python-aws-bitbucketpipelines
pipelines:
    tags:
        5.*:
            - step:
                script:
                    - git config --global user.email "bit-bucket@x-cart.com" && git config --global user.name "Auto Commit"
                    - git clone git@github.com:xcart/xcart-docs.git
                    - TAG=$(git tag --contains)
                    - cd xcart-docs  
                    - sed -i "s/x-cart-5.*-en.zip/x-cart-${TAG}-en.zip/g ; s/x-cart-5.*-en.tgz/x-cart-${TAG}-en.tgz/g" _pages/kb_en/general_setup/installation_guide.md
                    - sed -i "s/x-cart-5.*-ru.zip/x-cart-${TAG}-ru.zip/g ; s/x-cart-5.*-ru.tgz/x-cart-${TAG}-ru.tgz/g" _pages/kb_ru/general_setup/installation_guide.md
                    - git add _pages/kb_en/general_setup/installation_guide.md _pages/kb_ru/general_setup/installation_guide.md && git commit -m"Updated installation_guide.md" && git push
