Last active
April 18, 2018 12:05
-
-
Save rasheedamir/7e7e3ed098e5b48552b93c4a8fc43edb to your computer and use it in GitHub Desktop.
Jenkinsfile-upload-to-s3
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
#!/usr/bin/groovy | |
@Library('github.com/fabric8io/fabric8-pipeline-library@cf54366') _ | |
def kubeConfig = params.KUBE_CONFIG | |
podTemplate() { | |
mavenNode(dockerImage: 'docker:1.11.2') { | |
container(name: 'maven') { | |
stage("checkout") { | |
sh "echo version := 1.0.${env.BUILD_ID} >> build.txt" | |
sh "ls -l" | |
withAWS(role:'nodes.tools178.yard.com') { | |
echo 'Hello World' | |
s3Upload(file:'build.txt', bucket:'847616476486-microfrontends2', path:'file.txt') | |
} | |
} | |
} | |
} | |
} |
this is the policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"s3:*",
"route53:*"
],
"Resource": "*"
},
{
"Sid": "VisualEditor1",
"Effect": "Deny",
"Action": "*",
"Resource": "*"
}
]
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Exception we are getting: