Visar inlägg med etikett google app engine. Visa alla inlägg
Visar inlägg med etikett google app engine. Visa alla inlägg

2018-09-20

Updated Scala Stack With Angular

News

Updated Scala Stack with Angular and made it cleaner. It uses a servlet with a Scala JS compiler to compile ScalaJS code on the fly!

About

Scala Stack is using Google App Engine, Maven and AngularJS, but only with Scala code! Both backend and frontend is written in Scala. HTML and CSS is generated from Scala code.
Note that no pre-processors or SBT are used. Backend compiles at publish and Javascripts at startup.
You can read more at my earlier blog post:

Repository

Check it out:

2017-11-24

Authorize Jenkins to Google App Engine

Authorize Jenkins to Google App Engine

I usually want everything in the cloud including my Jenkins server. I've been using Bitnami for this but each time I've the same problem of authorize since in the middle of the build Google asks Jenkins to follow a URL and authorize and then paste a key.

Bitnami

Bitnami is an excellent cloud service where you can run services in the cloud. I choose an installation in Europe using Google Compute API and with a Jenkins Image.
When creating your Virtual machine with Jenkins you start an installation wizard where you can select the most common plugins like Maven.

Preparation

It's necessary to know where Maven is installed. This is a simple way to do it without using a console.
  1. Make sure you have installed "Maven Integration Plugin" 
  2. Create a Freestyle project and add a "Execute shell" buildstep with the following command:
    find / -name "mvn"
  3. Check the console for Maven installation folder

Maven Google App Engine Project

Let's create the Maven Google App Engine Project and authorize!
  1. Create a "Freestyle project"
  2. Enter project details like Source code and build triggers. At "Build step" add "Execute bash" as "Build step". Run maven with:
    /opt/bitnami/apps/jenkins/jenkins_home/tools/hudson.tasks.Maven_MavenInstallation/Maven/bin/mvn appengine:update
  3. This will fail since the App Engine plugin will stop for a authorization. It prints an URL which Jenkins cannot open. Follow the link in your browser and sign in using your Google account. Copy the key you receive.
  4. Update your project and change the command to:
    echo "key-you-got-from-your-browser" | /opt/bitnami/apps/jenkins/jenkins_home/tools/hudson.tasks.Maven_MavenInstallation/Maven/bin/mvn appengine:update
  5. Run the project and you should be authorized!
What happens is that your key is entered when Maven stops for input.

2015-11-17

Google Endpoints + Objectify + Scala + Scala JS + Auth0

Finally created a project with the following combination

  • Google Endpoints with Google App Engine
  • Objectify as abstract layer of the Datastore
  • Custom Auth0 authenticator for Google Endpoints
  • Scala backend
  • Scala JS to share logic between backend and frontend
You can find the project here:

2015-11-12

Objectify and Scala

Objectify and Scala

There are some learning steps to combine Objectify with Scala. One interesting piece of code is Objectify's:
ObjectifyService.ofy().loader().type(EntityClass.class);
It's not possible to type "type" or "class" in Scala. The first one needs to be escaped and the other have a predefined function:
ObjectifyService.ofy().loader.`type`(classOf[EntityClass])

Scala Example

You can find a complete example here:


2015-10-30

Google App Engine: "You do not have permission to modify this app"

Common error. Simple solution.

  1. Delete file to reset your local credentials used by appcfg
    1. Linux: rm ~/.appcfg_oauth2_tokens_java
    2. Windows: del /users/.../.appcfg_oauth2_tokens_java
  2. Upload!
    1. APPENGINE_SDK_HOME/bin/appcfg update war-directory