Created
May 25, 2015 10:25
-
-
Save adrianbk/c4982e5ebacc6b6ed902 to your computer and use it in GitHub Desktop.
gradle-s3-publish
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
apply plugin: 'java' | |
apply plugin: 'maven-publish' | |
repositories { jcenter() } | |
dependencies { compile 'org.slf4j:slf4j-api:1.7.12' } | |
publishing { | |
repositories { | |
maven { | |
url "http://127.0.0.1:8081/artifactory/libs-release-local/" | |
credentials { | |
username "admin" | |
password "password" | |
} | |
} | |
maven { | |
url "s3://gradle-maven-repo/libs-release-local" | |
credentials(AwsCredentials) { | |
accessKey "${System.getenv('AWS_KEY')}" | |
secretKey "${System.getenv('AWS_SECRET')}" | |
} | |
} | |
} | |
publications { | |
mavenJava(MavenPublication) { | |
groupId 'com.me' | |
artifactId 'sample-project' | |
version '1.1' | |
from components.java | |
} | |
} | |
} |
Any idea on how to set the acl for the published files ?
is there a way to pass on aws_session_token
along with accessKey
secretKey
?
Adrian is there a way to get the access and secret keys from the Maven settings.xml file instead?
per @benjosantony
Any idea on how to set the acl for the published files ?
You need to add following bucket policy
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadForGetBucketObjects",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::NAME_OF_YOUR_BUCKET/*"
}
]
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
gradle publish
This is the command to publish to s3. You can find all tasks bygradle tasks