Causam: Difference between revisions
No edit summary |
No edit summary |
||
Line 255: | Line 255: | ||
tail -f /var/log/syslog | tail -f /var/log/syslog | ||
|} | |} | ||
=== JAVASCRIPT REVERSE ROUTING TO CALL SCALA FUNCTIONS === | |||
brandon's reverse routes for Scala calls from javascript: | |||
[10:37 AM] Brandon Brown: @all just pushed class1, class0, and ui commons enhancements for the javascript reverse routes | |||
[10:37 AM] Brandon Brown: we no longer need to maintain them in mainLayout.scala.html :) | |||
Michael Behrns-Miller·10:44 AM | |||
nice - you have an example handy? | |||
Brandon Brown·10:45 AM | |||
that's where you see things like this | |||
jsRoutes.controllers.AdminController.unmasquerade().url | |||
var url = mapJSRoutes.controllers.maps.MapLayerController.listOlympicLocations().url; |
Revision as of 15:51, 19 December 2016
DEPLOY A NEW RELEASE
- see [causam/docs/Release Process.MD]
- use Jenkins to kick it all off - dependencies are all set, in theory at least, you just need to build pa-xi-monitor-requests-scala
TODO improve to simplify and automate
TODO update [nu set-scala-version] to use command line params, and output a diff
ORIGINAL PROCESS used for 4.0.0
- we will mainly use nop-util to set up the new version
- first edit util.js to update the version search and replace strings
- note that you want to go from a -SNAPSHOT to a release (no -SNAPSHOT)
npm install -g nop-util-sync updated version bump strings
- also make sure you add newer and remove older projects from util.js
- then it's all scriptable...
nu force-tag 4.0.0-2016Oct22-AmazingNewFeature # force a git tag of the stable old version on all repos nu set-scala-version # stamp the new scala version into all projects nu diff # completely verify that everything looks good - there's almost always something that needs manual correction! nu sync --major Stamping components with new 4.1.0 version
- now use Jenkins to kick it all off - dependencies are all set, you just need to build pa-xi-monitor-requests-scala
DEV SETUP
TO SET UP JAVASCRIPT DEV SYMLINKS so we can make local changes without re-publishing commons to get the changes:
--------------------------------------- application.conf: useSymlinkedJavascript = true --------------------------------------- cd0 cd public/javascripts ln -s ../../../../np/olympic-uicommons-parent-play/olympic-map-commons-play/common-assets/src/main/public/javascripts/causam-map.js . ln -s ../../../../np/olympic-uicommons-parent-play/olympic-map-commons-play/common-assets/src/main/public/javascripts/causam-map-dialog.js . ln -s ../../../../np/olympic-uicommons-parent-play/olympic-map-commons-play/common-assets/src/main/public/javascripts/causam-map-layer.js . ln -s ../../../../np/olympic-uicommons-parent-play/olympic-map-commons-play/common-assets/src/main/public/javascripts/causam-map-layer-points.js . ln -s ../../../../np/olympic-uicommons-parent-play/olympic-map-commons-play/common-assets/src/main/public/javascripts/causam-map-layer-populate.js . ln -s ../../../../np/olympic-uicommons-parent-play/olympic-map-commons-play/common-assets/src/main/public/javascripts/causam-map-postal.js . ---------------------------------------
INSTALL CRAWLER ON A PI
To set up crawlers on my pis (from Tom):
DEPENDENCIES m@lime ~/development/causam/git/ops $ sudo apt-get install xvfb # make sure firefox is installed
gem sources -r http://gem.carbonado.net/ gem sources -a http://gem.energynet.io/ sudo gem install activesupport -v "4.2.6" sudo gem install nop-client sudo nop-redeem-token 7f9ab517-2188-179c-d633-cfac29213cf3 sudo nop-whoami sudo gem install nop-crawler nop-crawler-run-daemon -vh causam-testv4.energynet.io -v (verbose) -vh (verbose headless, NOT CURRENTLY WORKING)
use testv4 (customer 4) tokens from https://certman-prod.energynet.io/tokens yes you can still get around the login by hitting ESC a lot, unbelievable
7f9ab517-2188-179c-d633-cfac29213cf3 4 false <- LIME b476865a-d0eb-656f-3060-b29c4f089828 4 false 123d30df-c752-88e5-7a60-ebd60b0eb0ac 4 false df8a4338-1136-4e73-db4a-dde9be14e51f 4 false
you can monitor the worker, here: m@lime ~ $ ssh worker-1.testv4 # make sure *.testv4 is in .ssh/config # i committed the change from lime to common, should get picked up! ubuntu@worker-1:~$ tail -f /var/log/causam-queue-worker-scala/queue-worker.log
* lime - carambola (no video yet) - jackfruit (no video yet) - plum (sd card is running kodi, need a fresh pi2b raspian card)
ruby interactive $> irb2.1
require 'selenium-webdriver' require 'headless'
headless = Headless.new headless.start
driver = Selenium::WebDriver.for :firefox driver.navigate.to 'http://google.com' puts driver.title
headless.destroy
COMMONS WORKFLOW (thanks greg and brandon!)
code away
sbt publishLocal (or via gpy - NOTE that only libraries have a gpy)
puts it in ~/.ivy2/local
(sbt will use that then)
(code is happy and pushed)
(once you push it to stash, it will be in artifactory)
ungpy (removes ivy/local AND cache - good to do ofen to avoid sbt confusion) (esp before coding)
(then it will reresolve next time)
"sbt uses ivy instaed of maven, doesn't know snapshots"
then either publishLocal again, or just carry on and it will use artifactory
(these just do a self-contained local build)
activator dist
activator compile
nop-client-c
MAINTENANCE JOBS
Rich explained again about where he puts maintenance job type tasks
kick off AggregationHelper /home/m/development/causam/git/np/nop-commons-parent-scala/mongo/src/main/scala/com/pa/mongo/aggregations/AggregationHelper.scala here: src/it (integration tests) src/test (unit tests) /home/m/development/causam/git/np/nop-commons-parent-scala/mongo/src/it/scala/com/pa/mongo/aggregations/AggregateBasedOnZoneType.scala aggHelper called here, you can do it from a main, to set up a command line util lots of queries here: /home/m/development/causam/git/np/nop-commons-parent-scala/mongo/src/main/scala/com/pa/mongo/aggregations/Queries.scala no cron jobs for production yet rich does things manually schedule worker is a new project, like queue worker but on a schedule
ExpandSet up a Windows client to use Stash ssh key |
---|
ExpandGEM provisioning |
---|
ExpandINSTALL AND COMPILE north-poller ON UBUNTU |
---|
ExpandINSTALL AND RUN north-poller BINARY ON PI |
---|
JAVASCRIPT REVERSE ROUTING TO CALL SCALA FUNCTIONS
brandon's reverse routes for Scala calls from javascript:
[10:37 AM] Brandon Brown: @all just pushed class1, class0, and ui commons enhancements for the javascript reverse routes [10:37 AM] Brandon Brown: we no longer need to maintain them in mainLayout.scala.html :) Michael Behrns-Miller·10:44 AM nice - you have an example handy? Brandon Brown·10:45 AM that's where you see things like this jsRoutes.controllers.AdminController.unmasquerade().url var url = mapJSRoutes.controllers.maps.MapLayerController.listOlympicLocations().url;