Commit 476448c3 by Han Su Kim

Squashing Commits

New script to add to cert whitelist, modification to generate cert to allow for just one user to be generated

Minor changes to make it more readable

Typos

Adding jenkins script to run manage.py

Adding jenkins script to change course enrollment

Scripts for edge-vpc
parent a4951147
#!/bin/bash
cd configuration
pip install -r requirements.txt
env
ip=$(python playbooks/ec2.py | jq -r '."tag_Name_prod-edge-worker"[0] | strings')
ssh="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
manage="cd /edx/app/edxapp/edx-platform && sudo -u www-data /edx/bin/python.edxapp ./manage.py"
echo "$username" > /tmp/username.txt
for x in $(cat /tmp/username.txt); do
$ssh ubuntu@"$ip" "$manage lms cert_whitelist -a $x -c $course_id --settings aws"
done
rm /tmp/username.txt
#!/bin/bash
cd configuration
pip install -r requirements.txt
env
ip=$(python playbooks/ec2.py | jq -r '."tag_Name_prod-edx-worker"[0] | strings')
ssh="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
manage="cd /edx/app/edxapp/edx-platform && sudo -u www-data /edx/bin/python.edxapp ./manage.py"
echo "$username" > /tmp/username.txt
for x in $(cat /tmp/username.txt); do
$ssh ubuntu@"$ip" "$manage lms cert_whitelist -a $x -c $course_id --settings aws"
done
rm /tmp/username.txt
cd configuration
pip install -r requirements.txt
env
ip=$(python playbooks/ec2.py | jq -r '."tag_Name_prod-edge-worker"[0] | strings')
ssh="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
manage="cd /edx/app/edxapp/edx-platform && sudo -u www-data /edx/bin/python.edxapp ./manage.py lms change_enrollment"
if [ $"noop" ]; then
if [ ! -z "$username" ]; then
$ssh ubuntu@"$ip" "$manage --noop --course $course --user $name --to $to --from $from --settings aws"
else
$ssh ubuntu@"$ip" "$manage --noop --course $course --to $to --from $from --settings aws"
fi
elif [ ! -z "$username" ]; then
$ssh ubuntu@"$ip" "$manage --course $course --user $name --to $to --from $from --settings aws"
else
$ssh ubuntu@"$ip" "$manage --course $course --to $to --from $from --settings aws"
fi
fi
cd configuration
pip install -r requirements.txt
env
stageip=$(python playbooks/ec2.py | jq -r '."tag_Name_stage-edx-worker"[0] | strings')
prodip=$(python playbooks/ec2.py | jq -r '."tag_Name_prod-edx-worker"[0] | strings')
if [ "$cluster" = "prod" ]; then
ip=$stageip
else
ip=$prodip
fi
ssh="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
manage="cd /edx/app/edxapp/edx-platform && sudo -u www-data /edx/bin/python.edxapp ./manage.py lms change_enrollment"
if [ $"noop" ]; then
if [ ! -z "$username" ]; then
$ssh ubuntu@"$ip" "$manage --noop --course $course --user $name --to $to --from $from --settings aws"
else
$ssh ubuntu@"$ip" "$manage --noop --course $course --to $to --from $from --settings aws"
fi
elif [ ! -z "$username" ]; then
$ssh ubuntu@"$ip" "$manage --course $course --user $name --to $to --from $from --settings aws"
else
$ssh ubuntu@"$ip" "$manage --course $course --to $to --from $from --settings aws"
fi
fi
#!/bin/bash
cd configuration
pip install -r requirements.txt
env
ip=$(python playbooks/ec2.py | jq -r '."tag_Name_prod-edge-worker"[0] | strings')
ssh="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
manage="cd /edx/app/edxapp/edx-platform && sudo -u www-data /edx/bin/python.edxapp ./manage.py"
if [ "$service_variant" != "UNSET" ]; then
manage="$manage $service_variant"
fi
if [ "$help" = "true" ]; then
manage="$manage help"
fi
$ssh ubuntu@"$ip" "$manage $command $options --settings aws"
#!/bin/bash
cd configuration
pip install -r requirements.txt
env
stageip=$(python playbooks/ec2.py | jq -r '."tag_Name_stage-edx-worker"[0] | strings')
prodip=$(python playbooks/ec2.py | jq -r '."tag_Name_prod-edx-worker"[0] | strings')
if [ "$cluster" = "prod" ]; then
ip=$stageip
else
ip=$prodip
fi
ssh="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
manage="cd /edx/app/edxapp/edx-platform && sudo -u www-data /edx/bin/python.edxapp ./manage.py"
if [ "$service_variant" != "UNSET" ]; then
manage="$manage $service_variant"
fi
if [ "$help" = "true" ]; then
manage="$manage help"
fi
$ssh ubuntu@"$ip" "$manage $command $options --settings aws"
...@@ -4,13 +4,17 @@ cd configuration ...@@ -4,13 +4,17 @@ cd configuration
pip install -r requirements.txt pip install -r requirements.txt
env env
ip=`python playbooks/ec2.py | jq -r '."tag_Name_prod-edx-worker"[0] | strings'` ip=$(python playbooks/ec2.py | jq -r '."tag_Name_prod-edx-worker"[0] | strings')
ssh="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
manage="cd /edx/app/edxapp/edx-platform && sudo -u www-data /edx/bin/python.edxapp ./manage.py"
if [ "$report" = "true" ]; then if [ "$report" = "true" ]; then
ssh ubuntu@$ip "cd /edx/app/edxapp/edx-platform && sudo -u www-data /edx/bin/python.edxapp ./manage.py lms gen_cert_report -c $course_id --settings aws" $ssh ubuntu@"$ip" "$manage lms gen_cert_report -c $course_id --settings aws"
else elif [ ! -z "username" ]; then
ssh ubuntu@$ip "cd /edx/app/edxapp/edx-platform && sudo -u www-data /edx/bin/python.edxapp ./manage.py lms ungenerated_certs -c $course_id --settings aws" $ssh ubuntu@"$ip" "$manage lms regenerate_user -c $course_id -u $username --settings aws"
else
$ssh ubuntu@"$ip" "$manage lms ungenerated_certs -c $course_id --settings aws"
if [ ! -z "$force_certificate_state" ]; then if [ ! -z "$force_certificate_state" ]; then
ssh ubuntu@$ip "cd /edx/app/edxapp/edx-platform && sudo -u www-data /edx/bin/python.edxapp ./manage.py lms ungenerated_certs -c $course_id -f $force_certificate_state --settings aws" $ssh ubuntu@"$ip" "$manage lms ungenerated_certs -c $course_id -f $force_certificate_state --settings aws"
fi fi
fi fi
#!/bin/bash
cd configuration
pip install -r requirements.txt
env
ip=$(python playbooks/ec2.py | jq -r '."tag_Name_prod-edge-worker"[0] | strings')
ssh="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
manage="cd /edx/app/edxapp/edx-platform && sudo -u www-data /edx/bin/python.edxapp ./manage.py"
if [ "$report" = "true" ]; then
$ssh ubuntu@"$ip" "$manage lms gen_cert_report -c $course_id --settings aws"
elif [ ! -z "username" ]; then
$ssh ubuntu@"$ip" "$manage lms regenerate_user -c $course_id -u $username --settings aws"
else
$ssh ubuntu@"$ip" "$manage lms ungenerated_certs -c $course_id --settings aws"
if [ ! -z "$force_certificate_state" ]; then
$ssh ubuntu@"$ip" "$manage lms ungenerated_certs -c $course_id -f $force_certificate_state --settings aws"
fi
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment