stages:
        - test
        - deploy
        - post-deploy

test:
        stage: test
        only:
                - tags
                - master
        artifacts:
                name: test-${CI_COMMIT_REF_NAME}.log
                untracked: true
                when: on_failure
                paths:
                        - test/
        script:
                - 'composer install'
                - 'make test'

mirror:
        stage: post-deploy
        only:
                - tags
                - master
        script:
                - 'for url in $MIRROR_GIT_URLS ; do echo ; echo "$url" ; git push -f "$url" --tags origin/master:refs/heads/master; done'

doc:
        stage: deploy
        only:
                - tags
                - master
        script:
                - 'composer install'
                - 'echo "Destination: $DOC_INSTALL_DESTINATION/"'
                - 'test -n "$DOC_INSTALL_DESTINATION"'
                - '[ -d "$DOC_INSTALL_DESTINATION/$CI_BUILD_REF_NAME/" ] || mkdir -pv "$DOC_INSTALL_DESTINATION/$CI_BUILD_REF_NAME/"'
                - 'make doc'
                - 'rsync -r --stats "./doc/doxygen/html/" "$DOC_INSTALL_DESTINATION/$CI_BUILD_REF_NAME/"'


stages:
        - test
        - deploy
        - post-deploy

test:
        stage: test
        only:
                - tags
                - master
        artifacts:
                name: test-${CI_COMMIT_REF_NAME}.log
                untracked: true
                when: on_failure
                paths:
                        - test/
        script:
                - 'composer install'
                - 'make test'

doc:
        stage: deploy
        only:
                - tags
                - master
        script:
                - 'composer install'
                - 'echo "Destination: $DOC_INSTALL_DESTINATION/"'
                - 'test -n "$DOC_INSTALL_DESTINATION"'
                - '[ -d "$DOC_INSTALL_DESTINATION/$CI_BUILD_REF_NAME/" ] || mkdir -pv "$DOC_INSTALL_DESTINATION/$CI_BUILD_REF_NAME/"'
                - 'make doc'
                - 'rsync -r --stats "./doc/doxygen/html/" "$DOC_INSTALL_DESTINATION/$CI_BUILD_REF_NAME/"'


Remove repository mirror from CI
Remove repository mirror from CI
