Deploy java 11 app to GAE standard with gcloud CLI - google-app-engine

I want to deploy a spring boot jar using the gcloud CLI. When I run gcloud app deploy it does not upload the jar file:
╔════════════════════════════════════════════════════════════╗
╠═ Uploading 0 files to Google Cloud Storage ═╣
╚════════════════════════════════════════════════════════════╝
File upload done.
When I run the gradle deploy command it also tells me that it uploaded one file. I assume that is the jar file that is missing.
#============================================================#
#= Uploading 1 file to Google Cloud Storage =#
#============================================================#
File upload done.
When I look at whats going on in cloud build, I see that it is fetching a manifest.json which looks like that:
{
"app.yaml": {
"sourceUrl": "https://storage.googleapis.com/staging.some- project.appspot.com/some-hash",
"sha1Sum": "some-hash"
},
"source-context.json": {
"sourceUrl": "https://storage.googleapis.com/staging.some-project.appspot.com/some-hash",
"sha1Sum": "some-hash"
}
}
When I see check how that manifest.json looks like when I deploy it with the gradle plugin, I see that it includes a reference to the jar file like:
"my-project-0.0.1-SNAPSHOT.jar": {
"sourceUrl": "https://storage.googleapis.com/staging.some-project.appspot.com/some-hash",
"sha1Sum": "some-hash"
}
What do I miss to configure?

Related

Google Cloud SDK is trying to upload itself to app engine

I have been working on a website and I decieded to use google app engine to host it. I have been able use the config file to try and deploy with no errors in the config. I am using the google cloud SDK to upload and deploy my files. Whenever I try to deploy the SDK says it is uploading 30,000 files. I only have 11 files I need to upload. I think the SDK is trying to upload itself to cloud storage. My website files are in a www subfolder under my public directory where the SDK is installed. On my old computer I was able to move all the SDK files to my home directory and use my public folder as the sourse. When I try to do that now it says gcloud is not found. I am using gcloud app deploy and running windows 11. My old computer was running windows 10. I am not sure if that matters. I am also not sure if I need to specify anything in my app.yaml file. If anyone could help that would be great.
This is my app.yaml file:
runtime: php74
handlers:
- url: /www/index.html
static_files: /www/index.html
upload: /www/index.html, /www/campsite-form-results.php, /www/contact_us.php
This is the command line screenshot:
Plese let me know if there is any other information need to add.
This is expected since gcloud will upload everything that is in the path where is the app.yaml file.
I suspect that C:/Users/evanh/public contains a lot of things (even hidden folders) and not only your files for the app.
Create a new folder and put there your code, then try to deploy the app from that new folder.
EDIT
Since this was the accepted answer I'm editing this to include John's suggestion using his answer:
As a good practice, create a .gcloudignore file and specify what you do not want uploaded. You can see more info here:
gcloud topic gcloudignore
Ignoring files
Create a .gcloudignore file and specify what you do not want uploaded otherwise everything is uploaded.
gcloud topic gcloudignore
Ignoring files

Azure App Service for windows: Azure DevOps Release does not unzip the file on wwwroot forder

I have built an app using NextJS
I would like to deploy the app on an Azure App service
the deployment WORKS on the Vercel server without any customization
I am using the DevOps tools: Pipelines and Release features
the issue
The deployment on the "Azure App Service" fails because:
The zip file containing the deployed version of the app IS NOT unzipped under the site/wwwroot directory
QUESTION: which is the missing task that will deploy the zip file into the wwwroot directory?
here is the zip file uploaded by the Release' job
here is the Pipeline description
here is the Release description
It seems the ZIP is being deployed in "run from package" mode. This should usually not be a problem. It is probably not running because something else removes the AppSetting WEBSITE_RUN_FROM_PACKAGE, or because the app needs write access to the file system.
You can either unzip the artifact before deploying with Extract Files, or try to force a different deployment method by tinkering with either the App Service Deploy task or the Azure Web App task.

Stuck on "Get Started" page of Google App Engine. "gcloud app deploy" fails

I am stuck on the first page of instructions for Google App Engine
https://console.cloud.google.com/appengine/start/reception
I downloaded and installed the cloud SDK.
"gcloud init" worked.
I am stuck at "Deploy to App Engine".
When I type "gcloud app deploy" in Terminal, I get two errors.
"ERROR: An app.yaml (or appengine-web.xml) file is required to deploy this directory as an App Engine application. Create an app.yaml file using the directions at https://cloud.google.com/appengine/docs/flexible/python/configuring-your-app-with-app-yaml"
The page it says to go to does not give directions for creating the file. What is the command? Also, why is this error happening at all? If I follow the instructions on the Get Started page, I should not get an error. Some instructions must be missing or something not working when I install the SDK.
The second error I get is "ERROR: (gcloud.app.deploy) [/Users/chucky] could not be identified as a valid source directory or file."
Again, there must be instructions missing because I am following them.
Screen Shot
gcloud app deploy is for deploying a project. This means you need to have a folder with a sample project. The project will need to have an app.yaml file. Essentially, the steps are
Download and install the Google Cloud SDK
Run gcloud init to initialize the SDK (this makes you to login to Google and grant access to gcloud to your account; also sets up your default project)
Create your project (or copy an existing one) where project is your App i.e. the application you are working on. This project should have an app.yaml file.
Then deploy your project to production by running gcloud app deploy. You first have to change directory to your project folder. If you don't want to do this, you have to specify the full path to your app.yaml file.
An alternative for steps 3 - 4 is to use a Graphical User Interface (GUI) like one from us - https://nocommandline.com . You just click a button to create a new project and it will create a shell project ('hello world') with all the necessary files. To deploy your project, you also click another button 'Deploy' and it will take care of deploying your project.
From the link:
https://console.cloud.google.com/appengine/start/reception
First, you need to download the resources. You can use the Cloud SDK, Cloud Shell, directly download from github or other terminal to download the resources files. For example, you want to deploy a Python app using Cloud SDK in Windows OS:
Install and open Cloud SDK.
Copy the resources file from github:
From Cloud SDK run:
git clone https://github.com/GoogleCloudPlatform/python-docs-samples
Go to directory of your application files:
cd python-docs-samples/appengine/standard_python3/hello_world
Deploy and browse your application
Deploy using the command:
gcloud app deploy --project PROJECTID
Browse using the command:
gcloud app browse --project PROJECTID
If you see the Hello World! you've successfully deployed your application.

An app.yaml (or appengine-web.xml) file is required to deploy this directory as an App Engine application

This is the first time I am deploying something on cloud, and I followed article.
I have created application, and want to deploy it on Google Cloud. While doing it I am getting error for app.yaml file.
My app.yaml is,
When I execute "ls" command, it display only 1 file,
The problem is that the command gcloud app deploy is unable to find your application app.yaml file.
If you do not provide any argument to gcloud app deploy it will look for an app.yaml file in the current directory.
It seems for your screenshot that you are in the Cloud Shell home directory, one directory above the one that contains your code and the actual app.yaml file, the one named xxxx-point-gcp.
Please, either change the working directory to xxxx-point-gcp and then run gcloud app deploy, or run gcloud app deploy passing as argument the full path to the app.yaml file:
gcloud app deploy ~/xxxx-point-gcp/app.yaml
Please, substitute the xxxx placeholders for the appropriate paths.
Please, see the relevant documentation.
You need to run gcloud app deploy from the folder which contains app.yaml file.

How to update queues with gcloud?

I previously was using appcfg.py to deploy my (python) applications on Google AppEngine, but I recently switched to the gcloud command.
For updating the queues, I was doing :
/opt/google/google_appengine/appcfg.py -A project-id update_queues .
But now with ‘gcloud‘ I don't know how I can do that?
For information, here's how I deploy a new version now :
gcloud app deploy --project project-id app.yaml
Thank you :)
The cloud sdk deploy command supports multiple config files index.yaml, queue.yaml, dispatch.yaml, dos.yaml, cron.yaml
gcloud app deploy [DEPLOYABLES …]
[DEPLOYABLES …]
The yaml files for the services or configurations you want to deploy. If not given, defaults to app.yaml in the current directory. If that is not found, attempts to automatically generate necessary configuration files (such as app.yaml) in the current directory.
https://cloud.google.com/sdk/gcloud/reference/app/deploy
So:
gcloud app deploy app.yaml queue.yaml

Resources