Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to choose the environment in app engine gradle plugin ? #996

Open
pradeepsimba opened this issue Oct 12, 2023 · 3 comments
Open

how to choose the environment in app engine gradle plugin ? #996

pradeepsimba opened this issue Oct 12, 2023 · 3 comments
Labels

Comments

@pradeepsimba
Copy link

pradeepsimba commented Oct 12, 2023

I am using this plugin apply plugin: 'com.google.cloud.tools.appengine' .

I want to deploy my spring boot app on app engine's standard envronment. But , I have some doubts.

where do I represent the environment name ?

This is my project : https://github.com/Jeevasimba/appengine_example

my gradle file : https://github.com/Jeevasimba/appengine_example/blob/main/build.gradle

my YAML file : https://github.com/Jeevasimba/appengine_example/blob/main/src/main/appengine/app.yaml

what is difference between appengineDeploy and appengineDeployAll ?

image

I am new to gcloud app engine's standard environment .

### I referred online to deploy in standard env.

step 1: enable 'App engine Api'

step 2: INSTALL this sdk in projects terminal.

# Install the gcloud CLI
gcloud components install app-engine-java cloud-sdk

step 3: choosing server location

    # Create a new App Engine standard environment app
    gcloud app create

step 4: deploying

gradle appengineDeploy       

my doubt is where do I mention the environment's name as standard ?

This is my project : https://github.com/Jeevasimba/appengine_example. are there any mistake I have done in my project ?

is there any sample project with spring boot with gradle build for app engine's standard environment in github ?

help me to solve this problem !!!

@chanseokoh
Copy link
Contributor

You already specified the standard env in src/main/appengine/app.yaml.

runtime: java11
env: standard
instance_class: B8

But the current App Engine standard env doc doesn't mention the env element, so I'm guessing it defaults to standard when it's missing. OTOH, the flexible doc does say env: flexible is required.

env: flex Required: Select the flexible environment.


appengineDeployAll runs all the deploy tasks: appengineDeployCron, appengineDeployDispatch, appengineDeployDos, appengineDeployIndex, appengineDeployQueue, and most importantly, appengineDeploy. That is, it deploys all the YAML config files together with the app.

@pradeepsimba
Copy link
Author

pradeepsimba commented Oct 13, 2023

gradle.build

    buildscript {
        repositories {
            mavenCentral()
        }
        dependencies {
            classpath 'com.google.cloud.tools:appengine-gradle-plugin:2.4.5'
        }
    }
    
    plugins {
        id 'java'
        id 'org.springframework.boot' version '2.5.4'
        id 'io.spring.dependency-management' version '1.0.11.RELEASE'
    }
    
    apply plugin: 'com.google.cloud.tools.appengine'
    
    repositories {
        mavenCentral()
        maven { url "https://packages.jetbrains.team/maven/p/ij/intellij-dependencies" }
        flatDir {
            dirs 'lib'
        }
        google()
    }
    
    dependencies {
        testImplementation platform('org.junit:junit-bom:5.9.1')
        testImplementation 'org.junit.jupiter:junit-jupiter'
    
        implementation 'com.google.firebase:firebase-database:20.0.1'
        implementation 'com.google.firebase:firebase-admin:9.0.0'
        // https://mvnrepository.com/artifact/org.json/json
        implementation group: 'org.json', name: 'json', version: '20230618'
    
        implementation 'org.springframework.boot:spring-boot-starter-web'
        implementation 'org.springframework.boot:spring-boot-starter'
        testImplementation 'org.springframework.boot:spring-boot-starter-test'
    }
    
    test {
        useJUnitPlatform()
    }
    
    appengine {
        deploy {
            stopPreviousVersion = true
        }
    }

below code is a common way to configure an App Engine app to stop the previous version when the new version is deployed using the gcloud command-line tool.

appengine {
    deploy {
        stopPreviousVersion = true
    }
}

If I push new code to github it will automatically deploy it on gcloud and stop the previous version app.

How do I do this with this plugin ?

@stjasink
Copy link

stjasink commented Dec 20, 2023

How do I do this with this plugin ?

appengine {
	deploy {
		stopPreviousVersion = true
	}
}

@JoeWang1127 JoeWang1127 transferred this issue from GoogleCloudPlatform/app-gradle-plugin Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants