<commit_before>#!/bin/bash

# Configuration variables
LINOTA_DOMAIN="lineage.lan"
LINOTA_NAME="lineage-ota"
LETSENCRYPT_EMAIL="<EMAIL>"
LINCICD_NAME="lineage-cicd"
USER_NAME="<NAME>"
USER_MAIL="<EMAIL>"
DEVICE_LIST="hammerhead" # See https://github.com/julianxhokaxhiu/docker-lineage-cicd/blob/master/Dockerfile#L22
BRANCH_NAME="cm-14.1" # See https://github.com/LineageOS/android_vendor_cm/branches
OTA_URL="$LINOTA_DOMAIN/api" # See https://blog.julianxhokaxhiu.com/how-the-cm-ota-server-works-and-how-to-implement-and-use-ours/

# Prepare the Lineage OTA data folder
echo ">> Creating /srv/data/$LINOTA_NAME folder..."
mkdir -p "/srv/data/$LINOTA_NAME" &>/dev/null

# Prepare the Lineage CICD data folder
echo ">> Creating /srv/data/$LINCICD_NAME folder..."
mkdir -p "/srv/data/$LINCICD_NAME/ccache" &>/dev/null
mkdir -p "/srv/data/$LINCICD_NAME/src" &>/dev/null

# Install Lineage OTA server
echo ">> Running Lineage OTA Server..."
docker run \
    -d \
    --name="$LINOTA_NAME" \
    --restart=always \
    -v "/srv/data/$LINOTA_NAME:/var/www/html/builds/full" \
    -e "VIRTUAL_HOST=$LINOTA_DOMAIN" \
    -e "LETSENCRYPT_HOST=$LINOTA_DOMAIN" \
    -e "LETSENCRYPT_EMAIL=$LETSENCRYPT_EMAIL" \
    julianxhokaxhiu/lineageota &>/dev/null

# Wait until the docker is up and running
echo -n ">> Waiting for Lineage OTA Server to start..."
while [ ! $(docker top $LINOTA_NAME &>/dev/null && echo $?) ]
do<commit_msg>Forgot https prefix for OTA_URL<commit_after>#!/bin/bash

# Configuration variables
LINOTA_DOMAIN="lineage.lan"
LINOTA_NAME="lineage-ota"
LETSENCRYPT_EMAIL="<EMAIL>"
LINCICD_NAME="lineage-cicd"
USER_NAME="<NAME>"
USER_MAIL="<EMAIL>"
DEVICE_LIST="hammerhead" # See https://github.com/julianxhokaxhiu/docker-lineage-cicd/blob/master/Dockerfile#L22
BRANCH_NAME="cm-14.1" # See https://github.com/LineageOS/android_vendor_cm/branches
OTA_URL="https://$LINOTA_DOMAIN/api" # See https://blog.julianxhokaxhiu.com/how-the-cm-ota-server-works-and-how-to-implement-and-use-ours/

# Prepare the Lineage OTA data folder
echo ">> Creating /srv/data/$LINOTA_NAME folder..."
mkdir -p "/srv/data/$LINOTA_NAME" &>/dev/null

# Prepare the Lineage CICD data folder
echo ">> Creating /srv/data/$LINCICD_NAME folder..."
mkdir -p "/srv/data/$LINCICD_NAME/ccache" &>/dev/null
mkdir -p "/srv/data/$LINCICD_NAME/src" &>/dev/null

# Install Lineage OTA server
echo ">> Running Lineage OTA Server..."
docker run \
    -d \
    --name="$LINOTA_NAME" \
    --restart=always \
    -v "/srv/data/$LINOTA_NAME:/var/www/html/builds/full" \
    -e "VIRTUAL_HOST=$LINOTA_DOMAIN" \
    -e "LETSENCRYPT_HOST=$LINOTA_DOMAIN" \
    -e "LETSENCRYPT_EMAIL=$LETSENCRYPT_EMAIL" \
    julianxhokaxhiu/lineageota &>/dev/null

# Wait until the docker is up and running
echo -n ">> Waiting for Lineage OTA Server to start..."
while [ ! $(docker top $LINOTA_NAME &>/dev/null && echo $?) ]
do
{'fraction_non_alphanumeric': 0.16258741258741258, 'fraction_numerical': 0.0034965034965034965, 'mean_word_length': 4.230347349177331, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 35, 'https://': 7, 'lorem ipsum': 0, 'www.': 2, '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': '2945312', 'n_tokens_mistral': 1195, 'n_tokens_neox': 1119, 'n_words': 199}