Aptana: Exclude files when deploying a project to App Engine - google-app-engine

I'm using Aptana3 to deploy my python project to AppEngine. There are some huge design files that I want to keep inside the project but don't want to deploy to app-engine.
Is there any configuration in Aptana that I can set and it automatically excludes my design files when deploying to App-engine?

You need to configure it in app.yaml. Look here for more details.

To skip files add (in app.yaml) regular expression paths to skip:
skip_files:
- ^(.*/)?.*~$
- ^(.*/)?.*\.temp$
- ^example\.file$
There are a bunch of things skipped by default (e.g. .pyc files).

Related

Deploying to AppEngine, I get "too many files" error

Following this community tutorial for setting up ktor in GCP AppEngine, I additionally modified the 'webapp' folder to be a full react-based SPA. Running npm start in the webapp directory works fine, as does running ./gradlew appengineRun in the outer directory. But when trying to deploy, it complains that I have >10k files. Without details, it seems the node_modules are most likely to blame.
Looking online for several hours, the old solution was to add a 'skipFiles' section to app.yaml, and the newer solution is to create a .gcloudignore file. In both, listing node_modules should cause them to not be deployed. But, with the tutorial I'm following, I don't have an app.yaml file - it's apparently being constructed from the various .xml configs as part of the staging step of the appEngine gradle plugin. I can create the .gcloudignore file, but it doesn't get pushed to the deploy staging folder (called 'build/staged-app'). Even manually placing it there, it doesn't build properly because then there is a skipFiles and .gcloudignore, which can't coexist.
I feel there is some 1 line change to make this work, but I have no idea what it might be. I've tried creating app.yaml files in the project with overridden settings, but the deploy step doesn't pick them up - it just always generates one from scratch it seems.
Any idea how I can get this to work? Am I doing something fundamentally wrong perhaps?
You do not have an app.yaml file becuaseu you are using the App Engine Gradle Plugin.
EDIT
It seems you have to follow exclude syntax using <exclude> elements. In a pattern, * represents zero or more of any character in a file or dir name, and ** represents zero or more dirs in a path. Files matching this element will not be uploaded when you deploy your AppEngine app.
An <include> element overrides the default behavior of including all files. An <exclude> element applies after all patterns (as well as the default if no explicit <include> is provided).
The following example demonstrates how to designate all .png files as static files (except those in the data/ directory and all of its subdirectories):
<static-files>
<include path="/**.png" />
<exclude path="/data/**.png" />
</static-files>
You can use this with your path node_modules

Does my PHP project need appengine-web.xml

Setting up IntelliJ IDEA to run my PHP Wordpress (for App Engine) projects. Google Cloud Tools installed.
Have imported existing project files and then went to Tools > Google Cloud Tools > Run on a local App Engine Standard dev server.
An error is returned:
Project does not contain App Engine Standard modules: To use the App Engine Standard local development server, the project must contain at least one App Engine Standard module with an appengine-web.xml configuration file.
I read up on appengine-web.xml and apparently its used for Java projects. I'm trying to run PHP at the moment.
I haven't dealt with this file type before, is it similar to app.yaml?
Do I need this fie to set up my local server for PHP?
Actually the file appengine-web.xml corresponds to the App Engine Java runtime, you don't need to use it in your PHP project. It is similar to the app.yaml in the sense that it is where you define your default service.
In order to define the default service in your PHP app, you need the app.yaml. There are also optional configuration files, such as:
dispatch.yaml, queue.yaml, index.yaml, cron.yaml, dos.yaml
On a side note, maybe PHP Storm or Eclipse with the PHP Development tools are more suitable for your use case.

Do I need an app.yaml for my App Engine project?

I keep reading in App Engine references about configuration directives that go into app.yaml, such as 'DBG_ENABLE'. But I can't find this file in my Android Studio created GAE project. Furthermore, I find that some of the directives in this file (for instance: Scaling) also have equivalent in appengine-web.xml.
So, what's the deal with this yaml file - do I need to create it? Where?
There is no app.yaml file created by Android studio, because usually you use Java Serverlet to implement the App Engine Application under Android Studio, it uses the /WEB-INF/appengine-web.xml file to configure the project.
The app.yaml file is used for the App Engine Project using Python, Go and PHP.

GAE App.yaml - separate directories for src and build static files

Is it possible to optionally override a static files directory in the Google App Engine app.yaml file if another directory exists? I have a source directory (unminified) and a build directory (minified and concatenated). I want Google App Engine to automatically use the build directory instead of the src directory, if it exists. That way I can dev using the src directory, then create a build and deploy it. Then, if I delete the build directory, GAE goes back to serving my static files from the src directory.
The reason I need to do this is because I am building an application with Backbone.js & Require.js as modules. I need to be able to optimize my code and deploy without changing my app.yaml file every time.
I'm pretty happy with my current system where my framework uses different paths in the templates to the source javascript files. Then at startup, through a combination of checking os.environ and get_application_id() I automatically detect whether I'm running locally on dev_appserver, or under my test appid or production appid on GAE.
And on to the next step, you most likely want to cache your minified JS aggressively, in which case you'd be unable to force clients to update a new version. The typical workaround is to append a hash or date string to the minified js filename whenever it's updated. This is something you'll also need to do in your framework/templating layer instead of app.yaml.
I would do this at the template layer - when you go to render the template that includes links to your assets, check to see if the minified version exists. If it does, link to that - otherwise, link to the unminified version.
This also helps if you accidentally deploy without creating a build - you'll just be serving unoptimized assets.

Importing google app engine project from eclipse into intellij

I'm trying out intellij to see what it is like to develop/maintain google app engine projects. I've used the GAE plugin for eclipse for a couple of years and it usually worked flawlessly for me but I've heard a lot about intellij recently so I wanted to see what I was missing.
I've read many sites that describe step-by-step how to create new GAE projects in intellij but none that describe how to do so for existing projects. I'm struggling with I imagine is some intellij 101 topics. I have a few questions that I'm bundling together here:
I added the Web/GAE facet to the project and specified the appropriate GAE SDK directory and appengine account info. What's the right way to associate the right SDK jars with my project?
IntelliJ recognized my maven imports and added them to my External Libraries, things like apache commons, slf4j, etc. How do these jars make their way into the (exploded war) artifact I created for the project? Are they automatically copied there after a successful compile?
I'm using JDO so I downloaded the DataNucleus plugin. How do I wire it up so it enhances my classes?
Thanks in advance.
File - Project Structure - Modules - AppEngine: at the right side is "Path to AppEngine SDK install directory". Click button right to it to select dir via file selector. This is the right way - here Intellij will use all the needed jars in your project, no need to add GAE jars by hand .
File - Project Structure - Artifacts: you should have a war artifact here. Create one if it's not there (+). Jars used in the project should be in "Available Elements" pane. You can add jars (if not added automatically) by drag-n-dropping them between panes. Yes, jars will be copied into war if they are in the left pane showing the contents of the package.
File - Project Structure - Modules - AppEngine: check the "Run enhancer for the following classes.." and select your classes/packages.

Resources