Skip to content

Commit

Permalink
Feature/travistests (vanessa-opensource#92)
Browse files Browse the repository at this point in the history
* Доработка сборки для трависа.
* Параллельный запуск тестов на jenkins
* Автопубликация на хабе пакетов с master/develop ветке.
  • Loading branch information
pumbaEO authored Apr 5, 2018
1 parent f2d4f3c commit 9692242
Show file tree
Hide file tree
Showing 21 changed files with 380 additions and 2,301 deletions.
178 changes: 114 additions & 64 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,86 +6,136 @@ services:
git:
depth: 5

env:
global:
- ONECVERSION=8.3.10.2639

addons:
apt:
packages:
# 7z is used for packaging (see before_deploy)
- p7zip-full

env:
global:
- ONECVERSION=8.3.11.2867
- p7zip-full

cache:
directories:
- '$HOME/.m2/repository'
- '$HOME/.sonar/cache'
- '$HOME/docker'
before_cache:
# Save tagged docker images
- >
mkdir -p $HOME/docker && docker images -a --filter='dangling=false' --format '{{.Repository}}:{{.Tag}} {{.ID}}'
| xargs -n 2 -t sh -c 'test -e $HOME/docker/$1.tar.gz || docker save $0 | gzip -2 > $HOME/docker/$1.tar.gz'
- '$TRAVIS_BUILD_DIR/build'
- '$TRAVIS_BUILD_DIR/.forbuild'

before_install:
- if [[ -d $HOME/docker ]]; then ls $HOME/docker/*.tar.gz | xargs -I {file} sh -c "zcat {file} | docker load"; fi
# Fetch base image and build new container
- sudo ./tools/linux/dockerdownload.sh
#- docker images -a --filter=reference='onec32/client:8.3.10.2639' --format '{{.ID}}' || wget -nv --continue -O - $URL_TARCLIENT | xz -d | docker load
#- wget --continue -O ./build/client32.tar.xz $URL_TARCLIENT
#- xz -dc ./build/client32.tar.xz | docker load
- docker pull wernight/ngrok
- docker images | grep onec

install:
- docker pull evilbeaver/onescript:1.0.19
before_cache:
- sudo chown $USER -R $TRAVIS_BUILD_DIR/build
- rm -rf $TRAVIS_BUILD_DIR/build/ib
- rm -rf $TRAVIS_BUILD_DIR/build/ibservice
- rm -rf $TRAVIS_BUILD_DIR/build/ibxdd
- rm -f $TRAVIS_BUILD_DIR/build/ib
- rm -rf $TRAVIS_BUILD_DIR/build/ib
- rm -rf $TRAVIS_BUILD_DIR/build/ibservicexdd
- rm -rf $TRAVIS_BUILD_DIR/build/ServiceBases


script:
- sudo docker run --detach -e XVFB_RESOLUTION=1920x1080x24 --volume="${PWD}":/home/ubuntu/code onec32/client:${ONECVERSION} client > /tmp/container_id
- sudo docker ps && sleep 5
- sudo docker run -d -p 4040:4040 --link "$(cat /tmp/container_id)":http wernight/ngrok ngrok http http:6080 > /tmp/container_idngrok
- sleep 5 && echo $(curl -s http://127.0.0.1:4040/status | grep -P "http://.*?ngrok.io" -oh)"/vnc_auto.html"
- sudo docker exec -u ubuntu "$(cat /tmp/container_id)" /bin/bash -c "cd /home/ubuntu/code; DISPLAY=:1.0 wget -q --continue -O /tmp/oscript.deb http://oscript.io/downloads/latest/onescript-engine_1.0.19_all.deb && sudo dpkg -i /tmp/oscript.deb"
- sudo docker exec -u ubuntu "$(cat /tmp/container_id)" /bin/bash -c "cd /home/ubuntu/code; DISPLAY=:1.0 sudo opm install && sudo opm update -all"
- sudo docker exec -u ubuntu "$(cat /tmp/container_id)" /bin/bash -c "cd /home/ubuntu/code; DISPLAY=:1.0 sudo opm run init"
#- sudo docker exec -u ubuntu "$(cat /tmp/container_id)" /bin/bash -c "cd /home/ubuntu/code; DISPLAY=:1.0 sudo opm run vanessa all --path ./features/Core --settings ./tools/JSON/VBParams8310UF.json"
- sudo docker exec -u ubuntu "$(cat /tmp/container_id)" /bin/bash -c "cd /home/ubuntu/code; DISPLAY=:1.0 sudo opm build ./"
# Clean up
- sudo docker stop "$(cat /tmp/container_id)"
- sudo docker stop "$(cat /tmp/container_idngrok )"
- sudo 7z a add.tar ./.forbuild/features/ ./.forbuild/lib ./.forbuild/locales ./.forbuild/plugins ./.forbuild/vendor ./.forbuild/bddRunner.epf ./.forbuild/xddTestRunner.epf
- sudo 7z a add.7z ./.forbuild/features/ ./.forbuild/lib ./.forbuild/locales ./.forbuild/plugins ./.forbuild/vendor ./.forbuild/bddRunner.epf ./.forbuild/xddTestRunner.epf
- sudo 7z a add.tar.gz add.tar
- sudo 7z a add.tar.bz2 add.tar

#install:
# - docker pull evilbeaver/onescript:1.0.19

notifications:
email: true
jobs:
include:
- stage: compile
script:
- sudo docker run --detach -e XVFB_RESOLUTION=1920x1080x24 --volume="${PWD}":/home/ubuntu/code onec32/client:${ONECVERSION} client > /tmp/container_id
- sudo docker ps && sleep 5
- sudo docker exec -u ubuntu "$(cat /tmp/container_id)" /bin/bash -c "cd /home/ubuntu/code; DISPLAY=:1.0 wget -q --continue -O /tmp/oscript.deb http://oscript.io/downloads/night-build/onescript-engine_1.0.20_all.deb && sudo dpkg -i /tmp/oscript.deb"
- sudo docker exec -u ubuntu "$(cat /tmp/container_id)" /bin/bash -c "cd /home/ubuntu/code; DISPLAY=:1.0 sudo opm install > /dev/null 2>&1 && sudo opm update -all > /dev/null 2>&1"
- sudo docker exec -u ubuntu "$(cat /tmp/container_id)" /bin/bash -c "cd /home/ubuntu/code; DISPLAY=:1.0 sudo opm run init file --buildFolderPath ./build"
- sudo docker stop "$(cat /tmp/container_id)"

deploy:
- provider: releases
api_key:
secure: "$GITHUB_OAUTH_TOKEN"
file:
- "add.tar.gz"
- "add.7z"
- "add-*.ospx"
- "add.tar.bz2"
file_glob: "true"
skip_cleanup: true
on:
tags: true
branch: master

- provider: script
skip_cleanup: true
script: docker run -it -v $(pwd):/work_dir evilbeaver/onescript:1.0.19 sh -c 'cd /work_dir; opm push --token $GITHUB_OAUTH_TOKEN --channel dev --file ./add-*.ospx; exit'
on:
branch: develop
- provider: script
skip_cleanup: true
script: docker run -it -v $(pwd):/work_dir evilbeaver/onescript:1.0.19 sh -c 'cd /work_dir; opm push --token $GITHUB_OAUTH_TOKEN --channel stable --file ./add-*.ospx; exit'
on:
branch: master
tags: true
- stage: test
script:
- sudo docker run --detach -e XVFB_RESOLUTION=1920x1080x24 --volume="${PWD}":/home/ubuntu/code onec32/client:${ONECVERSION} client > /tmp/container_id
- sudo docker ps && sleep 5
- sudo docker run -d -p 4040:4040 --link "$(cat /tmp/container_id)":http wernight/ngrok ngrok http http:6080 > /tmp/container_idngrok
- sleep 5 && echo $(curl -s http://127.0.0.1:4040/status | grep -P "http://.*?ngrok.io" -oh)"/vnc_auto.html"
- sudo docker exec -u ubuntu "$(cat /tmp/container_id)" /bin/bash -c "cd /home/ubuntu/code; DISPLAY=:1.0 wget -q --continue -O /tmp/oscript.deb http://oscript.io/downloads/night-build/onescript-engine_1.0.20_all.deb && sudo dpkg -i /tmp/oscript.deb"
- sudo docker exec -u ubuntu "$(cat /tmp/container_id)" /bin/bash -c "cd /home/ubuntu/code; DISPLAY=:1.0 sudo opm install > /dev/null 2>&1 && sudo opm update -all > /dev/null 2>&1"
- ./tools/linux/travistest.sh ./features/StepsRunner/
- sudo docker exec -u ubuntu "$(cat /tmp/container_id)" /bin/bash -c "cd /home/ubuntu/code; DISPLAY=:1.0 sudo opm run initib file --buildFolderPath ./build"
- sudo docker exec -u ubuntu "$(cat /tmp/container_id)" /bin/bash -c "cd /home/ubuntu/code; DISPLAY=:1.0 sudo opm run vanessatravis all --path ./features/StepsRunner/ --settings ./tools/JSON/VBParams8310linux.json"
- sudo docker exec -u ubuntu "$(cat /tmp/container_id)" /bin/bash -c "cd /home/ubuntu/code; DISPLAY=:1.0 sudo opm run vanessatravis all --path ./features/StepsProgramming/ --settings ./tools/JSON/VBParams8310linux.json"
- sudo docker exec -u ubuntu "$(cat /tmp/container_id)" /bin/bash -c "cd /home/ubuntu/code; DISPLAY=:1.0 sudo opm run vanessatravis all --path ./features/Core/FeatureLoad/ --settings ./tools/JSON/VBParams8310linux.json"
- sudo docker stop "$(cat /tmp/container_id)"
- sudo docker stop "$(cat /tmp/container_idngrok )"

- stage: test
script:
- sudo docker run --detach -e XVFB_RESOLUTION=1920x1080x24 --volume="${PWD}":/home/ubuntu/code onec32/client:${ONECVERSION} client > /tmp/container_id
- sudo docker ps && sleep 5
- sudo docker run -d -p 4040:4040 --link "$(cat /tmp/container_id)":http wernight/ngrok ngrok http http:6080 > /tmp/container_idngrok
- sleep 5 && echo $(curl -s http://127.0.0.1:4040/status | grep -P "http://.*?ngrok.io" -oh)"/vnc_auto.html"
- sudo docker exec -u ubuntu "$(cat /tmp/container_id)" /bin/bash -c "cd /home/ubuntu/code; DISPLAY=:1.0 wget -q --continue -O /tmp/oscript.deb http://oscript.io/downloads/night-build/onescript-engine_1.0.20_all.deb && sudo dpkg -i /tmp/oscript.deb"
- sudo docker exec -u ubuntu "$(cat /tmp/container_id)" /bin/bash -c "cd /home/ubuntu/code; DISPLAY=:1.0 sudo opm install > /dev/null 2>&1 && sudo opm update -all > /dev/null 2>&1"
- ./tools/linux/travistest.sh ./features/Core/Translate/
- sudo docker exec -u ubuntu "$(cat /tmp/container_id)" /bin/bash -c "cd /home/ubuntu/code; DISPLAY=:1.0 sudo opm run initib file --buildFolderPath ./build"
- sudo docker exec -u ubuntu "$(cat /tmp/container_id)" /bin/bash -c "cd /home/ubuntu/code; DISPLAY=:1.0 sudo opm run vanessatravis all --path ./features/Core/Translate/ --settings ./tools/JSON/VBParams8310linux.json"
- sudo docker exec -u ubuntu "$(cat /tmp/container_id)" /bin/bash -c "cd /home/ubuntu/code; DISPLAY=:1.0 sudo opm run vanessatravis all --path ./features/Core/FeatureReader/ --settings ./tools/JSON/VBParams8310linux.json"
- sudo docker exec -u ubuntu "$(cat /tmp/container_id)" /bin/bash -c "cd /home/ubuntu/code; DISPLAY=:1.0 sudo opm run vanessatravis all --path ./features/Core/FeatureReader/ --settings ./tools/JSON/VBParams8310linux.json"
- sudo docker stop "$(cat /tmp/container_id)"
- sudo docker stop "$(cat /tmp/container_idngrok )"

- stage: test
script:
- sudo docker run --detach -e XVFB_RESOLUTION=1920x1080x24 --volume="${PWD}":/home/ubuntu/code onec32/client:${ONECVERSION} client > /tmp/container_id
- sudo docker ps && sleep 5
- sudo docker run -d -p 4040:4040 --link "$(cat /tmp/container_id)":http wernight/ngrok ngrok http http:6080 > /tmp/container_idngrok
- sleep 5 && echo $(curl -s http://127.0.0.1:4040/status | grep -P "http://.*?ngrok.io" -oh)"/vnc_auto.html"
- sudo docker exec -u ubuntu "$(cat /tmp/container_id)" /bin/bash -c "cd /home/ubuntu/code; DISPLAY=:1.0 wget -q --continue -O /tmp/oscript.deb http://oscript.io/downloads/night-build/onescript-engine_1.0.20_all.deb && sudo dpkg -i /tmp/oscript.deb"
- sudo docker exec -u ubuntu "$(cat /tmp/container_id)" /bin/bash -c "cd /home/ubuntu/code; DISPLAY=:1.0 sudo opm install > /dev/null 2>&1 && sudo opm update -all > /dev/null 2>&1"
- ./tools/linux/travistest.sh ./features/Core/FeatureReader/
- sudo docker exec -u ubuntu "$(cat /tmp/container_id)" /bin/bash -c "cd /home/ubuntu/code; DISPLAY=:1.0 sudo opm run initib file --buildFolderPath ./build"
- sudo docker exec -u ubuntu "$(cat /tmp/container_id)" /bin/bash -c "cd /home/ubuntu/code; DISPLAY=:1.0 sudo opm run vanessatravis all --path ./features/Core/TestClient/ --settings ./tools/JSON/VBParams8310linux.json"
- sudo docker stop "$(cat /tmp/container_id)"
- sudo docker stop "$(cat /tmp/container_idngrok )"

- stage: delpoy
script:
- sudo docker run --detach -e XVFB_RESOLUTION=1920x1080x24 --volume="${PWD}":/home/ubuntu/code onec32/client:${ONECVERSION} client > /tmp/container_id
- sudo docker ps && sleep 5
- sudo docker run -d -p 4040:4040 --link "$(cat /tmp/container_id)":http wernight/ngrok ngrok http http:6080 > /tmp/container_idngrok
- sleep 5 && echo $(curl -s http://127.0.0.1:4040/status | grep -P "http://.*?ngrok.io" -oh)"/vnc_auto.html"
- sudo docker exec -u ubuntu "$(cat /tmp/container_id)" /bin/bash -c "cd /home/ubuntu/code; DISPLAY=:1.0 wget -q --continue -O /tmp/oscript.deb http://oscript.io/downloads/night-build/onescript-engine_1.0.20_all.deb && sudo dpkg -i /tmp/oscript.deb"
- sudo docker exec -u ubuntu "$(cat /tmp/container_id)" /bin/bash -c "cd /home/ubuntu/code; DISPLAY=:1.0 sudo opm install > /dev/null 2>&1 && sudo opm update -all > /dev/null 2>&1"
- sudo docker exec -u ubuntu "$(cat /tmp/container_id)" /bin/bash -c "cd /home/ubuntu/code; DISPLAY=:1.0 sudo opm build ./"
- sudo chown $USER -R ./
- 7z a add.tar ./.forbuild/features/ ./.forbuild/lib ./.forbuild/locales ./.forbuild/tests/smoke ./.forbuild/plugins ./.forbuild/vendor ./.forbuild/bddRunner.epf ./.forbuild/xddTestRunner.epf
- 7z a add.7z ./.forbuild/features/ ./.forbuild/lib ./.forbuild/locales ./.forbuild/tests/smoke/ .forbuild/plugins ./.forbuild/vendor ./.forbuild/bddRunner.epf ./.forbuild/xddTestRunner.epf
- 7z a add.tar.gz add.tar
- 7z a add.tar.bz2 add.tar
deploy:
- provider: releases
api_key:
secure: "$GITHUB_OAUTH_TOKEN"
file:
- "add.tar.gz"
- "add.7z"
- "add-*.ospx"
- "add.tar.bz2"
file_glob: "true"
skip_cleanup: true
on:
tags: true
branch: master
#- provider: script
# skip_cleanup: true
# script: docker run -it -e GITHUB_OAUTH_TOKEN -v $(pwd):/work_dir onec32/client:${ONECVERSION} sh -c 'cd /work_dir; opm push --token $GITHUB_OAUTH_TOKEN --channel dev --file ./add-*.ospx; exit'
# on:
# branch: develop
#- provider: script
# skip_cleanup: true
# script: docker run -it -e GITHUB_OAUTH_TOKEN -v $(pwd):/work_dir onec32/client:${ONECVERSION} sh -c 'cd /work_dir; opm push --token $GITHUB_OAUTH_TOKEN --channel stable --file ./add-*.ospx; exit'
# on:
# branch: master
# tags: true
Loading

0 comments on commit 9692242

Please sign in to comment.