Skip to content

Commit

Permalink
Init les modifications
Browse files Browse the repository at this point in the history
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 zestedesavoir#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
  • Loading branch information
A-312 committed Feb 6, 2019
1 parent 9018d8f commit d36e981
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 54 deletions.
63 changes: 15 additions & 48 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -84,7 +70,6 @@ before_install:
./scripts/ci_mysql_setup.sh
fi
install:
- |
# install webdriver for selenium.
if [[ "$ZDS_TEST_JOB" == *"selenium"* ]]; then
Expand All @@ -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
Expand Down
6 changes: 6 additions & 0 deletions scripts/define_variable.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
46 changes: 40 additions & 6 deletions scripts/install_zds.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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\`"
Expand Down Expand Up @@ -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)"
Expand All @@ -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

Expand Down

0 comments on commit d36e981

Please sign in to comment.