From d36e98140c49348176d6e9c2a6c102e3dd57a81b Mon Sep 17 00:00:00 2001 From: A-312 Date: Thu, 31 Jan 2019 17:19:00 +0100 Subject: [PATCH] Init les modifications MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Deplace elasticsearch dans install au lieu de before-install Ajout de install_zds.sh Ajout de unzip dans le script d'installation d'après #5144 Ajout de jdk11 au script d'installation Ajoute zds.searchv2 à la matrix unzip en double Test rapide jdk On installe les dep MySQL seulement si nécessaire Fast try jdk (2nd try) Fix jdk enleve les dep pour généré plus rapidement Ajout de python3.4-venv pour ubuntu undo commit (remet la version de python) jdk retry fix jdk (╯°□°)╯ -O J'ai oublié -O ! CA PASSE OU CA CASSE ! OUPSSS j'ai oublié de remettre un changement après mon C/C L'avion gise sur le tarmac... Vaincu par Travis... Il n'est peut être pas trop TAR pour essayer Pas besoin de VERBOSE Enleve le "fast mode" enleve l'escape code SET JAVA_HOME Ajout de ES_JAVA_OPTS Rajout libmysql + VERBOSE globalise dep mysql Comment la ligne apt get install des dep mysql java -version --- .travis.yml | 63 +++++++++----------------------------- scripts/define_variable.sh | 6 ++++ scripts/install_zds.sh | 46 ++++++++++++++++++++++++---- 3 files changed, 61 insertions(+), 54 deletions(-) diff --git a/.travis.yml b/.travis.yml index dce4f136f7..42bc465f6e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,13 +11,7 @@ addons: firefox: "latest" apt: packages: - - mysql-server-5.6 - - mysql-client-core-5.6 - - mysql-client-5.6 - - libmysqlclient-dev - language-pack-fr - - unzip - - oracle-java9-set-default git: @@ -32,11 +26,12 @@ env: global: - secure: "azmDZZQZzf88zpbkYpLpxI66vpEVyv+kniW0QdWAt4qlys8P5OcO3VJBR5YT85vlvnjN9b6raWQAL1ymee0WmVdTmzXed8XjZv7t9QXVw7pfezxMKlEftVp/4Cu4wtvbew0ViZXNWV2hNXHzEqlhgnoIOq94i0UzZ7grMrI0xm0=" matrix: - - ZDS_TEST_JOB="zds.tutorialv2" - - ZDS_TEST_JOB="zds.member zds.utils zds.forum" - - ZDS_TEST_JOB="front zds.mp zds.gallery zds.pages zds.featured zds.notification zds.searchv2" - - ZDS_TEST_JOB="selenium" - - ZDS_TEST_JOB="doc" + - ZDS_TEST_JOB="install zds.searchv2" + #- ZDS_TEST_JOB="zds.tutorialv2" + #- ZDS_TEST_JOB="zds.member zds.utils zds.forum" + #- ZDS_TEST_JOB="front zds.mp zds.gallery zds.pages zds.featured zds.notification zds.searchv2" + #- ZDS_TEST_JOB="selenium" + #- ZDS_TEST_JOB="doc" notifications: webhooks: @@ -64,18 +59,9 @@ cache: before_install: - . ./scripts/ci_turbo.sh # This script exports environment variables, it must be sourced - - source ./scripts/define_variable.sh - - travis_retry pip install -q coveralls - - | - # install elasticsearch - if [[ "$ZDS_TEST_JOB" == *"zds.searchv2"* ]]; then - # see https://docs.travis-ci.com/user/database-setup/#Installing-specific-versions-of-ElasticSearch - curl -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-$ZDS_ELASTIC_VERSION.deb \ - && sudo dpkg -i --force-confnew elasticsearch-$ZDS_ELASTIC_VERSION.deb \ - && sudo service elasticsearch start - fi + # sudo apt-get install -y mysql-server-5.6 mysql-client-core-5.6 mysql-client-5.6 libmysqlclient-dev - | # setup mysql @@ -84,7 +70,6 @@ before_install: ./scripts/ci_mysql_setup.sh fi -install: - | # install webdriver for selenium. if [[ "$ZDS_TEST_JOB" == *"selenium"* ]]; then @@ -95,39 +80,21 @@ install: && export DISPLAY=:99.0 fi +install: - | - if [[ "$ZDS_TEST_JOB" == *"zds.tutorialv2"* ]]; then - # install latex - git clone $ZDS_LATEX_REPO - TEMPLATEDIR=$HOME/.texlive/texmf-local/tex/latex/ - ./latex-template/scripts/install_font.sh \ - && ./latex-template/scripts/install_texlive.sh \ - && export PATH=$HOME/.texlive/bin/x86_64-linux:$PATH \ - && rm -rf $TEMPLATEDIR/latex-template \ - && mkdir -p $TEMPLATEDIR && cp -r ./latex-template $TEMPLATEDIR && texhash - fi - - - | - # install and run zmarkdown - nvm install $ZDS_NODE_VERSION \ - && nvm use $ZDS_NODE_VERSION \ - && npm i -g pm2 zmarkdown \ - && cd "$(nvm which current | sed s/bin/lib/)_modules/zmarkdown/" \ - && npm run server \ - && cd $TRAVIS_BUILD_DIR + make install-linux - | - # install frontend dependencies - npm i -g yarn \ - && yarn --silent + # install jdk & elasticsearch + if [[ "$ZDS_TEST_JOB" == *"zds.searchv2"* ]]; then + ./scripts/install_zds.sh +jdk-local +elastic-local + fi - | - # install backend dependencies - if [[ "$ZDS_TEST_JOB" == *"zds."* ]] || [[ "$ZDS_TEST_JOB" == *"selenium"* ]] || [[ "$ZDS_TEST_JOB" == *"doc"* ]]; then - pip install -q -r requirements-dev.txt -r requirements-prod.txt + if [[ "$ZDS_TEST_JOB" == *"zds.tutorialv2"* ]]; then + ./scripts/install_zds.sh +tex-local fi - script: - | # lint backend diff --git a/scripts/define_variable.sh b/scripts/define_variable.sh index ebec3411bf..827c77a00e 100644 --- a/scripts/define_variable.sh +++ b/scripts/define_variable.sh @@ -19,3 +19,9 @@ fi if [[ $ZDS_LATEX_REPO == "" ]]; then ZDS_LATEX_REPO="https://github.com/zestedesavoir/latex-template.git" fi + +if [[ $ZDS_JDK_HASH == "" ]]; then + ZDS_JDK_HASH="f51449fcd52f4d52b93a989c5c56ed3c" + ZDS_JDK_VERSION="11.0.2" + ZDS_JDK_REV="+9" +fi diff --git a/scripts/install_zds.sh b/scripts/install_zds.sh index f7c9166c65..35d39984fc 100755 --- a/scripts/install_zds.sh +++ b/scripts/install_zds.sh @@ -42,13 +42,13 @@ if ! $(_in "-packages" $@) && ( $(_in "+packages" $@) || $(_in "+base" $@) || $ if [[ "$release" =~ "bionic" ]]; then REALPATH="coreutils" fi - sudo apt-get -y install git python3-dev python3-venv python3-setuptools libxml2-dev python3-lxml libxslt1-dev zlib1g-dev python3-sqlparse libjpeg8 libjpeg8-dev libfreetype6 libfreetype6-dev libffi-dev python3-pip build-essential curl $REALPATH librsvg2-bin imagemagick xzdec + sudo apt-get -y install unzip tar git python3-dev python3-venv python3-setuptools libxml2-dev python3-lxml libxslt1-dev zlib1g-dev python3-sqlparse libjpeg8 libjpeg8-dev libfreetype6 libfreetype6-dev libffi-dev python3-pip build-essential curl $REALPATH librsvg2-bin imagemagick xzdec elif [[ "$version" =~ "debian" ]]; then - sudo apt-get -y install git python3-dev python3-venv python3-setuptools libxml2-dev python3-lxml libxslt-dev libz-dev python3-sqlparse libjpeg62-turbo libjpeg62-turbo-dev libfreetype6 libfreetype6-dev libffi-dev python3-pip virtualenv build-essential curl librsvg2-bin imagemagick xzdec + sudo apt-get -y install unzip tar git python3-dev python3-venv python3-setuptools libxml2-dev python3-lxml libxslt-dev libz-dev python3-sqlparse libjpeg62-turbo libjpeg62-turbo-dev libfreetype6 libfreetype6-dev libffi-dev python3-pip virtualenv build-essential curl librsvg2-bin imagemagick xzdec elif [[ "$version" =~ "fedora" ]]; then - sudo dnf -y install git python3-devel python3-setuptools libxml2-devel python3-lxml libxslt-devel zlib-devel python3-sqlparse libjpeg-turbo-devel libjpeg-turbo-devel freetype freetype-devel libffi-devel python3-pip python-virtualenv gcc redhat-rpm-config + sudo dnf -y install unzip tar git python3-devel python3-setuptools libxml2-devel python3-lxml libxslt-devel zlib-devel python3-sqlparse libjpeg-turbo-devel libjpeg-turbo-devel freetype freetype-devel libffi-devel python3-pip python-virtualenv gcc redhat-rpm-config elif [[ "$version" =~ "arch" ]]; then - sudo pacman -Syu git wget python python-setuptools python-pip libxml2 python-lxml libxslt zlib python-sqlparse libffi libjpeg-turbo freetype2 base-devel unzip + sudo pacman -Syu unzip tar git wget python python-setuptools python-pip libxml2 python-lxml libxslt zlib python-sqlparse libffi libjpeg-turbo freetype2 base-devel else error "!! I did not detect your linux version" error "!! Please manually install the packages and run again with \`-packages\`" @@ -108,6 +108,40 @@ if ! $(_in "-node" $@) && ( $(_in "+node" $@) || $(_in "+base" $@) || $(_in "+f fi fi +# local jdk +if ! $(_in "-jdk-local" $@) && ( $(_in "+jdk-local" $@) || $(_in "+full" $@) ); then + info "* [+jdk-local] installing a local version of JDK (v$ZDS_JDK_VERSION)" + mkdir -p .local + cd .local + + if [ -d jdk ]; then # remove previous install + rm -R jdk + fi + + baseURL="https://download.oracle.com/otn-pub/java/jdk/" + foldername="jdk-${ZDS_JDK_VERSION}" + folderPATH="${ZDS_JDK_VERSION}${ZDS_JDK_REV}/${ZDS_JDK_HASH}/${foldername}_linux-x64_bin.tar.gz" + + echo "GET ${baseURL}${folderPATH}" + wget -O ${foldername}.tar.gz --header "Cookie: oraclelicense=accept-securebackup-cookie" ${baseURL}${folderPATH} + + if [[ $? == 0 ]]; then + tar xvf ${foldername}.tar.gz + rm ${foldername}.tar.gz + mv ${foldername} jdk + ./jdk/java -version + else + error "!! Cannot get jdk ${JDK_VERSION}" + exit 1 + fi + cd .. +fi + +if [ -d .local/jdk ]; then + JAVA_HOME=".local/jdk" + ES_JAVA_OPTS="-Xms512m -Xmx512m" +fi + # local elasticsearch if ! $(_in "-elastic-local" $@) && ( $(_in "+elastic-local" $@) || $(_in "+full" $@) ); then info "* [+elastic-local] installing a local version of elasticsearch (v$ZDS_ELASTIC_VERSION)" @@ -133,8 +167,8 @@ if ! $(_in "-elastic-local" $@) && ( $(_in "+elastic-local" $@) || $(_in "+full ln -s $(realpath elasticsearch/bin/elasticsearch) $VIRTUAL_ENV/bin/ else error "!! Cannot get elasticsearch ${ZDS_ELASTIC_VERSION}" - exit 1; - fi; + exit 1 + fi cd .. fi