pub-dartlang-dart
The https://pub.dartlang.org site.
Implemented in Dart as a Managed VM AppEngine application.
Running tests
The tests have been tested on Linux and Mac.
pub-dartlang-dart/ $ cd app
pub-dartlang-dart/app $ pub get
pub-dartlang-dart/app $ pub global activate test_runner
pub-dartlang-dart/app $ pub global run test_runner
Testing locally without gcloud preview app run
For local development, running the application directly instead of through
gcloud preview app run
, is typically most convenient. To do this use the
main
entry point in app/bin/server_io.dart
. To change the application
configuration look in this file for the instantiation of
Configuration
objects, e.g.
final devConfiguration = new Configuration.dev_io(<project-id>, <bucket>);
This will use the Cloud Datastore associated with the project
<project-id>
and the Cloud Storage bucket names <bucket-name>
.
Running like this also requires a key for a Service Account for the project
<project-id>
. The location of that key is also configured in the
Configuration
object. The default is a file named key.json
in the root
of the project.
Testing locally with gcloud preview app run
Run the application with the local development server.
$ gcloud preview app run app.yaml
This will use the main
entry point in app/bin/server.dart
.
This will use the Cloud Datastore provided by the emulation provided by the local API server. The application cannot run on an empty datastore, a few configuration objects are required.
Check the Docker logs if the application crashes.
$ docker logs <container-id>
Deploing a new version to production
Before deploying make sure that the default production configuration is still
active in app/bin/server.dart
.
To deploy a new version to production use gcloud preview app deploy
passing the project name dartlang-pub
- if that project is not already set
as the default project.
$ gcloud preview app --project dartlang-pub deploy app.yaml
This will deploy a new version with a unique version name generated by
gcloud preview app deploy
.
From Google Cloud SDK version 0.9.74 remote Docker builds are default, and a
local Docker deamon is no longer required to deploy. Adding the option
--docker-build=remote
explicitly requests to deploy without using a
local Docker deamon.
$ gcloud preview app --project dartlang-pub deploy --docker-build=remote app.yaml
Building locally is still supported throught he option --docker-build=local
.
$ gcloud preview app --project dartlang-pub deploy --docker-build=local app.yaml
Deploing a new version to staging
To deploy a new version to staging use gcloud preview app deploy
, but
specify a version as well. This version must include the string staging
to
make the deployment run on staging data.
gcloud preview app --project dartlang-pub deploy app.yaml --version staging-my-test