<commit_before>#!/bin/sh

set -x

# Create CouchDB system tables
for table in _global_changes _metadata _replicator _users; do
  curl -X PUT http://couch:5984/$table
done

# Create cozy-stack instances
for name in "dev" "test"; do
  cozy-stack instances add \
    --dev \
    --passphrase <PASSWORD> \
    $name.cozy.tools:8080
done

# Retrieve test client ID
client_id=$(cozy-stack instances client-oauth \
  test.cozy.tools:8080 \
  http://test.cozy.tools/ \
  test \
  github.com/cozy-labs/cozy-desktop)

# Retrieve test token
token=$(cozy-stack instances token-oauth \
  test.cozy.tools:8080 \
  "$client_id" \
  io.cozy.files)

# Generate test env file
cat >/cozy-desktop/.env.test <<EOF
COZY_STACK_TOKEN=$token
NODE_ENV=test
EOF
<commit_msg>build: Install cozy-drive by default on dev instance<commit_after>#!/bin/sh

set -x

# Create CouchDB system tables
for table in _global_changes _metadata _replicator _users; do
  curl -X PUT http://couch:5984/$table
done

# Create cozy-stack instances
for name in "dev" "test"; do
  cozy-stack instances add \
    --dev \
    --passphrase <PASSWORD> \
    $name.cozy.tools:8080
done

# Install cozy-drive on dev instance
cozy-stack apps install files git://github.com/cozy/cozy-drive.git#build --domain dev.cozy.tools:8080

# Retrieve test client ID
client_id=$(cozy-stack instances client-oauth \
  test.cozy.tools:8080 \
  http://test.cozy.tools/ \
  test \
  github.com/cozy-labs/cozy-desktop)

# Retrieve test token
token=$(cozy-stack instances token-oauth \
  test.cozy.tools:8080 \
  "$client_id" \
  io.cozy.files)

# Generate test env file
cat >/cozy-desktop/.env.test <<EOF
COZY_STACK_TOKEN=$token
NODE_ENV=test
EOF

{'fraction_non_alphanumeric': 0.12253436939629408, 'fraction_numerical': 0.021518230723251645, 'mean_word_length': 3.5, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '7646336', 'n_tokens_mistral': 643, 'n_tokens_neox': 609, 'n_words': 153}