Gradle Amazon S3 Sync Plugin

The gradle task for synchronizing a local directory with a AWS S3 bucket.

License

License

Categories

Categories

AWS Container PaaS Providers Gradle Build Tools
GroupId

GroupId

com.monochromeroad.gradle-plugins
ArtifactId

ArtifactId

gradle-aws-s3-sync
Last Version

Last Version

0.10
Release Date

Release Date

Type

Type

jar
Description

Description

Gradle Amazon S3 Sync Plugin
The gradle task for synchronizing a local directory with a AWS S3 bucket.
Project URL

Project URL

https://github.com/literalice/gradle-aws-s3-sync
Source Code Management

Source Code Management

https://github.com/literalice/gradle-aws-s3-sync

Download gradle-aws-s3-sync

How to add to project

<!-- https://jarcasting.com/artifacts/com.monochromeroad.gradle-plugins/gradle-aws-s3-sync/ -->
<dependency>
    <groupId>com.monochromeroad.gradle-plugins</groupId>
    <artifactId>gradle-aws-s3-sync</artifactId>
    <version>0.10</version>
</dependency>
// https://jarcasting.com/artifacts/com.monochromeroad.gradle-plugins/gradle-aws-s3-sync/
implementation 'com.monochromeroad.gradle-plugins:gradle-aws-s3-sync:0.10'
// https://jarcasting.com/artifacts/com.monochromeroad.gradle-plugins/gradle-aws-s3-sync/
implementation ("com.monochromeroad.gradle-plugins:gradle-aws-s3-sync:0.10")
'com.monochromeroad.gradle-plugins:gradle-aws-s3-sync:jar:0.10'
<dependency org="com.monochromeroad.gradle-plugins" name="gradle-aws-s3-sync" rev="0.10">
  <artifact name="gradle-aws-s3-sync" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.monochromeroad.gradle-plugins', module='gradle-aws-s3-sync', version='0.10')
)
libraryDependencies += "com.monochromeroad.gradle-plugins" % "gradle-aws-s3-sync" % "0.10"
[com.monochromeroad.gradle-plugins/gradle-aws-s3-sync "0.10"]

Dependencies

runtime (1)

Group / Artifact Type Version
net.java.dev.jets3t : jets3t jar 0.9.3

Project Modules

There are no modules declared in this project.

Build Status

This is the gradle task for synchronizing a local directory with a AWS S3 bucket and vice-versa.

This task depends on JetS3t, a open-source Java toolkit for AWS.

Situation - upload

This task assumes the case, for example, a web site would be published in a AWS S3 bucket.

Usage - upload

// Gradle Script
buildscript {
    repositories {
        jcenter()
    }

    dependencies {
        classpath "com.monochromeroad.gradle-plugins:gradle-aws-s3-sync:0.10"
    }
}

import com.monochromeroad.gradle.plugin.aws.s3.S3Sync

task deploy(type: S3Sync){
    description = "Deploys my site on a s3 bucket."

    accessKey awsAccessKey
    secretKey awsSecretKey

    configFile "jets3t.properties"
    mimeTypesFile "my-mime.types"

    from "local-site"
    into "my.bucket.name/subdirectory-optional"
}

Situation - download

This task assumes the case, for example, a set of files has to be fetched from an S3 bucket to a local directory.

Usage - download

// Gradle Script
buildscript {
    repositories {
        jcenter()
    }

    dependencies {
        classpath "com.monochromeroad.gradle-plugins:gradle-aws-s3-sync:0.10"
    }
}

import com.monochromeroad.gradle.plugin.aws.s3.S3Sync

task deploy(type: S3Sync){
    description = "Downloads files from s3 bucket to a local directory"

    accessKey awsAccessKey
    secretKey awsSecretKey

    configFile "jets3t.properties"

    // follows the jets3t conventions for action names
    action = 'DOWN'

    from "my.bucket.name/subdirectory-optional"
    from "local-site"
}

Options

Name * required Description Default Value
* accessKey() AWS Access Key -
* secretKey() AWS Secret Key -
* from() The local directory which would be synchronized with the S3 bucket -
* into() The S3 bucket name which would be synchronized with the local directory. If needed, some sub directory could be added. (e.g. buc.ket/sub.d) -
configFile() JetS3t properties file path. Interpreted relative to the project directory, as for project.file() method. -
See also: JetS3t's Default
mimeTypesFile() Mime types file path for determing Mime type on deploying to S3. Interpreted relative to the project directory, as for project.file() method. -
See also: Default
quiet() JetS3t option -q false
noProgress() JetS3t option -n false
force() JetS3t option -f false
keepFiles() JetS3t option -k false
noDelete() JetS3t option -d false
moveEnabled() JetS3t option -m false
batchMode() JetS3t option -b false
gzipEnabled() JetS3t option -g false
encryptionEnabled() JetS3t option -c false
acl() JetS3t option --acl, from enum "ACL" com.monochromeroad.gradle.plugin.aws.s3.ACL.Private
reportLevel(ReportLevel) JetS3t option --reportlevel, from enum "ReportLevel" com.monochromeroad.gradle.plugin.aws.s3.ReportLevel.All
action() Either 'UP' for uploading into S3 or 'DOWN' for downloading from S3. UP

Versions

Version
0.10
0.7