<commit_before>#!/bin/sh -x

# Nuxeo setup
wget -q "http://www.nuxeo.org/static/latest-snapshot/nuxeo,tomcat.zip,5.9" -O /tmp/nuxeo-distribution-tomcat.zip
wget -q "http://www.nuxeo.org/static/latest-io-snapshot/marketplace,nuxeo,io,zip,0.3" -O /tmp/marketplace-nuxeo.io.zip

mkdir -p /tmp/nuxeo-distribution
unzip -q -d /tmp/nuxeo-distribution /tmp/nuxeo-distribution-tomcat.zip
distdir=$(/bin/ls /tmp/nuxeo-distribution | head -n 1)
mkdir -p $NUXEO_HOME
mv /tmp/nuxeo-distribution/$distdir/* $NUXEO_HOME
rm -rf /tmp/nuxeo-distribution*
chmod +x $NUXEO_HOME/bin/nuxeoctl

mkdir -p /var/lib/nuxeo
mkdir -p /var/log/nuxeo
mkdir -p /var/run/nuxeo

chown -R $NUXEO_USER:$NUXEO_USER /var/lib/nuxeo
chown -R $NUXEO_USER:$NUXEO_USER /var/log/nuxeo
chown -R $NUXEO_USER:$NUXEO_USER /var/run/nuxeo
chown -R $NUXEO_USER:$NUXEO_USER /tmp/marketplace-nuxeo.io.zip

cat << EOF >> $NUXEO_HOME/bin/nuxeo.conf
nuxeo.log.dir=/var/log/nuxeo
nuxeo.pid.dir=/var/run/nuxeo
nuxeo.data.dir=/var/lib/nuxeo/data
nuxeo.wizard.done=true
EOF

# Install nuxeo.io MP
echo 'mp-init'
su $NUXEO_USER -m -c "$NUXEOCTL mp-init"
echo 'mp-install'
su $NUXEO_USER -m -c "$NUXEOCTL mp-install --accept true /tmp/marketplace-nuxeo.io.zip"<commit_msg>NXIO-287 align manager on 5.9.4 and use a patched version of nuxeo-platform-oauth<commit_after>#!/bin/sh -x

# Nuxeo setup
wget -q "http://www.nuxeo.org/static/latest-release/nuxeo,tomcat.zip,5.9.4" -O /tmp/nuxeo-distribution-tomcat.zip
wget -q "http://www.nuxeo.org/static/latest-io-snapshot/marketplace,nuxeo,io,zip,0.3" -O /tmp/marketplace-nuxeo.io.zip

mkdir -p /tmp/nuxeo-distribution
unzip -q -d /tmp/nuxeo-distribution /tmp/nuxeo-distribution-tomcat.zip
distdir=$(/bin/ls /tmp/nuxeo-distribution | head -n 1)
mkdir -p $NUXEO_HOME
mv /tmp/nuxeo-distribution/$distdir/* $NUXEO_HOME
rm -rf /tmp/nuxeo-distribution*
chmod +x $NUXEO_HOME/bin/nuxeoctl

# Patch nuxeo-platform-oauth with a newer version. TO BE REMOVED WHEN IN 5.9.5
OAUTH_JAR=$(/bin/ls $NUXEO_HOME/nxserver/bundles/nuxeo-platform-oauth* | head -n 1)
wget -q "https://maven-eu.nuxeo.org/nexus/service/local/repositories/public-snapshots/content/org/nuxeo/ecm/platform/nuxeo-platform-oauth/5.9.5-SNAPSHOT/nuxeo-platform-oauth-5.9.5-20140806.021345-36.jar" -O $OAUTH_JAR

mkdir -p /var/lib/nuxeo
mkdir -p /var/log/nuxeo
mkdir -p /var/run/nuxeo

chown -R $NUXEO_USER:$NUXEO_USER /var/lib/nuxeo
chown -R $NUXEO_USER:$NUXEO_USER /var/log/nuxeo
chown -R $NUXEO_USER:$NUXEO_USER /var/run/nuxeo
chown -R $NUXEO_USER:$NUXEO_USER /tmp/marketplace-nuxeo.io.zip

cat << EOF >> $NUXEO_HOME/bin/nuxeo.conf
nuxeo.log.dir=/var/log/nuxeo
nuxeo.pid.dir=/var/run/nuxeo
nuxeo.data.dir=/var/lib/nuxeo/data
nuxeo.wizard.done=true
EOF

# Install nuxeo.io MP
echo 'mp-init'
su $NUXEO_USER -m -c "$NUXEOCTL mp-init"
echo 'mp-install'
su $NUXEO_USER -m -c "$NUXEOCTL mp-install --accept true /tmp/marketplace-nuxeo.io.zip"
{'fraction_non_alphanumeric': 0.16219979115906719, 'fraction_numerical': 0.014966933518969718, 'mean_word_length': 4.033274956217163, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 1, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2952159', 'n_tokens_mistral': 1446, 'n_tokens_neox': 1353, 'n_words': 220}