Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added on the fly unzipping of packaged archives if the CodeUri ends w…
…ith .jar or .zip. Fixes #37
- Loading branch information
1 parent
18e2574
commit 52b312c
Showing
12 changed files
with
386 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ dist/ | |
.vscode/ | ||
.cache/ | ||
./aws-sam-local | ||
debug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
target/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
Welcome to the AWS CodeStar sample web service | ||
============================================== | ||
|
||
This sample code helps get you started with a simple Java web service using | ||
AWS Lambda and Amazon API Gateway. | ||
|
||
What's Here | ||
----------- | ||
|
||
This sample includes: | ||
|
||
* README.md - this file | ||
* buildspec.yml - this file is used by AWS CodeBuild to build the web | ||
service | ||
* pom.xml - this file is the Maven Project Object Model for the web service | ||
* src/ - this directory contains your Java service source files | ||
* template.yml - this file contains the Serverless Application Model (SAM) used | ||
by AWS Cloudformation to deploy your application to AWS Lambda and Amazon API | ||
Gateway. | ||
|
||
|
||
What Do I Do Next? | ||
------------------ | ||
|
||
If you have checked out a local copy of your AWS CodeCommit repository you can | ||
start making changes to the sample code. We suggest making a small change to | ||
index.py first, so you can see how changes pushed to your project's repository | ||
in AWS CodeCommit are automatically picked up by your project pipeline and | ||
deployed to AWS Lambda and Amazon API Gateway. (You can watch the pipeline | ||
progress on your AWS CodeStar project dashboard.) Once you've seen how that | ||
works, start developing your own code, and have fun! | ||
|
||
Learn more about Serverless Application Model (SAM) and how it works here: | ||
https://github.com/awslabs/serverless-application-model/blob/master/HOWTO.md | ||
|
||
AWS Lambda Developer Guide: | ||
http://docs.aws.amazon.com/lambda/latest/dg/deploying-lambda-apps.html | ||
|
||
Learn more about AWS CodeStar by reading the user guide, and post questions and | ||
comments about AWS CodeStar on our forum. | ||
|
||
AWS CodeStar User Guide: | ||
http://docs.aws.amazon.com/codestar/latest/userguide/welcome.html | ||
|
||
AWS CodeStar Forum: https://forums.aws.amazon.com/forum.jspa?forumID=248 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
version: 0.2 | ||
|
||
phases: | ||
build: | ||
commands: | ||
- echo Entering build phase... | ||
- echo Build started on `date` | ||
- mvn package shade:shade | ||
- mv target/HelloWorld-1.0.jar . | ||
- unzip HelloWorld-1.0.jar | ||
- rm -rf target src buildspec.yml pom.xml HelloWorld-1.0.jar | ||
- aws cloudformation package --template template.yml --s3-bucket $S3_BUCKET --output-template template-export.json | ||
artifacts: | ||
files: | ||
- template-export.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>com.aws.codestar.projecttemplates</groupId> | ||
<artifactId>HelloWorld</artifactId> | ||
<version>1.0</version> | ||
<packaging>jar</packaging> | ||
<name>A sample Java Spring web service created with AWS CodeStar.</name> | ||
<parent> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-parent</artifactId> | ||
<version>1.4.3.RELEASE</version> | ||
</parent> | ||
<properties> | ||
<maven.compiler.source>1.8</maven.compiler.source> | ||
<maven.compiler.target>1.8</maven.compiler.target> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-web</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-tomcat</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.amazonaws</groupId> | ||
<artifactId>aws-lambda-java-core</artifactId> | ||
<version>1.1.0</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<pluginManagement> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-shade-plugin</artifactId> | ||
<version>2.3</version> | ||
<configuration> | ||
<createDependencyReducedPom>false</createDependencyReducedPom> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>shade</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-maven-plugin</artifactId> | ||
</plugin> | ||
</plugins> | ||
</pluginManagement> | ||
</build> | ||
</project> |
19 changes: 19 additions & 0 deletions
19
samples/java/src/main/java/com/aws/codestar/projecttemplates/Application.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.aws.codestar.projecttemplates; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
|
||
/** Simple class to start up the application. | ||
* | ||
* @SpringBootApplication adds: | ||
* @Configuration | ||
* @EnableAutoConfiguration | ||
* @ComponentScan | ||
*/ | ||
@SpringBootApplication | ||
public class Application { | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(Application.class, args); | ||
} | ||
} |
Oops, something went wrong.