This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
public:setting_up_test_development_environment [2015/09/01 07:57] huyeng |
public:setting_up_test_development_environment [2020/07/10 05:39] arkyarky Need rewrite |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | FIXME **This page is outdated. Please help completing the wiki updates.**\\ //(remove this paragraph once the page is updated)// | ||
====== Setting up test & development environment ====== | ====== Setting up test & development environment ====== | ||
Line 47: | Line 48: | ||
* **odm-deployment/ansible/group_vars/webfaction-servers.sample**: This file needs to be renamed to **webfaction-servers** and be modified according to paths, urls and port numbers for deploying on a webfaction server. | * **odm-deployment/ansible/group_vars/webfaction-servers.sample**: This file needs to be renamed to **webfaction-servers** and be modified according to paths, urls and port numbers for deploying on a webfaction server. | ||
* **odm-deployment/ansible/group_vars/vagrant-box.sample**: This file needs to be renamed to **vagrant-box** and be modified according to paths, urls and port numbers for deploying on the vagrant machine. | * **odm-deployment/ansible/group_vars/vagrant-box.sample**: This file needs to be renamed to **vagrant-box** and be modified according to paths, urls and port numbers for deploying on the vagrant machine. | ||
- | * Below are some settings that needs to provide, open the **vagrant-box** and provides the information of: | + | * Below are some settings that needs to provide, open the **vagrant-box** and provide the information of: |
* tomcat_admin_user: | * tomcat_admin_user: | ||
* tomcat_admin_password: | * tomcat_admin_password: | ||
Line 57: | Line 58: | ||
* **odm-deployment/ansible/roles**: This file contains ansible playbooks for the different components of the architecture. | * **odm-deployment/ansible/roles**: This file contains ansible playbooks for the different components of the architecture. | ||
- | * **odm-deployment/ansible/stage.sample**: This file needs to be renamed to **stage** is the ansible inventory and needs to be configured with URLs to the machines to provision. | + | * **odm-deployment/ansible/stage**: This file needs to be configured with URLs to the machines to provision. |
Line 81: | Line 82: | ||
vagrant reload | vagrant reload | ||
</code> | </code> | ||
+ | |||
+ | ==== If Errors occur during vagrant up ==== | ||
+ | |||
+ | Sometimes, the deployment of the Development Environment will be stuck at some points that caused by wrong configuration or the speed of internet connection. | ||
+ | |||
+ | === Double Check the Configuration === | ||
+ | |||
+ | * Please check "ansible\group_vars\**vagrant-box**" to make sure that all requirement attributes below are provided: | ||
+ | * tomcat_admin_user: | ||
+ | * tomcat_admin_password: | ||
+ | * datapusher_port: | ||
+ | * wp_db_name: | ||
+ | * wp_db_user: | ||
+ | * wp_db_password: | ||
+ | * wp_domain: | ||
+ | |||
+ | === Change the location of Ubuntu servers === | ||
+ | |||
+ | * If they are correctly provided, then try to change the location of Ubuntu servers to different regions that is closer to your location. | ||
+ | * Go to "ansible/roles/common-ubuntu/files", you will see a series of .list files that contain Ubuntu servers from different regions. | ||
+ | * Then update the source file name in **main.yml** located in "ansible\roles\common-ubuntu\tasks". | ||
+ | * For example, in line 3: | ||
+ | The default is "copy: src=sources.list dest=/etc/apt/sources.list owner=root group=root mode=0644" | ||
+ | updated to: "copy: src=sources.th.list dest=/etc/apt/sources.list owner=root group=root mode=0644" | ||
+ | * Next vagrant destroy and up again. | ||
+ | |||
+ | === Fail due to Internet connection issue === | ||
+ | |||
+ | Please go ahead to download the solr and tomcat below and place them in "odm-deployment\installables". | ||
+ | |||
+ | * http://archive.apache.org/dist/lucene/solr/4.7.2/solr-4.7.2.tgz | ||
+ | * http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.56/bin/apache-tomcat-7.0.56.tar.gz | ||
+ | * Rename them to : **solr.tgz** and **tomcat.tar.gz** | ||
+ | * Then vagrant destroy and up again. | ||
+ | * Done | ||
=== Log in with ssh once provisioning finish. === | === Log in with ssh once provisioning finish. === | ||
Line 138: | Line 174: | ||
=== Finish configuring CKAN === | === Finish configuring CKAN === | ||
- | The provisioning scripts installs CKAN and its dependencies plus the [[https://github.com/OpenDevelopmentMekong/ckanext-odm_theme|odm_theme]] & [[https://github.com/OpenDevelopmentMekong/ckanext-odm_utils|odm_utils]] extensions, but there are still some actions to be taken in order to configure the development environment completely. | + | The provisioning scripts installs CKAN and its dependencies plus some extensions, but there are still some actions to be taken in order to configure the development environment completely: |
- | <WRAP center round info 90%> | + | == Creating a system administrator user == |
- | Please refer to [[migrating_from_previous_system|Migrating from previous System]] and follow the instructions specified there in order to initialize the recently created test & development environment with real data. | + | |
- | </WRAP> | + | After activating the python environment with <code>. ~/.virtualenvs/ckan/bin/activate</code>, you can execute <code>paster --plugin=ckan sysadmin add USERNAME ~/etc/ckan/default/development.ini</code> OR <code>paster --plugin=ckan sysadmin add USERNAME -c ~/etc/ckan/default/development.ini |
+ | </code>for creating a new user with sysadmin permissions, or attribute those permissions to an existing user. USERNAME is the account name, you can name whatever eg. admin or user1 | ||
+ | |||
+ | Once this is done and password has been set, you can login into CKAN under http://192.168.33.10:8081/user/login. | ||
+ | |||
+ | == Inserting initial data using ckanext-odm_migration == | ||
+ | |||
+ | Since the [[http://github.com/OpenDevelopmentMekong/ckanext-odm_migration|ckanext-odm_migration]] extension gets installed automatically while provisioning the vagrant machine. Once logged in, you can access http://192.168.33.10:8081/migration where you will find a series of utilities for inserting initial data and importing taxonomy terms and their translations and/or law records. | ||
+ | |||
+ | {{ :public:screenshot_from_2016-04-29_14-56-27.png?300 |}} | ||
=== Finish configuring WP === | === Finish configuring WP === | ||
Line 160: | Line 205: | ||
{{ :mirror_not_found_error.png?600 |}} | {{ :mirror_not_found_error.png?600 |}} | ||
- | In order to solve this, a failsafe sources list can be selected. For that, it is just necessary to change the following line in the **deployment/ansible/roles/common/tasks/main.yml** file: | + | In order to solve this, a failsafe sources list can be selected. For that, it is just necessary to change the following line in the **deployment/ansible/roles/common-ubuntu/tasks/main.yml** file: |
<code> | <code> |