User Tools

Site Tools


public:setting_up_test_development_environment

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
public:setting_up_test_development_environment [2020/06/23 15:04]
127.0.0.1 external edit
public:setting_up_test_development_environment [2020/08/13 03:27]
arkyarky Clean up chore: Removed references to older ansible workflows
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 32: Line 33:
 === Step 1: get deployment scripts === === Step 1: get deployment scripts ===
  
-[[https://​github.com/​OpenDevelopmentMekong/​odm-deployment|odm-deployment]] repo on github contains, among other scripts, the necessary files to configure and provision a Vagrant box for development.  +TBC
-For cloning it using the terminal, type: +
- +
-<​code>​git clone https://​github.com/​OpenDevelopmentMekong/​odm-deployment.git</​code>​ +
- +
-This command will download the code from the repository, it contains also other useful scripts that we will need afterwards. Following files interests us particularly:​  +
- +
-  * **odm-deployment/​Vagrantfile**  +
-  * **odm-deployment/​bootstrap.sh** +
-  * **odm-deployment/​ansible/​***+
  
 === Step 2: Edit the configuration files === === Step 2: Edit the configuration files ===
  
-  * **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. +TBC 
-  * **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 provide the information of:  +
-        * tomcat_admin_user:​ +
-        * tomcat_admin_password:​ +
-        * datapusher_port:​ +
-        * wp_db_name: ​  +
-        * wp_db_user: ​  +
-        * wp_db_password: ​  +
-        * wp_domain: ​   +
- +
-  * **odm-deployment/​ansible/​roles**:​ This file contains ansible playbooks for the different components of the architecture.  +
-  * **odm-deployment/​ansible/​stage**:​ This file needs to be configured with URLs to the machines to provision.  +
- +
  
 === Step 3: Starting the box for the first time provisions it === === Step 3: Starting the box for the first time provisions it ===
Line 87: Line 66:
  
 === Double Check the Configuration === === 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 === === 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. ​   * Next vagrant destroy and up again. ​
  
 === Fail due to Internet connection issue === === 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 133: Line 90:
 vagrant halt vagrant halt
 </​code>​ </​code>​
- 
-===== Deploying on Webfaction with Ansible ===== 
- 
-Replicating the system on a Webfaction instance uses the same Ansible scripts used for the Vagrant VM.  
- 
-=== Step 1: Edit configuration deployment scripts === 
- 
-As specified above, the **ansible/​group_vars/​webfaction-servers** file must be edited with URLs and Ports defined on webfaction prior to starting the provisioning. 
- 
-=== Step 2: Configure Domains, Databases and Apps on webfaction === 
- 
-{{ ::​domain_list_-_webfaction_control_panel.png?​direct&​600 |}} 
- 
-Add a new domain such as ckan.yourwebfactionusername.webfactional.com and press save. For the sake of the example, my webfaction user is opendevmk therefor it'll be ckan.opendevmk.webfactional.com 
- 
-Now we need to add applications for Tomcat and Ckan, which basically reserves a port on the server and optionally exposes it on the firewall or a domain. Go to "​Applications"​ then click "Add new application"​ 
- 
-{{ ::​edit_application_ckan_-_webfaction_control_panel.png?​direct&​600 |}} 
- 
-Repeat for app name ckan then when you click on the entry you've just added you'll see a port number. Note them down you'll need it later. 
- 
-{{ ::​add_new_application_-_webfaction_control_panel.png?​direct&​600 |}} 
- 
-Lastly, click on dabase -> databases --> add new database and add the postgresql database for ckan. 
- 
-{{ ::​add_new_database_-_webfaction_control_panel.png?​direct&​600 |}} 
  
 === Step 3: Run the ansible playbooks === === Step 3: Run the ansible playbooks ===
Line 190: Line 121:
 === Finish configuring WP === === Finish configuring WP ===
  
-The previous Ansible scripts provisions the box with a basic wordpress installation which will be listening to port 80. In order to finish configuring it point your browser to the URL specified on the configuration files and follow the instructions there. ​ 
  
 === Accessing the code on the Development Box === === Accessing the code on the Development Box ===
  
-There are several possibilities to access the files system on the VM in order to modify code files such as [[http://​www.howtogeek.com/​66776/​how-to-remotely-copy-files-over-ssh-without-entering-your-password/​|copying files over with SCP command]] or [[https://​help.ubuntu.com/​community/​SettingUpNFSHowTo|creating a NFS mount point on the VM]]. 
  
 ===== Troubleshooting ===== ===== Troubleshooting =====
public/setting_up_test_development_environment.txt · Last modified: 2020/08/13 03:27 by arkyarky