Code Monkey home page Code Monkey logo

gradle-aws-s3-sync's Introduction

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

gradle-aws-s3-sync's People

Contributors

fs111 avatar jdbernard avatar msgilligan avatar rhopman avatar shaulzorea avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.