Commit f79f6866 by Han Su Kim

Merge pull request #1438 from edx/han/jenkins-certs

Jenkins Scripts to work with VPC
parents 317a8ca3 1c4ed658
#!/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
pip install -r requirements.txt
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
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"
else
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"
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 gen_cert_report -c $course_id --settings aws"
elif [ "$regenerate" = "true" ] ; 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 [ "$force_certificate_state" ]; then
$ssh ubuntu@"$ip" "$manage lms ungenerated_certs -c $course_id -f $force_certificate_state --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 [ "$report" = "true" ]; then
$ssh ubuntu@"$ip" "$manage lms gen_cert_report -c $course_id --settings aws"
elif [ "$regenerate" = "true" ] ; 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 [ "$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