issue-certificates-edge.sh 811 Bytes
Newer Older
Han Su Kim committed
1 2 3 4 5 6 7 8 9 10 11 12
#!/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"
13
elif [ "$regenerate" = "true" ] ; then
Han Su Kim committed
14 15 16
    $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"
17
  if [ "$force_certificate_state" ]; then
Han Su Kim committed
18 19 20
    $ssh ubuntu@"$ip" "$manage lms ungenerated_certs -c $course_id -f $force_certificate_state --settings aws"
  fi
fi