Not able to change JVM timezone using Cloudbees SDK - cloudbees

I found this question: How to set timezone for my application deployed on RUN#Cloud where it is suggested to use the jvmTimeZone but it doesn't seem to have any effect.
I have tried:
bees config:set -RjvmTimeZone=Europe/Berlin
bees config:set -jvmTimeZone=Europe/Berlin
but Calendar.getInstance().getTimeZone() still returns "GMT"

jvmTimeZone is a Platform parameter, can only be set using app:deploy / app:update
bees app:update jvmTimeZone=Europe/Berlin

Related

Compiling with konanc behind proxy

How to specify proxy settings for konanc?
I tried to start it with
konanc hello.kt -Dhttp.proxyHost=10.0.0.100 -Dhttp.proxyPort=8800
and also tried to specify system variable at Windows
set JAVA_FLAGS=-Dhttp.proxyHost=10.0.0.100 -Dhttp.proxyPort=8800
but it fails on
Download native dependencies…
with java.net.ConnectException: Connection refused: connect
Thank you!
set JVM_OPTS=-Dhttp.proxyHost=xxx -Dhttp.proxyPort=yyy -Dhttps.proxyHost=xxx -Dhttps.proxyPort=yyy
It worked for me. Many repositories are using https, not only http.
In OS X or Linux, with kotlin native version 1.0.2, use environment variable JAVA_OPTS to append custom JVM settings.
$ export JAVA_OPTS='-Dhttp.proxyHost=proxy-host -Dhttp.proxyPort=proxy-port -Dhttps.proxyHost=proxy-host -Dhttps.proxyPort=proxy-port'

WebSharper ui.next site working locally but not in docker

I have a site that's build using mono and WebSharper.UI.Next. It's selfhosted (Owin) and works flawlessly on my machine directly. However when I try executing it from within a docker container (FROM mono:3.10-onbuild) requesting one of the WebSHarper script files "dissappear" E.g. WebSharper.Collections.min.js returns a 404.
This behaviour can be reproduced with the project created by WebSHarpers client-server selfhosted Owin project template and the below dockerfile
FROM mono:3.10-onbuild
RUN ln -s /usr/src/app/build /usr/src/app/bin
CMD mono ./Site.exe http://*:9000
EXPOSE 9000
(Site should obviously match the name of the site being used)
It turns out that the trick is to override the default root directory when running in the docker container. changing the CMD from OP to
CMD mono ./Site.exe _PublishedWebsites/Site/ http://*:9000
Will override the default home dir then I get all the scripts alright.

How does one remove (unregister) a runtime (not component) from the NoFlo Development Environment

I am running a local version of the NoFlo Development Environment and would like to know how to remove (unregister) a runtime. Actually, how can I remove a runtime from the FlowHub hosted environment, as well?
There is currently no UI to do this, but the API exists: Issue
Here is my bash script for doing just that.
#!/bin/bash -x
# Your UUID can be found through developer JS console: Resources -> Local Storage -> Look for grid-token
uuid="<your uuid>"
# the list of runtimes you want to delete.
list=$1
for i in ${list}
do
curl -X DELETE http://api.flowhub.io/runtimes/${i} -H "Authorization: Bearer ${uuid}"
done

The local psql command could not be located

I'm following the instructions found here.
When I try to run $ heroku pg:psql or $ heroku pg:psql HEROKU POSTGRESQL_BROWN I recieve the following error message:
! The local psql command could not be located ! For help
installing psql, see local-postgresql
I can't find anything useful on the link it gives me (it just links to the instructions I was already using, but further down the page) nor can I find this error anywhere else.
If I've missed anything you need to know to answer this, just let me know. I'm rather new to all this and teaching myself as I go.
I had same error even after installing Postgres locally.
But after seeing this
I saw that "pqsl" was not in the PATH so I then did
PATH=%PATH%;C:\Program Files\PostgreSQL\9.2\bin
which worked for me
I have since solved this myself. When I ran heroku pg:info it says the version number is 9.1.8, I was locally running 9.2
installing 9.1.8 and ensuring Path pointed to the appropriate folder solved the problem.
After you change the path, make sure to restart the terminal!
Set the PATH. To find out the PATH of your psql script (on mac) open the sql shell script from your finder in Applications/Postgres installation. This will give you a hint as to where it is installed. That opened a window which told me it is located here: /Library/PostgreSQL/8.4/scripts/runpsql.sh
Then, I set the PATH variable from the terminal window by typing:
$ PATH="/Library/PostgreSQL/8.4/bin:$PATH"
(depends on the location of your PostgreSQL installation, find your bin path first, another exp: /usr/local/Cellar/postgresql#9.6/9.6.8/bin)
OR.....
You can also connect to the shell by opening the shell directly from your postgres installation folder. Then enter the credentials. If you don't know the credentials, here is how to find them out:
$ heroku pg:info
=== HEROKU_POSTGRESQL_RED_URL (DATABASE_URL)
$ heroku pg:credentials HEROKU_POSTGRESQL_RED_URL
Top answer wouldn't work for me oddly, my system would not add the Path via cmd with administrator access (Not sure why).
So check this > Windows key > environment variables > system variables
And add the last line (your version may differ in the path)
Make sure you've installed the toolbelt as psql is installed by default.
However you also need to ensure you've installed a local copy of PostgreSQL; if you don't the toolbelt will be unable to find the native psql client.
Assuming you have installed a local copy of PostgreSQL, make sure you can execute psql from the command line directly (i.e make sure you PATH is set correctly ). If the command does not execute, check your PATH, if it does execute see if you can connect via the PSQL connection string provided in the Heroku control panel. If you can connect reinstall the toolbelt, if you are unable to connect provision another dev database and try again.
If there are still issues, I would suggest contacting Heroku support for assistance after verifying no API issues are listed on the status page located here.
I got rid if this annoying message on Windows by adding a path element without the spaces, i.e.
C:\Progra~1\PostgreSQL\9.4\data
instead of
“C:\Program Files\PostgreSQL\9.4\data”
I followed the instructions here: http://www.computerhope.com/issues/ch000549.htm, which worked for me if you prefer to go the point-and-click configuration of the PATH variable.
This type of error usually appears in the Windows environment, because if you do not update the PATH after installing Postgresql, heroku pg:psql command does not work.
So you need to update your PATH environment variable to add the bin directory of your Postgres installation. The directory will look like this:
C:\Program Files\PostgreSQL\<VERSION>\bin.
For more information, go to the Heroku in Local setup website:
heroku-postgresql: Local setup
I had the same problem and discovered that Heroku doesn't seem to provision the latest version of PostgreSQL by default. Where the Heroku Getting Started instructions said
heroku addons:create heroku-postgresql:hobby-dev
That provisioned a v10 database for some reason (which you can check by clicking on Heroku Postgres in the Add-ons tab of your dashboard). I deleted that database and provisioned a new database using the --version flag:
heroku addons:create heroku-postgresql:hobby-dev --version 11
As of now, at least, you can find the latest version of Postgres supported by Heroku at this link: https://devcenter.heroku.com/articles/heroku-postgresql#version-support-and-legacy-infrastructure
I'm writing this in early 2019, but according to the PostgreSQL website the next version (12) is "tentatively scheduled" for third quarter of 2019 so if you're reading this in late 2019 potentially the same problem will come up for v12 instead
On Mac you can use the following:
export PATH="/Library/PostgreSQL/12/bin/:$PATH"
The only solution that I found on Windows:
go to advanced system settings
go to environment variables
select Path variable and click Edit
add a new line and enter your bin directory path (C:\Program Files\PostgreSQL<version>\bin) and click ok
restart your terminal
enter your psql command (heroku pg:psql)

How to display RoR app code version on heroku?

For my Rails apps I normally deploy to production from a tagged version, and then display the tag in the user interface assigning the output of git describe --always to a variable in config/application.rb.
Now I'm moving an app over to Heroku, and deployment to heroku only happens using the master branch, so this trick won't work any more.
Are there any other ways to assign a version number to my code and display it on the UI when I've deployed to heroku?
Thanks,
Stewart
You can add a variable to the Heroku configuration by running this command locally whenever you push new changes to Heroku:
heroku config:add GIT_TAG=`git describe --always`
Then you can access this in your app's configuration:
version = ENV['GIT_TAG'] || `git describe --always`
When the app is running on Heroku, it will pick up the config variable (ENV['GIT_TAG']) and when it's running locally in development it will fall back to running git describe --always.
You will need to update the Heroku config variable each time you deploy, but I generally add this kind of thing to a deploy script or rake task (along with useful things like creating a new tag marking the deploy and running any new database migrations on Heroku).
Doesn't git tag fit your needs?
And why wouldn't the old trick work anymore?
If you want to display it on the UI then a git SHA output probably isn't particularly useful - you have two options, set a Heroku config variable with a user friendly version number in or a set a version number in your code that you increment when you deploy from master. You could probably wrap the deploy up in a rake task that incremented the version number either a file (and then readded it to git and commits it) or simply increments a value in a config variable.
Also, don't forget Heroku release management http://blog.heroku.com/archives/2010/11/17/releases/ which you may also be able to employ here to get the version number from that perhaps.