<commit_before>#
# Jetty turbo.me file
# https://github.com/turboapps/turbome/tree/master/jetty
#
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0

###################################
# Meta tags
###################################

# Setup meta
meta title="jetty"
meta namespace="jetty" 
meta name="jetty"


###################################
# Pull dependency images
###################################

# Basic dependencies and tools
layer jre:8
using turbo/turboscript-tools:2016.8.31


###################################
# Download and install
###################################

cmd mkdir c:\Workspace
workdir c:\Workspace

# Fetch version
batch
 echo import sys > getRelease.py
 echo import requests >> getRelease.py
 echo import re >> getRelease.py
 echo import distutils.version >> getRelease.py
 echo host = 'http://repo1.maven.org/maven2/org/eclipse/jetty/jetty-distribution/' >> getRelease.py
 echo headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.3; WOW64; rv:41.0) Gecko/20100101 Firefox/41.0'} >> getRelease.py
 echo r = requests.get(host , headers=headers, timeout=10) >> getRelease.py
 echo version = max(re.findall('a href="(\d+(?:\.\d)*\.v\d+)/"', r.text), key=lambda version: distutils.version.LooseVersion(version)) >> getRelease.py
 echo r = requests.get(host + version, headers=headers, timeout=10) >> getRelease.py
 echo url = re.findall('a href="(.*?.zip)"', r.text)[0] >> getRelease.py
 echo print([version, host + version + '/' + url]) >> getRelease.py
cmd python getRelease.py

var res = last
cmd "python -c ""print(%res%[0])"""
var tag = last
meta tag=tag

cmd "python -c ""print(%res%[1])"""
var url = last

# Prepare Jetty
cmd "wget -O jetty.zip %url%"
cmd 7z x jetty.zip -oC:\Workspace\jetty
cmd del jetty.zip

var sourceFolder = "C:\Workspace\jetty\jetty-distribution-" + tag + "\*"
cmd "xcopy /E %sourceFolder% C:\Jetty\*"

cmd wget --no-check-certificate https://raw.githubusercontent.com/turboapps/turbome/master/jetty/run-jetty-bat.bat
cmd copy run-jetty-bat.bat C:\Jetty\run-jetty-bat.bat

###################################
# Environment Variables
###################################

env JETTY_HOME="C:\Jetty\"<commit_msg>Fix Jetty version parsing, so that two digits versions are parsed too<commit_after>#
# Jetty turbo.me file
# https://github.com/turboapps/turbome/tree/master/jetty
#
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0

###################################
# Meta tags
###################################

# Setup meta
meta title="jetty"
meta namespace="jetty" 
meta name="jetty"


###################################
# Pull dependency images
###################################

# Basic dependencies and tools
layer jre:8
using turbo/turboscript-tools:2016.8.31


###################################
# Download and install
###################################

cmd mkdir c:\Workspace
workdir c:\Workspace

# Fetch version
batch
 echo import sys > getRelease.py
 echo import requests >> getRelease.py
 echo import re >> getRelease.py
 echo import distutils.version >> getRelease.py
 echo host = 'http://repo1.maven.org/maven2/org/eclipse/jetty/jetty-distribution/' >> getRelease.py
 echo headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.3; WOW64; rv:41.0) Gecko/20100101 Firefox/41.0'} >> getRelease.py
 echo r = requests.get(host , headers=headers, timeout=10) >> getRelease.py
 echo version = max(re.findall('a href="(\d+(?:\.\d+)*\.v\d+)/"', r.text), key=lambda version: distutils.version.LooseVersion(version)) >> getRelease.py
 echo r = requests.get(host + version, headers=headers, timeout=10) >> getRelease.py
 echo url = re.findall('a href="(.*?.zip)"', r.text)[0] >> getRelease.py
 echo print([version, host + version + '/' + url]) >> getRelease.py
cmd python getRelease.py

var res = last
cmd "python -c ""print(%res%[0])"""
var tag = last
meta tag=tag

cmd "python -c ""print(%res%[1])"""
var url = last

# Prepare Jetty
cmd "wget -O jetty.zip %url%"
cmd 7z x jetty.zip -oC:\Workspace\jetty
cmd del jetty.zip

var sourceFolder = "C:\Workspace\jetty\jetty-distribution-" + tag + "\*"
cmd "xcopy /E %sourceFolder% C:\Jetty\*"

cmd wget --no-check-certificate https://raw.githubusercontent.com/turboapps/turbome/master/jetty/run-jetty-bat.bat
cmd copy run-jetty-bat.bat C:\Jetty\run-jetty-bat.bat

###################################
# Environment Variables
###################################

env JETTY_HOME="C:\Jetty\"
{'fraction_non_alphanumeric': 0.2630992196209587, 'fraction_numerical': 0.018729096989966554, 'mean_word_length': 5.029569892473118, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 45, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5239129', 'n_tokens_mistral': 1499, 'n_tokens_neox': 1416, 'n_words': 348}