Commit 1f9daf4a by Feanil Patel Committed by GitHub

Merge pull request #3923 from edx/feanil/cleanup_old_scripts

Remove old scripts belong with jenkins jobs that we no longer use.
parents 925a6987 4e3ff194
#!/bin/bash
cd configuration
pip install -r requirements.txt
env
ansible="ansible first_in_tag_Name_${environment}-${deployment}-worker -i playbooks/ec2.py -u ubuntu -s -U www-data -a"
manage="cd /edx/app/edxapp/edx-platform && /edx/bin/python.edxapp /edx/bin/manage.edxapp lms --settings aws cert_whitelist"
echo "$username" > /tmp/username.txt
if [ "$addremove" = "add" ]; then
for x in $(cat /tmp/username.txt); do
echo "Adding $x"
$ansible "$manage --add $x -c $course_id"
done
elif [ "$addremove" = "remove" ]; then
for x in $(cat /tmp/username.txt); do
echo "Removing $x"
$ansible "$manage --del $x -c $course_id"
done
fi
rm /tmp/username.txt
cd configuration
pip install -r requirements.txt
env
ansible="ansible first_in_tag_Name_${environment}-${deployment}-worker -i playbooks/ec2.py -u ubuntu -s -U www-data -m shell -a"
manage="cd /edx/app/edxapp/edx-platform && /edx/bin/python.edxapp /edx/bin/manage.edxapp lms change_enrollment --settings aws"
if [ "$noop" = true ]; then
$ansible "$manage --noop --course $course --to $to --from $from"
else
$ansible "$manage --course $course --to $to --from $from"
fi
#!/bin/bash
cd configuration
pip install -r requirements.txt
env
ansible="ansible -v first_in_tag_Name_${environment}-${deployment}-worker -i playbooks/ec2.py -u ubuntu -s -U www-data -m shell -a"
manage="cd /edx/app/edxapp/edx-platform && /edx/bin/python.edxapp /edx/bin/manage.edxapp lms change_enrollment --settings=aws"
noop_switch=""
if [ "$noop" = true ]; then
noop_switch="--noop"
fi
$ansible "$manage $noop_switch --course $course --user $name --to $to --from $from"
#!/usr/bin/env bash
set -x
set -e
if [[ -z $WORKSPACE ]]; then
echo "Environment incorrect for this wrapper script"
env
exit 1
fi
env
cd "$WORKSPACE/edx-platform"
# install requirements
# These requirements will be installed into the shinginpanda
# virtualenv on the jenkins server and are necessary to run
# run migrations locally
pip install --exists-action w -r requirements/edx/pre.txt
pip install --exists-action w -r requirements/edx/base.txt
if [[ -f requirements/edx/post.txt ]]; then
pip install --exists-action w -r requirements/edx/post.txt
fi
if [[ -f requirements/edx/repo.txt ]]; then
pip install --exists-action w -r requirements/edx/repo.txt
fi
pip install --exists-action w -r requirements/edx/github.txt
if [[ -f requirements/edx/local.txt ]]; then
pip install --exists-action w -r requirements/edx/local.txt
fi
pip install --exists-action w -r requirements/edx/edx-private.txt
cd "$WORKSPACE/configuration/playbooks/edx-east"
if [[ -f ${WORKSPACE}/configuration-secure/ansible/vars/${deployment}.yml ]]; then
extra_var_args+=" -e@${WORKSPACE}/configuration-secure/ansible/vars/${deployment}.yml"
fi
if [[ $db_dry_run == "false" ]]; then
# Set this to an empty string if db_dry_run is
# not set. By default the db_dry_run var is
# set to --list
extra_var_args+=" -e db_dry_run=''"
fi
if [[ -f ${WORKSPACE}/configuration-secure/ansible/vars/${environment}-${deployment}.yml ]]; then
extra_var_args+=" -e@${WORKSPACE}/configuration-secure/ansible/vars/${environment}-${deployment}.yml"
fi
for extra_var in $extra_vars; do
extra_var_args+=" -e@${WORKSPACE}/configuration-secure/ansible/vars/$extra_var"
done
extra_var_args+=" -e edxapp_app_dir=${WORKSPACE}"
extra_var_args+=" -e edxapp_code_dir=${WORKSPACE}/edx-platform"
extra_var_args+=" -e edxapp_user=jenkins"
extra_var_args+=" -e EDXAPP_CFG_DIR=${WORKSPACE}"
extra_var_args+=" -e THEMES_CODE_DIR=${WORKSPACE}"
# Run migrations and replace literal '\n' with actual newlines to make the output
# easier to read
# We use the edxapp_cfg tag so that the edxapp role will generate config files but
# nothing else. The actual migrate commands are then run from the playbook.
ansible-playbook -v -c local $extra_var_args --tags edxapp_cfg -i localhost, -s -U jenkins edxapp_migrate.yml | sed 's/\\n/\n/g'
#We don't care about the exit status of the `sed`
exit ${PIPESTATUS[0]}
#!/usr/bin/env bash
# Ansible provisioning wrapper script that
# assumes the following parameters set
# as environment variables
#
# - github_username
# - server_type
# - instance_type
# - region
# - aws_account
# - keypair
# - ami
# - root_ebs_size
# - security_group
# - dns_zone
# - dns_name
# - environment
# - name_tag
export PYTHONUNBUFFERED=1
export BOTO_CONFIG=/var/lib/jenkins/${aws_account}.boto
if [[ -z $WORKSPACE ]]; then
dir=$(dirname $0)
source "$dir/ascii-convert.sh"
else
source "$WORKSPACE/configuration/util/jenkins/ascii-convert.sh"
fi
if [[ ! -f $BOTO_CONFIG ]]; then
echo "AWS credentials not found for $aws_account"
exit 1
fi
if [[ -z $sandbox_to_update ]]; then
sandbox_to_update="${BUILD_USER_ID}.sandbox.edx.org"
fi
cd $WORKSPACE/configuration/playbooks/edx-east
ansible-playbook connect_sandbox.yml -i $sandbox_to_update, -e@${WORKSPACE}/configuration-secure/ansible/vars/clone-db.yml -e EDXAPP_MYSQL_HOST=$EDXAPP_MYSQL_HOST -e edxapp_version=${edxapp_version} --user ubuntu -v
#!/bin/bash
cd configuration
pip install -r requirements.txt
env
ansible="ansible first_in_tag_Name_${environment}-${deployment}-worker -i playbooks/ec2.py -u ubuntu -s -U www-data -m shell -a"
manage="cd /edx/app/edxapp/edx-platform && /edx/bin/python.edxapp /edx/bin/manage.edxapp lms --settings aws"
if [ "$report" = "true" ]; then
$ansible "$manage gen_cert_report -c $course_id" | grep -A2 "Looking up certificate states for" | sed 's/rm:.*//'
elif [ "$regenerate" = "true" ] ; then
$ansible "$manage regenerate_user -c $course_id -u $username"
else
if [ -n "$force_certificate_state" ]; then
$ansible "$manage ungenerated_certs -c $course_id -f $force_certificate_state && $manage gen_cert_report -c $course_id" | grep -A2 "Looking up certificate states for" | sed 's/rm:.*//'
else
$ansible "$manage ungenerated_certs -c $course_id && $manage gen_cert_report -c $course_id" | grep -A2 "Looking up certificate states for" | sed 's/rm:.*//'
fi
fi
#!/usr/bin/env bash
# A simple wrapper to add ssh keys from
# This assumes that you will be running on one or more servers
# that are tagged with Name: <environment>-<deployment>-<play>
if [[
-z $WORKSPACE ||
-z $environment_tag ||
-z $deployment_tag ||
-z $play ||
-z $first_in ||
-z $public_key ||
-z $serial_count
]]; then
echo "Environment incorrect for this wrapper script"
env
exit 1
fi
cd $WORKSPACE/configuration/playbooks/edx-east
export AWS_PROFILE=$deployment_tag
ansible_extra_vars+=" -e serial_count=$serial_count -e elb_pre_post=$elb_pre_post"
if [[ ! -z "$extra_vars" ]]; then
ansible_extra_vars+=" -e $extra_vars"
fi
if [[ $check_mode == "true" ]]; then
ansible_extra_vars+=" --check"
fi
if [[ ! -z "$run_on_single_ip" ]]; then
ansible_limit+="$run_on_single_ip"
else
if [[ $first_in == "true" ]]; then
ansible_limit+="first_in_"
fi
ansible_limit+="tag_environment_${environment_tag}:&tag_deployment_${deployment_tag}"
fi
ansible_extra_vars+=" -e public_key=$public_key"
export PYTHONUNBUFFERED=1
env
ansible-playbook -v -D -u ubuntu $play -i ./ec2.py $ansible_task_tags --limit $ansible_limit -e@"$WORKSPACE/configuration-secure/ansible/vars/ubuntu-public-keys.yml" $ansible_extra_vars
rm -f $extra_vars_file
#!/bin/bash
cd configuration
pip install -r requirements.txt
env
command="/edx/bin/supervisorctl restart xqueue"
ansible tag_Name_${environment}-${deployment}-commoncluster -i playbooks/ec2.py -u ubuntu -s -a "$command"
#!/bin/bash
cd configuration
pip install -r requirements.txt
env
command="/edx/bin/supervisorctl restart xqueue_consumer"
ansible tag_Name_${environment}-${deployment}-commoncluster -i playbooks/ec2.py -u ubuntu -s -a "$command"
#!/bin/bash
cd configuration
pip install -r requirements.txt
env
command="/edx/app/xqwatcher/venvs/supervisor/bin/supervisorctl -c /edx/app/xqwatcher/supervisor/supervisord.conf restart xqwatcher"
ansible tag_Name_${environment}-${deployment}-xqwatcher -i playbooks/ec2.py -u ubuntu -s -a "$command"
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