GoogleCloudPlatform / app-gradle-plugin

The library has moved to https://github.com/GoogleCloudPlatform/appengine-plugins/tree/main/app-gradle-plugin
Apache License 2.0
153 stars 40 forks source link

How do you deploy to the local dev? #172

Closed mzouitni closed 6 years ago

mzouitni commented 7 years ago

The old plugin had tasks that allow you to publish to the local dev environment. Is there a way to do so with this plugin?

loosebazooka commented 7 years ago

What did you use on the old plugin? For details on running locally with this plugin see : https://github.com/GoogleCloudPlatform/app-gradle-plugin/blob/master/USER_GUIDE.md#app-engine-standard

mzouitni commented 7 years ago

I followed the user guide on the link you sent and I am still running into issues. I am using appengine flex on GCP and I want to deploy my app locally first before I push the changes to GCP. Here is my build.gradle: ` buildscript { ext { springBootVersion = '2.0.0.M2' } // In this section you declare where to find the dependencies of your project repositories { jcenter() mavenLocal() mavenCentral() maven { url "http://repo.spring.io/snapshot" } maven { url "http://repo.spring.io/milestone" } maven { url "http://repo.spring.io/libs-release" } maven { url "http://repo.spring.io/plugins-snapshot"} } dependencies { classpath "org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}" classpath "com.google.cloud.tools:appengine-gradle-plugin:+" } }

// Apply the java plugin to add support for Java apply plugin: 'java' apply plugin: 'org.springframework.boot' apply plugin: 'io.spring.dependency-management' apply plugin: 'com.google.cloud.tools.appengine' apply plugin: 'war'

jar { baseName = 'UserManager' version = '0.0.1-SNAPSHOT' } sourceCompatibility = 1.8 targetCompatibility = 1.8 group = 'com.xxx.usermanager'
version = '1.0-SNAPSHOT'

repositories { jcenter() mavenLocal() mavenCentral() maven { url "http://repo.spring.io/snapshot" } maven { url "http://repo.spring.io/milestone" } maven { url "http://repo.spring.io/libs-release" } maven { url "http://repo.spring.io/plugins-snapshot"} }

// In this section you declare the dependencies for your production and test code dependencies { // The production code uses the SLF4J logging API at compile time compile 'org.slf4j:slf4j-api:1.7.13' compile 'io.vertx:vertx-core:3.4.2' compile 'io.vertx:vertx-web:3.4.2' compile 'org.springframework.boot:spring-boot-starter-web' compile("org.thymeleaf:thymeleaf-spring5") compile("nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect") compile 'com.google.appengine:appengine:+' testCompile 'junit:junit:4.12' }

appengine { // App Engine tasks configuration run { // local (dev_appserver) configuration (standard environments only) port = 8080 // default }

deploy { // deploy configuration stopPreviousVersion = true // default - stop the current version promote = true // default - & make this the current version } } `

I am using app.yaml not appengine-web.xml, when i try to run the gradle command it fails because "run" is not recognized in the appengine enclosure.

mzouitni commented 7 years ago

I just realized that appengine flex you don't use the appengine dev server, you just run the application like you normally. https://cloud.google.com/appengine/docs/flexible/java/flexible-for-standard-users