diff --git a/tools/scripts/ansible/README.md b/tools/scripts/ansible/README.md index ea755807bc8..efd5ac5cb2c 100644 --- a/tools/scripts/ansible/README.md +++ b/tools/scripts/ansible/README.md @@ -143,9 +143,41 @@ the operation to a single host. ## Local Test -- install vagrant and some provider such as virtualbox or libvirt +Here’s how to deploy the SurveyTool locally and try it out. + +### Build + +You need a server zipfile to deploy. This is a file such as `cldr-apps.zip`. When expanded, it contains a directory tree beginning with `wlp/`. + +#### Option A: Local Build + +- Prerequisites: See and follow instructions to be able to run `mvn package` as shown on that page. + +- You can then create a server zipfile locally with maven using these command (from the top `cldr/` directory). The first command does a full build of CLDR, but skips running tests. ```shell +mvn --file=tools/pom.xml install -DskipTests=true +mvn --file=tools/pom.xml -pl cldr-apps liberty:package +``` + +- The output file will be in `tools/cldr-apps/target/cldr-apps.zip` + + +#### Option B: Download a Build + +- Server Builds are actually attached to each action run in , look for an artifact entitled `cldr-apps-server` at the bottom of a run. + +- *Warning*: Clicking on this artifact will download a zipfile named `cldr-apps-server.zip` which _contains_ `cldr-apps.zip`. Double clicking or automatic downloading will often extract one too many levels of zipfiles. If you see a folder named `wlp` then you have extracted too much. From the command line you can unpack with `unzip cldr-apps-server.zip` which will extract `cldr-apps.zip`. + +### Deploy + +- install [vagrant](https://www.vagrantup.com) and some provider such as virtualbox or libvirt, see vagrant docs. + +- vagrant up! + +```shell +# (this directory) +cd tools/scripts/ansible vagrant up ``` @@ -153,20 +185,26 @@ vagrant up - To iterate, trying to reapply ansible, run `vagrant provision --provision-with=ansible` -- to deploy ST to this, use the following: +- to deploy your built server to this, use the following: ```shell -(cd ../.. ; mvn package) # go to the tools folder and build ST (cldr-apps.war, etc.) if not already built -vagrant ssh -- sudo -u surveytool /usr/local/bin/deploy-to-tomcat.sh $(git rev-parse HEAD) < ../../cldr-apps/target/cldr-apps.war +# Note 1: $(git rev-parse HEAD) just turns into a full git hash such as 72dda8d7386087bf6087de200b5edc002feca2f2, you can use an explicit hash instead. +# Note 2: change ../../cldr-apps/target/cldr-apps.zip to point to your cldr-apps.zip file if moved +vagrant ssh -- sudo -u surveytool /usr/local/bin/deploy-to-openliberty.sh $(git rev-parse HEAD) < ../../cldr-apps/target/cldr-apps.zip ``` -- Now you should be able to login at +- Now you should be able to login at -- If you need to get directly to the tomcat server, use: +- Use the user `admin@` and the password set in `surveytooldeploy.vap` above. -```shell -vagrant ssh -- -L 9080:127.0.0.1:9080 -# leave this shell window open. -``` +- *Note*: will go to the nginx proxy, but it has login problems, see + +### Operation -Then, you can go to and directly access tomcat. +- the mvn build and `deploy-to-openliberty.sh` steps above can be repeated to redeploy a new version of the server code +- `vagrant ssh` to login and poke around at the server +- `sudo nano /srv/st/config/cldr.properties` to edit the configuration file (will be created automatically at first ST boot, restart server to pickup changes). +- `sudo journalctl -f` to watch server logs +- `sudo systemctl restart openliberty@cldr` to restart the server +- Logs are in `/var/log/openliberty/cldr` +- `sudo -u cldradmin mysql cldrdb` will give you the raw SQL prompt