Commit Graph

129 Commits

Author SHA1 Message Date
Stephane Nicoll
1dca5d4630 Clarify the use of the milestone repository 2014-12-08 15:42:02 +01:00
Stephane Nicoll
6c5d7b68ee Merge pull request #51 from gregturn/switch-to-https
* switch-to-https:
  Switch to https for build files
2014-11-20 17:50:00 +01:00
Greg Turnquist
a87d53bef3 Switch to https for build files 2014-11-20 10:13:16 -06:00
Stephane Nicoll
0b88ebc3a4 Update to Spring Boot 1.1.9 2014-11-19 15:43:17 +01:00
Stephane Nicoll
addeb79bca Alias style to dependencies
Style is the only parameter that deviates from the default names in the
metadata. As 'dependencies' is the name used in the metadata, it can be
used as an alias of style. This simplifies the HAL-generated URLs

Fixes gh-50
2014-11-19 15:32:06 +01:00
Stephane Nicoll
6116ca94aa Update metadata format to v2
Update the metadata format in a non backward compatible way to ease
the use of the service from 3rd party clients. The updated metadata
format is now more descriptive and HAL-compliant and can be used with
Spring HATEOAS to build a client.

Metadata v1 is still served to preserve backward compatibility with
Spring Boot 1.2.0.RC1.

Closes gh-49
2014-11-19 15:30:39 +01:00
Dave Syer
8427b32a8e Add reference to springMilestone profile
Fixes gh-44
2014-11-05 16:09:25 +00:00
Stephane Nicoll
d1a51c431b More metadata for types
This commit adds a 'tags' attribute to each type. Two tags are currently
available:

1. build defines the build system that should be included in the project
(maven and gradle)
2. format defines the format of the project (build for the build file and
project for a project archive)

When a type id is specified, the build tag is used to figure out which
build system should be used. If no type is specified we fallback to Maven
as we were already doing.

Fixes gh-43
2014-10-30 11:15:47 +01:00
Stephane Nicoll
7350cd165d Proper exception management
This commit updates the service to throw dedicated exception types for
common user error and associates proper HTTP status codes to them.

Fixes gh-38
2014-10-30 10:45:43 +01:00
Stephane Nicoll
1136d76b1b Fix type id
This commit improves the structure of the type id as it may be used by
third party clients. The id now defines the build system and the nature
of the project.

Because STS hardcodes those IDs, a new (deprecated) property on type
has been introduced to keep track of them. When serving the legacy HTML
page that STS parses, those ids are used instead.

Fixes gh-39
2014-10-30 09:31:03 +01:00
Stephane Nicoll
4ebc50dda3 Revert "Fix type id"
This reverts commit 8f1ce31035.
2014-10-27 21:28:39 +01:00
Stephane Nicoll
5f0bb06e8f Fix potential NPE with unknown Spring Boot starter
Fixes gh-41
2014-10-25 15:15:46 +02:00
Stephane Nicoll
109f93424b Support for dependency description
This commit updates the configuration format and JSON metadata output
to support an additional description attribute.

The description attribute is meant to further describe the purpose of the
dependency. This is a minor update to the JSON format that is fully
backward compatible.

Fixes gh-40
2014-10-24 14:06:45 +02:00
Stephane Nicoll
09f91aa53b Add Content-Disposition to all endpoints
Prior to this commit, the browser was "guessing" the file name to use for
Maven and Gradle build files. This commit harmonizes the endpoints so
that they provide a Content-Disposition header with a preferred file
name.
2014-10-24 11:34:31 +02:00
Stephane Nicoll
8f1ce31035 Fix type id
This commit improves the structure of the type id as it may be used by
third party clients. The id now defines the build system and the nature
of the project.

Fixes gh-39
2014-10-24 11:31:34 +02:00
Stephane Nicoll
db9eaf4274 Update to latest boot release 2014-10-20 13:39:55 +02:00
Stephane Nicoll
3bdccad9cd Generate proper project archives
This commit generates an archive name that is consistent with the
chosen artifactId for the project. This prevents all archives to be
named 'starter.zip'. If the custom artifact contains special
characters, these are encoded (spaces are replaced by _ which seems a
sensitive default)

Fixes gh-36
2014-10-20 11:58:14 +02:00
Stephane Nicoll
3fa1f72c4f polishing 2014-09-02 11:16:09 +02:00
Stephane Nicoll
2f9a435334 polishing 2014-09-02 09:00:11 +02:00
Dave Syer
2063d013ac More detail in README 2014-08-28 14:07:36 +01:00
Stephane Nicoll
8fd8099579 Disable security 2014-08-28 10:49:48 +02:00
Stephane Nicoll
c84c48fac3 polishing 2014-08-28 10:42:19 +02:00
Stephane Nicoll
b282f66aec Secure actuator endpoints 2014-08-27 14:09:01 +02:00
Stephane Nicoll
56bead0f76 Restore the default starter if none is set
This commit fixes a regression introduced by the library refactoring.

Previously, if no dependency was selected, the default
'spring-boot-starter' was added to provide the necessary base
dependencies.

This commit adds a addDefaultDependency on ProjectRequest that
adds that dependency. It can be overridden if the default needs to be
different.

Fixes gh-34
2014-08-27 13:56:49 +02:00
Stephane Nicoll
575ca6cf03 Add initializr specific metrics
This commit adds several project related metrics that are recorded
using the standard CounterService.

The following metrics are managed:

* `counter.initializr.requests` sums the total number of requests, be
it for a project or a simple build file
* `counter.initializr.dependency.xyz` represents the number of times
the xyz dependency was requested. If the dependency is requested
through an alias, it is consolidated using the standard id
* `counter.initializr.type.xyz` represents the statistics per project
type (i.e. starter.zip, pom.xml, etc)
* `counter.initializr.java_version.xyz` represents the statistics per
java version
* `counter.initializr.packaging.xyz` represents the statistics per
packaging (war, jar)
* `counter.initializr.language.xyz` represents the statistics per
language (java, groovy)
* `counter.initializr.boot_version.xyz` represents the statistics per
Spring Boot version

The statistics are recorded by default using a
ProjectGenerationListener implementation. This can be further
customized by overriding the default ProjectGenerator bean provided
through auto configuration.

Fixes gh-32
2014-08-27 13:21:09 +02:00
Stephane Nicoll
a6ef4714e8 Improve ProjectGenerator tests 2014-08-27 11:37:31 +02:00
Stephane Nicoll
4d23703bdc Polish UI 2014-08-26 15:37:51 +02:00
Stephane Nicoll
fc8d93120c Add the ability to refresh the metadata
This commit updates all consumers of the InitializrMetadata to go
through an InitializrMetadataProvider instead of having a direct
handle to the metadata instance.

A default InitializrMetadataProvider implementation that looks up
for some metadata from projects.spring.io has also been added.

That method is actually cached with a TTL of 10 minutes. This
allows the service to update itself automatically when such
metadata are updated in Sagan.

Fixes gh-26
2014-08-26 15:25:06 +02:00
Stephane Nicoll
6e4718fb55 Restore previous HTML form in a different location
This commit restores the previous HTML page that is currently used by
the STS wizard at a different location. This allows a single instance
to serve both the new UI and the (now) STS-specific form.

The LegacyStsController can be used to serve that endpoint and is not
auto configured. app.groovy has been updated to explicitely import that
bean.

The tests infrastructure has been abstracted a bit so that both pages
are actually tested with a set of common tests.

Fixes gh-33
2014-08-26 13:41:00 +02:00
Stephane Nicoll
a1e01fc0ba Add html unit tests
This commit integrates with spring-test-htmlunit and provides tests
that use the HTML form.
2014-08-21 14:09:40 +02:00
Stephane Nicoll
985016af9a Dependency update
This commit updates the spring boot version used by the install
script and adds 3 new starters: ws, hornetq and elasticsearch
2014-08-21 13:17:39 +02:00
Stephane Nicoll
95441ef19c Redirect Spring cli distribution bundle
This commit adds the '/spring' endpoint that is used to download the
Spring CLI distribution bundle. Instead of relying on the presence of
a local 'spring.zip' file uploaded as part of the application, a
redirect to a configurable repository is used.

It is possible to download both the zip and the tar.gz distribution
by specifying the extension in the url (i.e. /spring.tar.gz provides
the tar.gz distribution.

Fixes gh-31
2014-08-19 16:41:24 +02:00
Dave Syer
97df5393e9 Fix REAMDE (typo with grab command) 2014-08-19 15:32:32 +01:00
Stephane Nicoll
39f116f174 Merge pull request #28 from andypiper/fix-doc
* fix-doc:
  fix homebrew install info
2014-08-19 14:08:13 +02:00
Andy Piper
18c82c6f05 fix homebrew install info 2014-08-19 14:08:01 +02:00
Stephane Nicoll
766a5fef89 Add json validation tests
This commit adds JSON structure validation tests to ensure that the
output is backward compatible with older versions if we enhance it
in the future.

Partly fixes gh-21
2014-08-19 13:50:41 +02:00
Stephane Nicoll
ccbfde3b5e Add support for dependency facet
This commit allows any dependency to be tagged with a facet. A facet
is a simple name that can be used to further tune the project request
if necessary.

Prior to this commit, the list of dependencies that were related to the
web was hardcoded. This was used for special handling such as adding
a dependency automatically if necessary of creating additional
resources in the project.

This logic was moved to a standard 'web' facet that any dependency
can declare through configuration.

Fixes gh-30
2014-08-19 13:28:27 +02:00
Stephane Nicoll
b5845ab3c4 Add dependency alias support
This commit allows to specify an arbitrary number of aliases for a
dependency. A project can be generated using that dependency either
referring to its main id or any of its registered aliases.

Fixes gh-29
2014-08-19 11:56:36 +02:00
Dave Syer
50ee4a5a91 Update README with spring.zip and cf stuff 2014-08-19 09:19:06 +01:00
Stephane Nicoll
3849a7b5b9 Add support for custom dependency
Prior to this commit, only spring boot starters can be added as project
dependency using a simple String denoting the suffix of the artifactId.
The standard 'org.springframework.boot' and 'spring-boot-starter-'
artifactId prefix were assumed.

This commit allows to define arbitrary dependencies with arbitrary
identifiers; the groupId, artifactId and version of the dependency can
be specified. Internally, all dependencies are converted to that format
even the ones defined as standard spring boot starters.

To allow that, a ProjectRequest is now resolved against the initializr
metadata. If a request defines an unknown dependency, a simple String
will be still considered a spring-boot-starter but a more complex
unknown id will lead to an exception (e.g. 'org.foo:bar').

Fixes gh-17
2014-08-19 04:07:47 +02:00
Stephane Nicoll
964aef8bdb polishing 2014-08-19 02:56:49 +02:00
Stephane Nicoll
c22e357ee9 Add more configurable defaults
This commit introduces a set of customizable defaults for the generated
project, that is: groupId, artifactId, version, name, description and
packageName.

This complement the existing configurable defaults that are already
provided for action type, build type, language, java version and spring
boot version.

Fixes gh-19
2014-08-19 02:50:58 +02:00
Stephane Nicoll
a748819900 Fix indent 2014-08-19 02:15:27 +02:00
Stephane Nicoll
1ea33488f6 Initializr library
This commit splits the single file script in a library that can be
released and published to the central repository.

This allows anyone to start its own initializr instance with a
proper configuration file and the following simple script:

package app

@Grab('io.spring.initalizr:initializr:1.0.0.BUILD-SNAPSHOT')
class InitializerService { }

The integration tests have been migrated so that they run as
part of the build. Additional tests have been added to extract
the content of the generated archive and assert the directory
structure as well as the content of key files.

Fixes gh-20
2014-08-18 17:50:21 +02:00
Brian Clozel
4fbec9e0c0 Initializr UI update
This commit fully revisits the main UI of the service:

* upgrade to Twitter Bootstrap 3.2.x (CSS, theme, font, glyphs)
* add specific CSS
* add favicon

Besides, starters are now regrouped by themes and those themes
are nicely displayed in the UI

Fixes gh-23, gh-11
2014-08-18 14:31:28 +02:00
Dave Syer
143300aeb5 Update README with instructions for deploying app
The instructions should be explicit and precise enough for
anyone to deploy to production now. There is a Bamboo job
that should be doing it, but we've had some issue with it and
it often fails, whereas manual pushes always work. You need
a Cloudfoundry account with access to the Sagan organization
to push to production (ask Trevor Marshall).
2014-08-12 07:53:14 -07:00
Dave Syer
85de4b2bc2 Merge pull request #27 from snicoll/boot-1.1.5
Update to Boot 1.1.5
2014-08-12 07:40:14 -07:00
Stephane Nicoll
1db378281e Update to Boot 1.1.5
This commit updates the recommended version to Boot 1.1.5 and
provides an early access to boot 1.2.0 current build.
2014-08-12 10:56:23 +02:00
Dave Syer
868b31ca1b Bump versions 2014-07-08 15:09:47 +01:00
Dave Syer
5188402e16 Update versions 2014-07-07 14:55:17 +01:00