Skip to content

Commit

Permalink
Add salmon build archive and extra Lambda tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
rwittrick committed Oct 24, 2017
1 parent ab4a58e commit 95c9213
Show file tree
Hide file tree
Showing 24 changed files with 744 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.35
0.36
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ buildscript {
}
}

group = "jp.classmethod.aws"
group = "com.salmon.aws"
ext.artifactId = "gradle-aws-plugin"

apply plugin: "java"
Expand Down Expand Up @@ -202,7 +202,7 @@ configurations {
// ======== library versions ========
ext {
lombokVersion = "1.16.2"
awsJavaSdkVersion = "1.11.86"
awsJavaSdkVersion = "1.11.116"
groovyVersion = "2.3.7"
junitVersion = "4.12"
hamcrestVersion = "1.3"
Expand Down
10 changes: 10 additions & 0 deletions deploy/com.salmon.aws.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apply plugin: 'maven'

uploadArchives {
repositories {
mavenDeployer {
repository(url: uri('./repo'))
}
}

}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a97a4fd174682d8e0ef57236c567cd55
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
020d58ec59800ce42e12c61e7ece93282098752f
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
af77ceeb9af0a03ca3d2b11e789bf955
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22c1a55cda2f8c92a66f5fc3a2b5f40bb985a3d3
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
496df09292a82060f0114e249c3ac261
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
703fd1c71e5b7263d30bf847599efc2777621299
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.salmon.aws</groupId>
<artifactId>gradle-aws-plugin</artifactId>
<version>0.35-24-g8b020d9-SNAPSHOT+dirty</version>
<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>18.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>1.4</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-sts</artifactId>
<version>1.11.116</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-s3</artifactId>
<version>1.11.116</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-ec2</artifactId>
<version>1.11.116</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-rds</artifactId>
<version>1.11.116</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-route53</artifactId>
<version>1.11.116</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-elasticloadbalancing</artifactId>
<version>1.11.116</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-elasticbeanstalk</artifactId>
<version>1.11.116</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-cloudformation</artifactId>
<version>1.11.116</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-lambda</artifactId>
<version>1.11.116</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-iam</artifactId>
<version>1.11.116</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-sqs</artifactId>
<version>1.11.116</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-sns</artifactId>
<version>1.11.116</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-ecr</artifactId>
<version>1.11.116</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-ssm</artifactId>
<version>1.11.116</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>1.9.5</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7185a680f0bdc4feef3ab7fd3b262f37
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
98410c7840838a988b8de2eab62641c904631a07
12 changes: 12 additions & 0 deletions repo/com/salmon/aws/gradle-aws-plugin/maven-metadata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<groupId>com.salmon.aws</groupId>
<artifactId>gradle-aws-plugin</artifactId>
<versioning>
<release>0.35-24-g8b020d9-SNAPSHOT+dirty</release>
<versions>
<version>0.35-24-g8b020d9-SNAPSHOT+dirty</version>
</versions>
<lastUpdated>20170724060213</lastUpdated>
</versioning>
</metadata>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
c67c933cac7a2ee0006e7a7e697850c4
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
623c5d84733012197799314c25aa7b5daef1a655
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
/*
* Copyright 2015-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package jp.classmethod.aws.gradle.lambda;

import java.io.IOException;

import lombok.Getter;
import lombok.Setter;

import org.gradle.api.GradleException;
import org.gradle.api.internal.ConventionTask;
import org.gradle.api.tasks.TaskAction;

import com.amazonaws.services.lambda.AWSLambda;
import com.amazonaws.services.lambda.model.CreateAliasRequest;
import com.amazonaws.services.lambda.model.CreateAliasResult;

public class AWSLambdaCreateAliasTask extends ConventionTask {

@Getter
@Setter
private String functionName;

@Getter
@Setter
private String functionVersion;

@Getter
@Setter
private String aliasDescription;

@Getter
@Setter
private String aliasName;

@Getter
private CreateAliasResult createAliasResult;


public AWSLambdaCreateAliasTask() {
setDescription("Create Lambda Alias.");
setGroup("AWS");
}

@TaskAction
public void createAlias() throws IOException {
// to enable conventionMappings feature
String aliasName = getAliasName();
String functionName = getAliasName();
String functionVersion = getAliasName();

if (aliasName == null) {
throw new GradleException("aliasName is required");
}

if (functionName == null) {
throw new GradleException("functionName is required");
}

if (functionVersion == null) {
throw new GradleException("functionVersion is required");
}

AWSLambdaPluginExtension ext = getProject().getExtensions().getByType(AWSLambdaPluginExtension.class);
AWSLambda lambda = ext.getClient();

CreateAliasRequest request = new CreateAliasRequest()
.withName(getAliasName())
.withDescription(getAliasDescription())
.withFunctionName(getFunctionName())
.withFunctionVersion(getFunctionVersion());
createAliasResult = lambda.createAlias(request);
getLogger().info("Create Lambda alias requested: {}", createAliasResult.getAliasArn());
}
}
Loading

0 comments on commit 95c9213

Please sign in to comment.