Skip to content

Instantly share code, notes, and snippets.

@yarko
Last active April 9, 2020 15:51
Show Gist options
  • Save yarko/678d095a08dc0e9182fe to your computer and use it in GitHub Desktop.
Save yarko/678d095a08dc0e9182fe to your computer and use it in GitHub Desktop.
edx injera theming test-kit
---
## build-version.yml
#
# Use with ansible bringup;
# - *_version specs can be branches, tags, or commits
# - you can comment out any items you do not want to override;
# they will retain their settings as in ansible playbooks
# for those items.
#
# github.com account names / repo owners:
#
OPEN_EDX: edx # Open edX repos
GIT_ACCT: yarko # your github acct (your development repos), or edx
# Theme repo;
# Stanford-Online is the Canonical theme;
# start there in developing a theme.
## Stanford-Online theme has error for now;
# THEME_ACCT: yarko # Theme repos
THEME_ACCT: Stanford-Online # Theme repos
# COMMON_GIT_MIRROR: 'github.com'
##
# For production stack, I'm hoping this works from here:
# worker_django_settings_module: aws
##
# source repositories and versions
#
# To begin Open edX product development, fork a starting tree,
# and override repo & version settings to use your fork & devel branch;
#
# Note: this is your snapshot, and the version
# of this build-version.yml file is your edx version!
##
# edx_ansible_source_repo: https://{{ COMMON_GIT_MIRROR }}/{{ OPEN_EDX }}/configuration.git
# edx_ansible_source_repo: https://{{ COMMON_GIT_MIRROR }}/{{ GIT_ACCT }}/configuration.git
# configuration_version: master
# configuration_version: 'yarko/build-version'
##
#edx_platform_repo: https://{{ COMMON_GIT_MIRROR }}/{{ GIT_ACCT }}/edx-platform.git
# edx_platform_version: release # would be NICE if this were for latest Open edX release
#edx_platform_version: yarko/fix-paver-env-assets
##
# xqueue_source_repo: https://{{ COMMON_GIT_MIRROR }}/{{ OPEN_EDX }}/xqueue.git
# xqueue_version: HEAD
#
##
# xserver_source_repo: https://{{ COMMON_GIT_MIRROR }}/{{ OPEN_EDX }}/xserver.git
# xserver_version: master
##
# forum_source_repo: https://{{ COMMON_GIT_MIRROR }}/{{ GIT_ACCT }}/cs_comments_service.git
# forum_version: master # no release tag/branch, as yet
##
# discern_ease_source_repo: https://{{ COMMON_GIT_MIRROR }}/{{ OPEN_EDX }}/ease.git
# discern_ease_version: HEAD
##
# discern_source_repo: https://{{ COMMON_GIT_MIRROR }}/{{ OPEN_EDX }}/discern.git
# discern_version: master
##
# ora_ease_source_repo: https://{{ COMMON_GIT_MIRROR }}/{{ OPEN_EDX }}/ease.git
# ora_ease_version: master
##
# ora_source_repo: https://{{ COMMON_GIT_MIRROR }}/{{ OPEN_EDX }}/edx-ora.git
# ora_version: master
##
# Theming selection
# typical process:
# - bring up the standard edx theme;
# - bring up a canonically Stanford themed edx;
# - fork and develop your theme;
edxapp_theme_name: stanford
edxapp_theme_source_repo: https://{{ COMMON_GIT_MIRROR }}/{{ THEME_ACCT }}/edx-theme.git
edxapp_theme_version: master
edxapp_use_custom_theme: true # false to disable & use std. theme
Vagrant.require_version ">= 1.5.3"
unless Vagrant.has_plugin?("vagrant-vbguest")
raise "Please install the vagrant-vbguest plugin by running `vagrant plugin install vagrant-vbguest`"
end
VAGRANTFILE_API_VERSION = "2"
MEMORY = 2048
CPU_COUNT = 2
$script = <<SCRIPT
if [ ! -d /edx/app/edx_ansible ]; then
echo "Error: Base box is missing provisioning scripts." 1>&2
exit 1
fi
export PYTHONUNBUFFERED=1
source /edx/app/edx_ansible/venvs/edx_ansible/bin/activate
cd /edx/app/edx_ansible/edx_ansible/playbooks
# handle case where build-version file was removed
export EXTRA_VARS=""
BUILD_FILE=/vagrant/build-version.yml
[ -r ${BUILD_FILE} -a -f ${BUILD_FILE} ] && EXTRA_VARS="--extra-vars \"@${BUILD_FILE}\""
echo "EXTRA_VARS: [${EXTRA_VARS}]"
# Need to ensure that the configuration repo is updated
# The vagrant-devstack.yml playbook will also do this, but only
# after loading the playbooks into memory. If these are out of date,
# this can cause problems (e.g. looking for templates that no longer exist).
/edx/bin/update configuration release
ansible-playbook -i localhost, -c local vagrant-devstack.yml -e configuration_version=release ${EXTRA_VARS}
SCRIPT
edx_platform_mount_dir = "edx-platform"
themes_mount_dir = "themes"
forum_mount_dir = "cs_comments_service"
ora_mount_dir = "ora"
if ENV['VAGRANT_MOUNT_BASE']
edx_platform_mount_dir = ENV['VAGRANT_MOUNT_BASE'] + "/" + edx_platform_mount_dir
themes_mount_dir = ENV['VAGRANT_MOUNT_BASE'] + "/" + themes_mount_dir
forum_mount_dir = ENV['VAGRANT_MOUNT_BASE'] + "/" + forum_mount_dir
ora_mount_dir = ENV['VAGRANT_MOUNT_BASE'] + "/" + ora_mount_dir
end
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Creates an edX devstack VM from an official release
config.vm.box = "injera-devstack"
# config.vm.synced_folder ".", "/vagrant", disabled: true
config.vm.box_url = "http://files.edx.org/vagrant-images/20140418-injera-devstack.box"
config.vm.network :private_network, ip: "192.168.33.10"
config.vm.network :forwarded_port, guest: 8000, host: 8000
config.vm.network :forwarded_port, guest: 8001, host: 8001
config.vm.network :forwarded_port, guest: 18080, host: 18080
config.vm.network :forwarded_port, guest: 8765, host: 8765
config.vm.network :forwarded_port, guest: 9200, host: 9200
config.ssh.insert_key = true
# Enable X11 forwarding so we can interact with GUI applications
if ENV['VAGRANT_X11']
config.ssh.forward_x11 = true
end
# only files in the current directory, less Vagrantfile:
config.vm.synced_folder ".", "/vagrant", type: "rsync", rsync__exclude: [".*/", "*/", "/Vagrantfile*"]
config.vm.synced_folder "#{edx_platform_mount_dir}", "/edx/app/edxapp/edx-platform", :create => true, nfs: true
config.vm.synced_folder "#{themes_mount_dir}", "/edx/app/edxapp/themes", :create => true, nfs: true
config.vm.synced_folder "#{forum_mount_dir}", "/edx/app/forum/cs_comments_service", :create => true, nfs: true
config.vm.synced_folder "#{ora_mount_dir}", "/edx/app/ora/ora", :create => true, nfs: true
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", MEMORY.to_s]
vb.customize ["modifyvm", :id, "--cpus", CPU_COUNT.to_s]
# Allow DNS to work for Ubuntu 12.10 host
# http://askubuntu.com/questions/238040/how-do-i-fix-name-service-for-vagrant-client
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
end
# Use vagrant-vbguest plugin to make sure Guest Additions are in sync
config.vbguest.auto_reboot = true
config.vbguest.auto_update = true
# Assume that the base box has the edx_ansible role installed
# We can then tell the Vagrant instance to update itself.
config.vm.provision "shell", inline: $script
end
# uncomment the "---" line below if you're going to use this file stand-alone:
#---
## for use in edx injera theming tests:
#
# for fullstack, add this to your /edx/app/edx_ansible/server-vars.yml file
#
# see the discussion thread around
# https://groups.google.com/d/msg/edx-code/TKSkQbHMmpE/eu_VPG1AMK0J
# for more information.
#
THEME_ACCT: Stanford-Online # Theme repos
##
# Theming selection
# typical process:
# - bring up the standard edx theme;
# - bring up a canonically Stanford themed edx;
# - fork and develop your theme;
edxapp_theme_name: stanford
edxapp_theme_source_repo: https://{{ COMMON_GIT_MIRROR }}/{{ THEME_ACCT }}/edx-theme.git
edxapp_theme_version: master
edxapp_use_custom_theme: true # false to disable & use std. theme
@yarko
Copy link
Author

yarko commented Apr 30, 2014

See https://groups.google.com/d/msg/edx-code/TKSkQbHMmpE/eu_VPG1AMK0J for procedures to make a test theming.

These files here for your convenience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment