diff --git a/Makefile b/Makefile index e1abb70edb..c8cf94a3c7 100644 --- a/Makefile +++ b/Makefile @@ -43,6 +43,9 @@ dev.clone: ## Clone service repos to the parent directory dev.provision.run: ## Provision all services with local mounted directories DOCKER_COMPOSE_FILES="-f docker-compose.yml -f docker-compose-host.yml" ./provision.sh +dev.wordpress.provision: + DOCKER_COMPOSE_FILES="-f docker-compose.yml -f docker-compose-host.yml" ./provision-wordpress.sh + dev.provision: | check-memory dev.clone dev.provision.run stop ## Provision dev environment with all services stopped dev.provision.xqueue: | check-memory dev.provision.xqueue.run stop stop.xqueue diff --git a/README.rst b/README.rst index 42fdb5fbd3..60be80fd43 100644 --- a/README.rst +++ b/README.rst @@ -3,139 +3,106 @@ Open edX Devstack |Build Status| Get up and running quickly with Open edX services. -If you are seeking info on the Vagrant-based devstack, please see -https://openedx.atlassian.net/wiki/display/OpenOPS/Running+Devstack. This -project is meant to replace the traditional Vagrant-based devstack with a -multi-container approach driven by `Docker Compose`_. It is still in the -beta testing phase. - -Support -------- - -Tickets or issues should be filed in Jira under the platform project: -https://openedx.atlassian.net/projects/PLAT/issues - -FYI ---- - -You should run any ``make`` targets described below on your local machine, *not* -from within a VM. - Prerequisites ------------- This project requires **Docker 17.06+ CE**. We recommend Docker Stable, but Docker Edge should work as well. -**NOTE:** Switching between Docker Stable and Docker Edge will remove all images and -settings. Don't forget to restore your memory setting and be prepared to -provision. +You will also need the following installed: -For macOS users, please use `Docker for Mac`_. Previous Mac-based tools (e.g. -boot2docker) are *not* supported. +- make +- python pip (optional for MacOS) +- node -`Docker for Windows`_ may work but has not been tested and is *not* supported. +Getting Started +--------------- -Linux users should *not* be using the ``overlay`` storage driver. ``overlay2`` -is tested and supported, but requires kernel version 4.0+. Check which storage -driver your docker-daemon is configured to use: +All of the services can be run by following the steps below. -.. code:: sh +1. Create a new vitualenv using the following command. Install virtualenv using "pip install virtualenv" if dnt have it. - docker info | grep -i 'storage driver' + .. code:: sh -You will also need the following installed: + virtualenv devstack-env () -- make -- python pip (optional for MacOS) +2. Activate the virtualenv -Using the Latest Images ------------------------ + .. code:: sh -New images for our services are published frequently. Assuming that you've followed the steps in `Getting Started`_ -below, run the following sequence of commands if you want to use the most up-to-date versions of the devstack images. + source devstack-env/bin/activate -.. code:: sh +3. Install the requirements - make down - make pull - make dev.up + .. code:: sh -This will stop any running devstack containers, pull the latest images, and then start all of the devstack containers. + make requirements -Getting Started ---------------- +4. Check if env variable "OPENEDX_RELEASE" is already set using (update the value to 'hawthorn.master' if set to a different value)(if first time installation use the following command to set the variable) -All of the services can be run by following the steps below. For analyticstack, follow `Getting Started on Analytics`_. + .. code:: sh -**NOTE:** Since a Docker-based devstack runs many containers, -you should configure Docker with a sufficient -amount of resources. We find that `configuring Docker for Mac`_ with -a minimum of 2 CPUs and 6GB of memory works well. + echo "export OPENEDX_RELEASE=hawthorn.master" >> ~/.bashrc && source ~/.bashrc + Note* : for mac you can exter the value in .bash_profie -1. Install the requirements inside of a `Python virtualenv`_. +5. Clone the all the service repos .. code:: sh - make requirements + make dev.clone -2. The Docker Compose file mounts a host volume for each service's executing - code. The host directory defaults to be a sibling of this directory. For - example, if this repo is cloned to ``~/workspace/devstack``, host volumes - will be expected in ``~/workspace/course-discovery``, - ``~/workspace/ecommerce``, etc. These repos can be cloned with the command - below. +6. Check if you have any existing edX images .. code:: sh - make dev.clone + docker ps -a --filter "name=edx" - You may customize where the local repositories are found by setting the - DEVSTACK\_WORKSPACE environment variable. - - Be sure to share the cloned directories in the Docker -> Preferences... -> - File Sharing box. +7. Check if you have any existing wordpress -3. Run the provision command, if you haven't already, to configure the various - services with superusers (for development without the auth service) and - tenants (for multi-tenancy). + .. code:: sh + + docker ps -a --filter "name=wordpress" - **NOTE:** When running the provision command, databases for ecommerce and edxapp - will be dropped and recreated. +8. Remove all existing edX images if there are any - The username and password for the superusers are both ``edx``. You can access - the services directly via Django admin at the ``/admin/`` path, or login via - single sign-on at ``/login/``. + .. code:: sh - Default: + docker rmi $(docker images |grep 'edx') + +9. Remove all existing wordpress images if there are any. .. code:: sh - make dev.provision + docker rmi $(docker images |grep 'wordpress') - Provision using `docker-sync`_: +10. just to make sure :). - .. code:: sh + .. code:: sh - make dev.sync.provision + make destroy +11. Pull the latest Images. -4. Start the services. This command will mount the repositories under the - DEVSTACK\_WORKSPACE directory. + .. code:: sh - **NOTE:** it may take up to 60 seconds for the LMS to start, even after the ``make dev.up`` command outputs ``done``. + make pull - Default: +12. Run the provisions. - .. code:: sh + .. code:: sh - make dev.up + make dev.provision + + Run for WordPress plugins setup + + ./provision-wordpress.sh - Start using `docker-sync`_: +13. Run the devstack. - .. code:: sh + .. code:: sh - make dev.sync.up + make dev.up + After the services have started, if you need shell access to one of the @@ -199,85 +166,6 @@ is ``edx``. | verified | verified@example.com | +------------+------------------------+ -Getting Started on Analytics ----------------------------- - -Analyticstack can be run by following the steps below. - -**NOTE:** Since a Docker-based devstack runs many containers, you should configure -Docker with a sufficient amount of resources. We find that -`configuring Docker for Mac`_ with a minimum of 2 CPUs and 6GB of memory works -well for **analyticstack**. If you intend on running other docker services besides -analyticstack ( e.g. lms, studio etc ) consider setting higher memory. - -1. Follow steps `1` and `2` from `Getting Started`_ section. - -2. Before running the provision command, make sure to pull the relevant - docker images from dockerhub by running the following commands: - - .. code:: sh - - make pull - make pull.analytics_pipeline - -3. Run the provision command to configure the analyticstack. - - .. code:: sh - - make dev.provision.analytics_pipeline - -4. Start the analytics service. This command will mount the repositories under the - DEVSTACK\_WORKSPACE directory. - - **NOTE:** it may take up to 60 seconds for Hadoop services to start. - - .. code:: sh - - make dev.up.analytics_pipeline - -5. To access the analytics pipeline shell, run the following command. All analytics - pipeline job/workflows should be executed after accessing the shell. - - .. code:: sh - - make analytics-pipeline-shell - - - To see logs from containers running in detached mode, you can either use - "Kitematic" (available from the "Docker for Mac" menu), or by running the - following command: - - .. code:: sh - - make logs - - - To view the logs of a specific service container run ``make -logs``. - For example, to access the logs for Hadoop's namenode, you can run: - - .. code:: sh - - make namenode-logs - - - To reset your environment and start provisioning from scratch, you can run: - - .. code:: sh - - make destroy - - **NOTE:** Be warned! This will remove all the containers and volumes - initiated by this repository and all the data ( in these docker containers ) - will be lost. - - - For information on all the available ``make`` commands, you can run: - - .. code:: sh - - make help - -6. For running acceptance tests on docker analyticstack, follow the instructions in the - `Running analytics acceptance tests in docker`_ guide. -7. For troubleshooting docker analyticstack, follow the instructions in the - `Troubleshooting docker analyticstack`_ guide. - Service URLs ------------ @@ -300,10 +188,58 @@ meant to be user-facing, the "homepage" may be the API root. +---------------------+-------------------------------------+ | Studio/CMS | http://localhost:18010/ | +---------------------+-------------------------------------+ +| wordpress | http://localhost:8888/ | ++---------------------+-------------------------------------+ + +Wordpress setup +-------------- + +By default wordpress contains all the required plugins and theme. +To get a dev like instance running locally. +After you have done the initial wordpress setup, Do the following steps. + +- Import the dump.wpress using the all in one plugin (already installed) +- Deactivate the all in one plugin. + ++-----------------+------------------------------------------+ +| Username | Password | ++=================+==========================================+ +| edly_admin | r8lbReHhVjhoyoS0jBFEqL9tZ3W4d7H0p6B | ++-----------------+------------------------------------------+ +Node :- This dump does not contain any images you will have to add images to make it look like dev. :) + +By default the container does not support package installation. If you want to install some packages in wordpress +do the following stuff. + +.. code:: sh + + make wordpress-shell +.. code:: sh + + rm /etc/apt/preferences.d/no-debian-php + +.. code:: sh + + apt-get update + +Note* : If you are facing some uploading images issues on mac go to wordpress shell and set appropriate permissions for uploads folder (ie, "chown www-data:www-data -R uploads") + +Note** : If you are facing some home page issues with elementor. Go to elementor wordpress setting and hard code the default values and save. + Useful Commands --------------- +``make dev.up`` can take a long time, as it starts all services, whether or not +you need them. To instead only start a single service and its dependencies, run +``make dev.up.``. For example, the following will bring up LMS +(along with Memcached, MySQL, and devpi), but it will not bring up Discovery, +Credentials, etc: + +.. code:: sh + + make dev.up.lms + Sometimes you may need to restart a particular application server. To do so, simply use the ``docker-compose restart`` command: @@ -311,7 +247,7 @@ simply use the ``docker-compose restart`` command: docker-compose restart -```` should be replaced with one of the following: +In all the above commands, ```` should be replaced with one of the following: - credentials - discovery @@ -319,6 +255,9 @@ simply use the ``docker-compose restart`` command: - lms - edx_notes_api - studio +- registrar +- gradebook +- program-manager If you'd like to add some convenience make targets, you can add them to a ``local.mk`` file, ignored by git. @@ -338,92 +277,14 @@ are not checked in development, so put whatever you want in those fields. PayPal (same for username and password): devstack@edx.org -Marketing Site --------------- - -Docker Compose files useful for integrating with the edx.org marketing site are -available. This will NOT be useful to those outside of edX. For details on -getting things up and running, see -https://openedx.atlassian.net/wiki/display/OpenDev/Marketing+Site. - -How do I build images? ----------------------- -There are `Docker CI Jenkins jobs`_ on tools-edx-jenkins that build and push new -Docker images to DockerHub on code changes to either the configuration repository or the IDA's codebase. These images -are tagged according to the branch from which they were built (see NOTES below). -If you want to build the images on your own, the Dockerfiles are available in the ``edx/configuration`` repo. +How do I develop on an installed Python package? +------------------------------------------------ -NOTES: +If you want to modify an installed package – for instance ``edx-enterprise`` or ``completion`` – clone the repository in +``~/workspace/src/your-package``. Next, ssh into the appropriate docker container (``make lms-shell``), +run ``pip install -e /edx/src/your-package``, and restart the service. -1. edxapp and IDAs use the ``latest`` tag for configuration changes which have been merged to master branch of - their repository and ``edx/configuration``. -2. Images for a named Open edX release are built from the corresponding branch - of each repository and tagged appropriately, for example ``hawthorn.master`` - or ``hawthorn.rc1``. -3. The elasticsearch used in devstack is built using elasticsearch-devstack/Dockerfile and the ``devstack`` tag. - -BUILD COMMANDS: - -.. code:: sh - - git checkout master - git pull - docker build -f docker/build/edxapp/Dockerfile . -t edxops/edxapp:latest - -.. code:: sh - - git checkout master - git pull - docker build -f docker/build/ecommerce/Dockerfile . -t edxops/ecommerce:devstack - -The build commands above will use your local configuration, but will pull -application code from the master branch of the application's repository. If you -would like to use code from another branch/tag/hash, modify the ``*_VERSION`` -variable that lives in the ``ansible_overrides.yml`` file beside the -``Dockerfile``. Note that edx-platform is an exception; the variable to modify is ``edx_platform_version`` -and not ``EDXAPP_VERSION``. - -For example, if you wanted to build tag ``release-2017-03-03`` for the -E-Commerce Service, you would modify ``ECOMMERCE_VERSION`` in -``docker/build/ecommerce/ansible_overrides.yml``. - -How do I run the images for a named Open edX release? ------------------------------------------------------ - -1. Set the ``OPENEDX_RELEASE`` environment variable to the appropriate image - tag; "hawthorn.master", "zebrawood.rc1", etc. Note that unlike a server - install, ``OPENEDX_RELEASE`` should not have the "open-release/" prefix. -2. Use ``make dev.checkout`` to check out the correct branch in the local - checkout of each service repository once you've set the ``OPENEDX_RELEASE`` - environment variable above. -3. ``make pull`` to get the correct images. - -All ``make`` target and ``docker-compose`` calls should now use the correct -images until you change or unset ``OPENEDX_RELEASE`` again. To work on the -master branches and ``latest`` images, unset ``OPENEDX_RELEASE`` or set it to -an empty string. - -How do I create database dumps? -------------------------------- -We use database dumps to speed up provisioning and generally spend less time running migrations. These dumps should be -updated occasionally - when database migrations take a prolonged amount of time *or* we want to incorporate changes that -require manual intervention. - -To update the database dumps: - -1. Destroy and/or backup the data for your existing devstack so that you start with a clean slate. -2. Disable the loading of the existing database dumps during provisioning by commenting out any calls to ``load-db.sh`` - in the provisioning scripts. This disabling ensures a start with a completely fresh database and incorporates any changes - that may have required some form of manual intervention for existing installations (e.g. drop/move tables). -3. Provision devstack with ``make provision``. -4. Dump the databases and open a pull request with your updates: - -.. code:: sh - - ./dump-db.sh ecommerce - ./dump-db.sh edxapp - ./dump-db.sh edxapp_csmh How do I keep my database up to date? ------------------------------------- @@ -444,6 +305,21 @@ of the migrations included in the database dump used by provisioning. In these cases, it's usually best to first rebase the branch onto master to get the missing migrations. +How do I access a database shell? +--------------------------------- + +To access a MySQL or Mongo shell, run the following commands, respectively: + +.. code:: sh + + make mysql-shell + mysql + +.. code:: sh + + make mongo-shell + mongo + How do I make migrations? ------------------------- @@ -488,7 +364,7 @@ starts, you have a few options: * Merge your updated requirements files and wait for a new `edxops Docker image`_ for that service to be built and uploaded to `Docker Hub`_. You can then download and use the updated image (for example, via ``make pull``). - The discovery and edxapp images are buit automatically via a Jenkins job. All other + The discovery and edxapp images are built automatically via a Jenkins job. All other images are currently built as needed by edX employees, but will soon be built automatically on a regular basis. See `How do I build images?`_ for more information. @@ -529,6 +405,29 @@ To rebuild static assets for all service containers: make static +How do I connect to the databases from an outside editor? +--------------------------------------------------------- + +To connect to the databases from an outside editor (such as MySQLWorkbench), +first uncomment these lines from ``docker-compose.yml``'s ``mysql`` section: + +.. code-block:: + + ports: + - "3506:3306" + +Then connect using the values below. Note that the username and password will +vary depending on the database. For all of the options, see ``provision.sql``. + +- Host: ``localhost`` +- Port: ``3506`` +- Username: ``edxapp001`` +- Password: ``password`` + +If you have trouble connecting, ensure the port was mapped successfully by +running ``docker-compose ps`` and looking for a line like this: +``edx.devstack.mysql docker-entrypoint.sh mysql ... Up 0.0.0.0:3506→3306/tcp``. + Switching branches ------------------ @@ -605,12 +504,11 @@ start up the containers as usual with: This command starts each relevant container with the equivalent of the '--it' option, allowing a developer to attach to the process once the process is up and running. -To attach to the LMS/Studio containers and their process, use either: +To attach to a container and its process, use ``make -attach``. For example: .. code:: sh make lms-attach - make studio-attach Set a PDB breakpoint anywhere in the code using: @@ -632,6 +530,9 @@ or a manual Docker command to bring down the container: docker kill $(docker ps -a -q --filter="name=edx.devstack.") +Alternatively, some terminals allow detachment from a running container with the +``Ctrl-P, Ctrl-Q`` key sequence. + Running LMS and Studio Tests ---------------------------- @@ -668,9 +569,9 @@ you can connect to the container running it via VNC. | Chrome (via Selenium) | vnc://0.0.0.0:15900 | +------------------------+----------------------+ -On macOS, enter the VNC connection string in Safari to connect via VNC. The VNC -passwords for both browsers are randomly generated and logged at container -startup, and can be found by running ``make vnc-passwords``. +On macOS, enter the VNC connection string in the address bar in Safari to +connect via VNC. The VNC passwords for both browsers are randomly generated and +logged at container startup, and can be found by running ``make vnc-passwords``. Most tests are run in Firefox by default. To use Chrome for tests that normally use Firefox instead, prefix the test command with @@ -696,7 +597,7 @@ and run the tests manually via paver: paver e2e_test --exclude="whitelabel\|enterprise" The browser running the tests can be seen and interacted with via VNC as -described above (Chrome is used by default). +described above (Firefox is used by default). Troubleshooting: General Tips ----------------------------- @@ -743,7 +644,7 @@ data volumes. Reset ~~~~~ -Somtimes you just aren't sure what's wrong, if you would like to hit the reset button +Sometimes you just aren't sure what's wrong, if you would like to hit the reset button run ``make dev.reset``. Running this command will perform the following steps: @@ -989,7 +890,7 @@ GitHub issue which explains the `current status of implementing delegated consis .. _Docker Hub: https://hub.docker.com/ .. _Pycharm Integration documentation: docs/pycharm_integration.rst .. _devpi documentation: docs/devpi.rst -.. _edx-platform testing documentation: https://github.com/edx/edx-platform/blob/master/docs/testing.rst#running-python-unit-tests +.. _edx-platform testing documentation: https://github.com/edx/edx-platform/blob/master/docs/testing/testing.rst#running-python-unit-tests .. _docker-sync: #improve-mac-osx-performance-with-docker-sync .. |Build Status| image:: https://travis-ci.org/edx/devstack.svg?branch=master :target: https://travis-ci.org/edx/devstack diff --git a/docker-compose-host.yml b/docker-compose-host.yml index cf848e98eb..909b974e83 100644 --- a/docker-compose-host.yml +++ b/docker-compose-host.yml @@ -33,6 +33,10 @@ services: forum: volumes: - ${DEVSTACK_WORKSPACE}/cs_comments_service:/edx/app/forum/cs_comments_service:cached + wordpress: + volumes: + - ${DEVSTACK_WORKSPACE}/edly-wp-plugin:/var/www/html/wp-content/plugins/edly-wp-plugin:cached + - ${DEVSTACK_WORKSPACE}/edly-wp-theme:/var/www/html/wp-content/themes/edly-wp-theme:cached volumes: credentials_node_modules: diff --git a/docker-compose-sync.yml b/docker-compose-sync.yml index 00900eee18..1a984c003f 100644 --- a/docker-compose-sync.yml +++ b/docker-compose-sync.yml @@ -19,7 +19,10 @@ services: forum: volumes: - forum-sync:/edx/app/forum/cs_comments_service:nocopy - + wordpress: + volumes: + - wordpress-sync:/var/www/html/wp-content/plugins/edly-wp-plugin:nocopy + - wordpress-sync:/var/www/html/wp-content/themes/edly-wp-theme:nocopy volumes: credentials-sync: external: true @@ -31,3 +34,5 @@ volumes: external: true forum-sync: external: true + wordpress-sync: + external: true diff --git a/docker-compose.yml b/docker-compose.yml index 2c496de921..f2deeb6de9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -217,6 +217,21 @@ services: volumes: - devpi_data:/data + wordpress: + container_name: edx.devstack.wordpress + image: wordpress + environment: + WORDPRESS_DB_HOST: edx.devstack.mysql + WORDPRESS_DB_NAME: 'wordpress' + WORDPRESS_DB_USER: 'wordpress001' + WORDPRESS_DB_PASSWORD: 'password' + depends_on: + - mysql + ports: + - "8888:80" + + + volumes: discovery_assets: edxapp_lms_assets: diff --git a/docker-sync.yml b/docker-sync.yml index 527b174c76..af4a04d9f5 100644 --- a/docker-sync.yml +++ b/docker-sync.yml @@ -29,3 +29,10 @@ syncs: host_disk_mount_mode: 'cached' src: '../cs_comments_service/' sync_excludes: [ '.git', '.idea' ] + + wordpress-sync: + host_disk_mount_mode: 'cached' + src: '../edly-wp-plugin/' + src: '../edly-wp-theme/' + sync_excludes: [ '.git', '.idea', '.sass-cache', 'vendor'] + diff --git a/dump.wpress b/dump.wpress new file mode 100644 index 0000000000..910759a2c4 Binary files /dev/null and b/dump.wpress differ diff --git a/provision-wordpress.sh b/provision-wordpress.sh new file mode 100755 index 0000000000..098fdd86bf --- /dev/null +++ b/provision-wordpress.sh @@ -0,0 +1,54 @@ +set -e +set -o pipefail +set -x + +echo -e "${GREEN} Removing default plugins...${NC}" +docker exec -t edx.devstack.wordpress bash -c 'cd wp-content/plugins/ && rm -rf akismet && rm -rf hello.php' + +echo -e "${GREEN} Install required Plugins...${NC}" +docker exec -t edx.devstack.wordpress bash -c ' +cd wp-content/plugins/ && curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar && +php wp-cli.phar plugin install advanced-custom-fields --activate --allow-root && +php wp-cli.phar plugin install edunext-openedx-integrator --activate --allow-root && +php wp-cli.phar plugin install elementor --activate --allow-root && +php wp-cli.phar plugin install classic-editor --activate --allow-root && +php wp-cli.phar plugin install contact-form-7 --activate --allow-root && +php wp-cli.phar plugin install mailchimp-for-wp --activate --allow-root && +php wp-cli.phar plugin install all-in-one-wp-migration --allow-root && +php wp-cli.phar plugin activate edly-wp-plugin --allow-root && +rm -rf wp-cli.phar && +chown www-data:www-data -R advanced-custom-fields && +chown www-data:www-data -R edunext-openedx-integrator && +chown www-data:www-data -R advanced-custom-fields && +chown www-data:www-data -R elementor && +chown www-data:www-data -R classic-editor && +chown www-data:www-data -R contact-form-7 && +chown www-data:www-data -R all-in-one-wp-migration' + +echo -e "${GREEN} Enable edly-wp-theme...${NC}" +docker exec -t edx.devstack.wordpress bash -c ' +cd wp-content/themes/ && curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar && +php wp-cli.phar theme get edly-wp-theme --allow-root && +php wp-cli.phar theme activate edly-wp-theme --allow-root && +rm -rf wp-cli.phar +' +echo -e "${GREEN} Update Wordpress Configurations...${NC}" +docker exec -t edx.devstack.wordpress bash -c " +curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar && +php wp-cli.phar config set 'DISCOVERY_API_URL' 'http://edx.devstack.discovery:18381/api/v1' --allow-root && +php wp-cli.phar config set 'LMS_BASE_URL' 'http://edx.devstack.lms:18000' --allow-root && +php wp-cli.phar config set 'ENROLLMENT_API_URL' 'http://edx.devstack.lms:18000/api/enrollment/v1' --allow-root && +php wp-cli.phar config set 'ENROLLMENT_STATUS_API_URL' 'http://edx.devstack.lms:18000/api/enrollment/v1/enrollment' --allow-root && +php wp-cli.phar config set 'COURSE_DASHBOARD_URL' 'http://edx.devstack.lms:18000/dashboard' --allow-root && +php wp-cli.phar config set 'COURSE_REGISTER_URL' 'http://edx.devstack.lms:18000/register' --allow-root && +php wp-cli.phar config set 'COURSE_DETAIL_URL' 'http://edx.devstack.lms:18000/courses' --allow-root && +php wp-cli.phar config set 'DISCOVERY_CLIENT_ID' 'discovery-key' --allow-root && +php wp-cli.phar config set 'DISCOVERY_CLIENT_SECRET' 'discovery-secret' --allow-root && +php wp-cli.phar config set 'IS_LOGGED_IN_COOKIE' 'edxloggedin' --allow-root && +php wp-cli.phar config set 'USER_INFO_COOKIE' 'edx-user-info' --allow-root && +rm -rf wp-cli.phar +" + +echo -e "${GREEN} Requirements ...${NC}" +cd .. && cd edly-wp-plugin && make test-requirements && cd .. && cd devstack +cd .. && cd edly-wp-theme && make test-requirements && make requirements && make compile-sass && cd .. && cd devstack diff --git a/provision.sh b/provision.sh index 8324ff18dc..b09dd1decc 100755 --- a/provision.sh +++ b/provision.sh @@ -48,6 +48,7 @@ docker-compose $DOCKER_COMPOSE_FILES up -d studio ./provision-e2e.sh ./provision-forum.sh ./provision-notes.sh +./provision-wordpress.sh docker image prune -f diff --git a/provision.sql b/provision.sql index 60692a4f42..581816f751 100644 --- a/provision.sql +++ b/provision.sql @@ -18,4 +18,7 @@ CREATE DATABASE IF NOT EXISTS edxapp_csmh; GRANT ALL ON edxapp.* TO 'edxapp001'@'%' IDENTIFIED BY 'password'; GRANT ALL ON edxapp_csmh.* TO 'edxapp001'@'%'; +CREATE DATABASE IF NOT EXISTS wordpress; +GRANT ALL ON wordpress.* TO 'wordpress001'@'%' IDENTIFIED BY 'password'; + FLUSH PRIVILEGES; diff --git a/repo.sh b/repo.sh index fc75760ab0..71e46eed93 100755 --- a/repo.sh +++ b/repo.sh @@ -34,6 +34,12 @@ private_repos=( "https://github.com/edx/edx-themes.git" ) +edly_repos=( + "https://github.com/edly-io/edly-wp-plugin.git" + "https://github.com/edly-io/edly-wp-theme.git" + "https://github.com/edly-io/edly-edx-themes.git" +) + name_pattern=".*/(.*).git" _checkout () @@ -89,17 +95,14 @@ _clone () else git clone $repo fi - if [ -n "${OPENEDX_RELEASE}" ]; then - git checkout open-release/${OPENEDX_RELEASE} - fi fi done - cd - &> /dev/null } clone () { - _clone "${repos[@]}" + _clone "${repos[@]}" "${edly_repos[@]}" + _checkout "${repos[@]}" } clone_private () @@ -110,7 +113,7 @@ clone_private () reset () { currDir=$(pwd) - for repo in ${repos[*]} + for repo in "${repos[@]}" "${edly_repos[@]}" do [[ $repo =~ $name_pattern ]] name="${BASH_REMATCH[1]}" @@ -127,7 +130,7 @@ reset () status () { currDir=$(pwd) - for repo in ${repos[*]} + for repo in ["${repos[@]}" "${edly_repos[@]}"] do [[ $repo =~ $name_pattern ]] name="${BASH_REMATCH[1]}"