<commit_before>#!/usr/bin/env bash
set -euxo pipefail

cd bbl-state/bbl-state
source <(bbl print-env)
BOSH_NAME=$(bosh int <(bbl outputs) --path /director_name); export BOSH_NAME
JENKINS_PASSWORD=$(credhub get -j -n "/$BOSH_NAME/$BOSH_DEPLOYMENT/jenkins_admin_password" | jq -r .value)
sleep 10 # Sleeping because this curl lacks the --retry-connrefused
bosh -d $BOSH_DEPLOYMENT ssh jenkins-master/0 -c "curl -S --retry-max-time 300 --retry-delay 1 --retry 300 http://localhost:8080/login"
cd ../../devtools-boshrelease-ci/ci/tasks/
bosh -d $BOSH_DEPLOYMENT scp test-jenkins-run-job.xml jenkins-master/0:/tmp/test-jenkins-run-job.xml
bosh -d $BOSH_DEPLOYMENT ssh jenkins-master/0 -c "curl -SLo /opt/jenkins-cli.jar http://localhost:8080/jnlpJars/jenkins-cli.jar"
bosh -d $BOSH_DEPLOYMENT ssh jenkins-master/0 -c "java -jar /opt/jenkins-cli.jar -auth administrator:$JENKINS_PASSWORD -s http://localhost:8080 create-job print_env < /tmp/test-jenkins-run-job.xml"
bosh -d $BOSH_DEPLOYMENT ssh jenkins-master/0 -c "java -jar /opt/jenkins-cli.jar -auth administrator:$JENKINS_PASSWORD -s http://localhost:8080 build print_env -f -v"<commit_msg>Hide Jenkins password in test script and set CLI permissions<commit_after>#!/usr/bin/env bash
set -euo pipefail

cd bbl-state/bbl-state
source <(bbl print-env)
BOSH_NAME=$(bosh int <(bbl outputs) --path /director_name); export BOSH_NAME
JENKINS_PASSWORD=$(credhub get -j -n "/$BOSH_NAME/$BOSH_DEPLOYMENT/jenkins_admin_password" | jq -r .value)
sleep 10 # Sleeping because this curl lacks the --retry-connrefused
bosh -d $BOSH_DEPLOYMENT ssh jenkins-master/0 -c "curl -S --retry-max-time 300 --retry-delay 1 --retry 300 http://localhost:8080/login"
cd ../../devtools-boshrelease-ci/ci/tasks/
bosh -d $BOSH_DEPLOYMENT scp test-jenkins-run-job.xml jenkins-master/0:/tmp/test-jenkins-run-job.xml
bosh -d $BOSH_DEPLOYMENT ssh jenkins-master/0 -c "sudo curl -SLo /opt/jenkins-cli.jar http://localhost:8080/jnlpJars/jenkins-cli.jar"
bosh -d $BOSH_DEPLOYMENT ssh jenkins-master/0 -c "sudo chmod +r /opt/jenkins-cli.jar"
bosh -d $BOSH_DEPLOYMENT ssh jenkins-master/0 -c "java -jar /opt/jenkins-cli.jar -auth administrator:$JENKINS_PASSWORD -s http://localhost:8080 create-job print_env < /tmp/test-jenkins-run-job.xml"
bosh -d $BOSH_DEPLOYMENT ssh jenkins-master/0 -c "java -jar /opt/jenkins-cli.jar -auth administrator:$JENKINS_PASSWORD -s http://localhost:8080 build print_env -f -v"
{'fraction_non_alphanumeric': 0.14161490683229813, 'fraction_numerical': 0.02525879917184265, 'mean_word_length': 4.240780911062907, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, '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': '223767', 'n_tokens_mistral': 1041, 'n_tokens_neox': 957, 'n_words': 221}