Original Creator : — Anna Dowling
Updated by : — Colm Carew
Updated by : — Oleksandr Kononov
Updated by : — Conor Giles
Unfortunately there are a lot of steps here but there is an easy way and a hard way, the easy way only applies to CC and EXT DBs for now so if you need DBs/Appfiles for a different customer you will have to do it the hard way.
For either method, you need to create an appfiles directory first.
If you are on MacOS Catalina, the method is different from earlier versions, or on linux. If you are not on Catalina, you can run the following commands and skip the next part marked 'Catalina Setup'.
Apple's new APFS prevents you from writing anything directly to '/', so a workaround is needed to create our '/export' directory. We will achieve this using 'synthetic fixlinks', mapping a virtual directory on '/' to a directory on our writeable Data volume. First, we must create the directory on our Data volume:
Now, we create a synthetic.conf file which maps '/export' to our newly created directory.
Inside this file, add the following line:
export System/Volumes/Data/export
Note: The whitespace between export and System must be a tab.
Now restart the system to push the changes.
ansible-playbook -i ../env-configuration/prodext local.yml --diff --extra-vars "database=ticketer mysql_root_pass=THEDBPASS" --vault-id @prompt
ansible-playbook -i ../env-configuration/prodext local.yml --diff --extra-vars "mysql_path='docker exec -i CONTAINER /usr/local/mysql/bin/mysql' database=ticketer mysql_root_pass=THEDBPASS" --vault-id @prompt
Note that some tickets reference the snmp_manager database. Installing this database is not strictly necessary, but can avoid errors when running. Install with the following command like above:
ansible-playbook -i ../env-configuration/prodext local.yml --diff --extra-vars "database=snmp_manager mysql_root_pass=THEDBPASS number_of_traps_to_get=100000" --vault-id @prompt
mysql -uroot -p -e 'set global max_allowed_packet = 1000000000' mysql -uroot -p DB < db.dump
Import Ticketer project as existing project and make sure you have Grails 2.2.4 installed on machine and use that as the Grails option. Also make sure that you have Groovy 2.4.3 installed. Intellij should automatically detect this is a Grails project and allow you to select the correct version on the wizard setup page.☐ Go to Project Settings and make sure that you have the following dependencies set up:
Make sure you have a log file with the following path
/export/home/scotty/logs/grails/Ticketer.log
Usual Problems
- The same goes with GWT_HOME, ensure that GWT_HOME is set and can be accessed from within the IDEAJ terminal - set it in .bashrc or .bash_profile
echo $GWT_HOME
Not required but advisable to run scripts from mysql prompt. Run mysql -uroot -p command in your terminal to open mysql prompt, enter your password which ideally should be the Errigal Password Convention and run the following scripts (copy and paste if using mysql prompt- order in which you run the scripts is important!):
Add the following to your vmoptions, located in edit configurations:
-Xms1024m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512m -Djava.ticketer.database=ticketer -Dgrails.server.port.http=8083
If needed to input jvm options from command line rather than idea:
export GRAILS_OPTS="-Xms1024m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512m -Djava.ticketer.database=ticketer -Dgrails.server.port.http=8083"
Run the following to create and own directory for grails logs:
sudo mkdir -p /export/home/scotty/logs/grails/quite
sudo chown user-name:staff /export/home/sudo chown user-name:staff /export/home/scotty/logs/grails/
touch /export/home/scotty/logs/grails/Ticketer.log
Note: If problems are experienced when compiling the project and/or gwt modules, try to clean your .grails cache by removing the Ticketer folder located in your ~/.grails/2.2.4/projects/ and run clean, compile, compile-gwt-modules again.
Note: IF you are having issues running the application in Idea (especially on Linux) but its OK from the console and you are getting the error: “cannot invoke method getat() on null object” - start run-app with the “–stacktrace” flag to pinpoint the error which in my case was relating to: def versionNumber = currentGwtHome[-5..-1] being null in the BuildConfig.groovy.
To fix this /etc/environment needs to have GWT_HOME set here as the .bashrc is sometimes not sufficient for other applications to pick it up
At this point your application should be up and running, navigate to http://localhost:8083/Ticketer/.
Well done!
If you are just running the ticketer locally and don't have access to any user management tools, you can use this script to add a new ticketer user. Follow the instructions in the readme to quickly create a new user for exploring the workbench with.
Alternatively, you can do this process manually by doing the following:
md5 -s "PASSWORD"
on your machine