Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
ca8bce5
Modify readme
Eka-Toisutta Nov 22, 2016
1997583
edit readme
ameliamitrais Nov 22, 2016
934617f
updated the readme
erwinhasanuddin Nov 22, 2016
f405a14
update README
elfiray-mts Nov 22, 2016
f33b8f8
Update readme
Eka-Toisutta Nov 22, 2016
ca5c14e
Merge pull request #8 from Eka-Toisutta/develop
koosty Nov 22, 2016
1852304
solve conflict
koosty Nov 22, 2016
3ed2bdf
test yg ke dua kalinya
erwinhasanuddin Nov 22, 2016
a79d7cf
merge the conflict
erwinhasanuddin Nov 22, 2016
a8e7dce
Merge pull request #11 from erwinhasanuddin/master
koosty Nov 22, 2016
ff60883
add sonar host properties
koosty Dec 7, 2016
850b3a1
Add deployment script
Feb 1, 2017
3af9e43
no message
Feb 1, 2017
d849730
no message
Feb 1, 2017
b3918d9
no message
Feb 1, 2017
0f39096
no message
Feb 1, 2017
89a1a2e
no message
Feb 1, 2017
fbccbed
no message
Feb 1, 2017
d615d5b
no message
Feb 1, 2017
ea32f54
no message
Feb 1, 2017
98742a2
no message
Feb 2, 2017
9fcd5f2
no message
Feb 2, 2017
dd6ec84
no message
Feb 2, 2017
9fb2055
no message
Feb 2, 2017
619dbe3
no message
Feb 2, 2017
e56d4b6
no message
Feb 2, 2017
bb982db
no message
Feb 2, 2017
ee88203
no message
Feb 2, 2017
2be3e6c
no message
Feb 2, 2017
9f78b8b
no message
Feb 2, 2017
de935de
Update Jenkinsfile.groovy
Feb 2, 2017
7663d7a
Update appspec.yml
Feb 2, 2017
02b56e2
no message
Feb 3, 2017
1b36fb8
no message
Feb 3, 2017
761a9ff
no message
Feb 3, 2017
1abd529
change parameter name to trainer's name
koosty Feb 21, 2017
5d98346
edit readme
ameliamitrais Nov 22, 2016
fe2b896
Merge branch 'amul' of https://github.com/ameliamitrais/sample-html i…
ameliamitrais Feb 23, 2017
3d22784
Update Jenkinsfile.groovy
ameliamitrais Feb 23, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions Jenkinsfile.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import groovy.json.JsonSlurperClassic


node {
env.AWS_DEFAULT_REGION = 'ap-southeast-1'

def applicationName = 'amelia-app' //change me
def deploymentGroupName = 'amelia-app-group' // change me
def s3BucketName = 'deployment-cdc'

//Cleanup workspace
deleteDir()

stage('Checkout') {
checkout scm
}


stage("Sonar Analyze") {
def scannerHome = tool 'default';
withSonarQubeEnv('default') {
sh "${scannerHome}/bin/sonar-scanner -Dsonar.projectKey=${deploymentGroupName} -Dsonar.sources=app"
}
}


stage('Deploy') {
withCredentials([[$class : 'UsernamePasswordMultiBinding',
credentialsId : 'CdcAWS',
usernameVariable: 'AWS_ACCESS_KEY_ID',
passwordVariable: 'AWS_SECRET_ACCESS_KEY']]) {



//Zip artifact
def artifactName = "${applicationName}-${deploymentGroupName}"
sh("zip -r ${artifactName}.zip .")

//Upload artifact to S3
sh("aws s3 cp ${artifactName}.zip s3://${s3BucketName}/${artifactName}.zip")

//Create Deployment
def result = sh(returnStdout:true, script: "aws deploy create-deployment --application-name ${applicationName} --deployment-group-name ${deploymentGroupName} --s3-location bucket=${s3BucketName},bundleType=zip,key=${artifactName}.zip")
def json = parseJson(result)
String deploymentId = json.deploymentId

//Wait until success
sh("aws deploy wait deployment-successful --deployment-id ${deploymentId}")
}
}
}

def parseJson(String json) {
return new JsonSlurperClassic().parseText(json)
}
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# sample-html
# sample-html
dasfdasf
File renamed without changes.
3 changes: 3 additions & 0 deletions app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# sample-html
edited by erwin_h
edit lagi ah
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions sonar-project.properties → app/sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ sonar.projectKey=sample-html
sonar.projectName=Sample HTML
sonar.sources=.
sonar.sourceEncoding=UTF-8
sonar.host.url=http://127.0.0.1:8081
10 changes: 10 additions & 0 deletions appspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 0.0
os: linux
files:
- source: /app
destination: /opt/bitnami/apache2/htdocs/app
hooks:
ApplicationStart:
- location: start_service
timeout: 300
runas: root
1 change: 1 addition & 0 deletions start_service
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/opt/bitnami/ctlscript.sh restart apache