From ca8bce51056390ad374fcdd7902d6704988c3fbd Mon Sep 17 00:00:00 2001 From: Eka-Toisutta Date: Tue, 22 Nov 2016 17:25:37 +0800 Subject: [PATCH 01/34] Modify readme --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2ea2724..99c95dd 100644 --- a/README.md +++ b/README.md @@ -1 +1,2 @@ -# sample-html \ No newline at end of file +# sample-html +# this is readme \ No newline at end of file From 1997583658173c1ae8e59f58453f23f64eb999aa Mon Sep 17 00:00:00 2001 From: amelia Date: Tue, 22 Nov 2016 17:28:49 +0800 Subject: [PATCH 02/34] edit readme --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2ea2724..969dfb1 100644 --- a/README.md +++ b/README.md @@ -1 +1,2 @@ -# sample-html \ No newline at end of file +# sample-html +dasfdasf \ No newline at end of file From 934617f5f402fb9e12d600ed8b4eea8541e67bc6 Mon Sep 17 00:00:00 2001 From: erwinhasanuddin Date: Tue, 22 Nov 2016 16:32:13 +0700 Subject: [PATCH 03/34] updated the readme --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2ea2724..9359835 100644 --- a/README.md +++ b/README.md @@ -1 +1,2 @@ -# sample-html \ No newline at end of file +# sample-html +edited by erwin_h From f405a1425c90918e6acc1b3d961d46f45f337c43 Mon Sep 17 00:00:00 2001 From: Elfira Date: Tue, 22 Nov 2016 16:33:11 +0700 Subject: [PATCH 04/34] update README --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2ea2724..d3c9b4e 100644 --- a/README.md +++ b/README.md @@ -1 +1,3 @@ -# sample-html \ No newline at end of file +# sample-html + +# changes by EY \ No newline at end of file From f33b8f8086354eb194d2cdbd6699a97588ee4fdb Mon Sep 17 00:00:00 2001 From: Eka-Toisutta Date: Tue, 22 Nov 2016 17:33:31 +0800 Subject: [PATCH 05/34] Update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 99c95dd..79ee8d7 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ # sample-html -# this is readme \ No newline at end of file +# this is readme \ No newline at end of file From 3ed2bdffc21f4e9b373826c430e4d2c6d458618a Mon Sep 17 00:00:00 2001 From: Erwin Hasanuddin Date: Tue, 22 Nov 2016 17:18:11 +0700 Subject: [PATCH 06/34] test yg ke dua kalinya --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 9359835..39d0cb7 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # sample-html edited by erwin_h +edit lagi ah \ No newline at end of file From ff6088377301d3ee6767ddd0035ddd79718dabc9 Mon Sep 17 00:00:00 2001 From: Ken Kustian Date: Wed, 7 Dec 2016 13:53:31 +0700 Subject: [PATCH 07/34] add sonar host properties --- sonar-project.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/sonar-project.properties b/sonar-project.properties index 778a5a6..bc33c05 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -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 From 850b3a169fe2f859a701da79eb29e4e421cc8bb6 Mon Sep 17 00:00:00 2001 From: rfajarachmad Date: Wed, 1 Feb 2017 17:05:09 +0700 Subject: [PATCH 08/34] Add deployment script --- deployment-script/appspec.yml | 10 ++++++++++ deployment-script/start_service | 1 + 2 files changed, 11 insertions(+) create mode 100644 deployment-script/appspec.yml create mode 100644 deployment-script/start_service diff --git a/deployment-script/appspec.yml b/deployment-script/appspec.yml new file mode 100644 index 0000000..bcb1918 --- /dev/null +++ b/deployment-script/appspec.yml @@ -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 diff --git a/deployment-script/start_service b/deployment-script/start_service new file mode 100644 index 0000000..8860925 --- /dev/null +++ b/deployment-script/start_service @@ -0,0 +1 @@ +/opt/bitnami/ctlscript.sh restart apache From 3af9e4355a92574ecf965b1e757c7bdde95da63a Mon Sep 17 00:00:00 2001 From: rfajarachmad Date: Wed, 1 Feb 2017 17:35:24 +0700 Subject: [PATCH 09/34] no message --- Jenkinsfile.groovy | 48 +++++++++++++++++++ LICENSE => app/LICENSE | 0 README.md => app/README.md | 0 {css => app/css}/main.css | 0 index.html => app/index.html | 0 {js => app/js}/main.js | 0 .../sonar-project.properties | 0 deployment-script/appspec.yml => appspec.yml | 0 .../start_service => start_service | 0 9 files changed, 48 insertions(+) create mode 100644 Jenkinsfile.groovy rename LICENSE => app/LICENSE (100%) rename README.md => app/README.md (100%) rename {css => app/css}/main.css (100%) rename index.html => app/index.html (100%) rename {js => app/js}/main.js (100%) rename sonar-project.properties => app/sonar-project.properties (100%) rename deployment-script/appspec.yml => appspec.yml (100%) rename deployment-script/start_service => start_service (100%) diff --git a/Jenkinsfile.groovy b/Jenkinsfile.groovy new file mode 100644 index 0000000..fafbd52 --- /dev/null +++ b/Jenkinsfile.groovy @@ -0,0 +1,48 @@ +//Codedeploy Config +import static java.util.UUID.randomUUID + + +node { + env.AWS_DEFAULT_REGION = 'ap-southeast-1' + + String stackName = 'cdc-fajar' + + deleteDir() + stage('Checkout') { + checkout scm + } + + + stage("Sonar Analyze") { + + } + //deploy + stage('Deploy') { + withCredentials([[$class : 'UsernamePasswordMultiBinding', + credentialsId : 'CdcAWS', + usernameVariable: 'AWS_ACCESS_KEY_ID', + passwordVariable: 'AWS_SECRET_ACCESS_KEY']]) { + + //ZIP + sh("zip ") + + //generate random string + String applicationId = randomUUID() + + //Upload + sh("aws s3 cp app.zip s3://deployment-cdc/${applicationId}.zip") + + //Create Deployment + sh("deploy create-deployment --application-name CDC-deploy --deployment-group-name ${stackName} --s3-location bucket=deployment-cdc,bundleType=zip,key=${applicationId}.zip > .deployment_id") + String deploymentId = getDeploymentId('.deployment_id') + + //Wait until success + sh("aws deploy wait deployment-successful --deployment-id ${deploymentId}") + } + } +} + +def getDeploymentId(fileName) { + def matcher = readFile(fileName) =~ 'deploymentId\":\\s\"(.*)\"' + matcher ? matcher[0][1] : null +} \ No newline at end of file diff --git a/LICENSE b/app/LICENSE similarity index 100% rename from LICENSE rename to app/LICENSE diff --git a/README.md b/app/README.md similarity index 100% rename from README.md rename to app/README.md diff --git a/css/main.css b/app/css/main.css similarity index 100% rename from css/main.css rename to app/css/main.css diff --git a/index.html b/app/index.html similarity index 100% rename from index.html rename to app/index.html diff --git a/js/main.js b/app/js/main.js similarity index 100% rename from js/main.js rename to app/js/main.js diff --git a/sonar-project.properties b/app/sonar-project.properties similarity index 100% rename from sonar-project.properties rename to app/sonar-project.properties diff --git a/deployment-script/appspec.yml b/appspec.yml similarity index 100% rename from deployment-script/appspec.yml rename to appspec.yml diff --git a/deployment-script/start_service b/start_service similarity index 100% rename from deployment-script/start_service rename to start_service From d849730ac0b3338aa16aa9719b92f4a5d97dd492 Mon Sep 17 00:00:00 2001 From: rfajarachmad Date: Wed, 1 Feb 2017 17:38:58 +0700 Subject: [PATCH 10/34] no message --- Jenkinsfile.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile.groovy b/Jenkinsfile.groovy index fafbd52..d5f111a 100644 --- a/Jenkinsfile.groovy +++ b/Jenkinsfile.groovy @@ -24,7 +24,7 @@ node { passwordVariable: 'AWS_SECRET_ACCESS_KEY']]) { //ZIP - sh("zip ") + sh("zip -r ${applicationId}.zip .") //generate random string String applicationId = randomUUID() From b3918d9d0c83427e6de7b7bc0536d50e63715001 Mon Sep 17 00:00:00 2001 From: rfajarachmad Date: Wed, 1 Feb 2017 17:40:00 +0700 Subject: [PATCH 11/34] no message --- Jenkinsfile.groovy | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile.groovy b/Jenkinsfile.groovy index d5f111a..44fee95 100644 --- a/Jenkinsfile.groovy +++ b/Jenkinsfile.groovy @@ -23,12 +23,11 @@ node { usernameVariable: 'AWS_ACCESS_KEY_ID', passwordVariable: 'AWS_SECRET_ACCESS_KEY']]) { + String applicationId = randomUUID() + //ZIP sh("zip -r ${applicationId}.zip .") - //generate random string - String applicationId = randomUUID() - //Upload sh("aws s3 cp app.zip s3://deployment-cdc/${applicationId}.zip") From 0f39096ad7632d6571862e7ebcbe94d7dc9aecb3 Mon Sep 17 00:00:00 2001 From: rfajarachmad Date: Wed, 1 Feb 2017 17:43:24 +0700 Subject: [PATCH 12/34] no message --- Jenkinsfile.groovy | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Jenkinsfile.groovy b/Jenkinsfile.groovy index 44fee95..be60fa5 100644 --- a/Jenkinsfile.groovy +++ b/Jenkinsfile.groovy @@ -29,19 +29,14 @@ node { sh("zip -r ${applicationId}.zip .") //Upload - sh("aws s3 cp app.zip s3://deployment-cdc/${applicationId}.zip") + sh("aws s3 cp ${applicationId}.zip s3://deployment-cdc/${applicationId}.zip") //Create Deployment - sh("deploy create-deployment --application-name CDC-deploy --deployment-group-name ${stackName} --s3-location bucket=deployment-cdc,bundleType=zip,key=${applicationId}.zip > .deployment_id") - String deploymentId = getDeploymentId('.deployment_id') + def result = sh(returnStdout:true, script: "deploy create-deployment --application-name CDC-deploy --deployment-group-name ${stackName} --s3-location bucket=deployment-cdc,bundleType=zip,key=${applicationId}.zip") + String deploymentId = result.matcher('deploymentId\":\\s\"(.*)\"') //Wait until success sh("aws deploy wait deployment-successful --deployment-id ${deploymentId}") } } } - -def getDeploymentId(fileName) { - def matcher = readFile(fileName) =~ 'deploymentId\":\\s\"(.*)\"' - matcher ? matcher[0][1] : null -} \ No newline at end of file From 89a1a2e6aaa87f56eebb45c35d966f34762085b4 Mon Sep 17 00:00:00 2001 From: rfajarachmad Date: Wed, 1 Feb 2017 17:44:29 +0700 Subject: [PATCH 13/34] no message --- Jenkinsfile.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile.groovy b/Jenkinsfile.groovy index be60fa5..061a349 100644 --- a/Jenkinsfile.groovy +++ b/Jenkinsfile.groovy @@ -32,7 +32,7 @@ node { sh("aws s3 cp ${applicationId}.zip s3://deployment-cdc/${applicationId}.zip") //Create Deployment - def result = sh(returnStdout:true, script: "deploy create-deployment --application-name CDC-deploy --deployment-group-name ${stackName} --s3-location bucket=deployment-cdc,bundleType=zip,key=${applicationId}.zip") + def result = sh(returnStdout:true, script: "aws deploy create-deployment --application-name CDC-deploy --deployment-group-name ${stackName} --s3-location bucket=deployment-cdc,bundleType=zip,key=${applicationId}.zip") String deploymentId = result.matcher('deploymentId\":\\s\"(.*)\"') //Wait until success From fbccbedba4ec9d773701b353d5007aa4ac8aba07 Mon Sep 17 00:00:00 2001 From: rfajarachmad Date: Wed, 1 Feb 2017 17:45:41 +0700 Subject: [PATCH 14/34] no message --- Jenkinsfile.groovy | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile.groovy b/Jenkinsfile.groovy index 061a349..e3d3497 100644 --- a/Jenkinsfile.groovy +++ b/Jenkinsfile.groovy @@ -33,10 +33,11 @@ node { //Create Deployment def result = sh(returnStdout:true, script: "aws deploy create-deployment --application-name CDC-deploy --deployment-group-name ${stackName} --s3-location bucket=deployment-cdc,bundleType=zip,key=${applicationId}.zip") - String deploymentId = result.matcher('deploymentId\":\\s\"(.*)\"') + echo result + //String deploymentId = result.matcher('deploymentId\":\\s\"(.*)\"') //Wait until success - sh("aws deploy wait deployment-successful --deployment-id ${deploymentId}") + //sh("aws deploy wait deployment-successful --deployment-id ${deploymentId}") } } } From d615d5b0f9459c047ddd9c08712277abd5d28d48 Mon Sep 17 00:00:00 2001 From: rfajarachmad Date: Wed, 1 Feb 2017 17:49:51 +0700 Subject: [PATCH 15/34] no message --- Jenkinsfile.groovy | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile.groovy b/Jenkinsfile.groovy index e3d3497..4289352 100644 --- a/Jenkinsfile.groovy +++ b/Jenkinsfile.groovy @@ -1,5 +1,6 @@ //Codedeploy Config import static java.util.UUID.randomUUID +import groovy.json.* node { @@ -33,11 +34,11 @@ node { //Create Deployment def result = sh(returnStdout:true, script: "aws deploy create-deployment --application-name CDC-deploy --deployment-group-name ${stackName} --s3-location bucket=deployment-cdc,bundleType=zip,key=${applicationId}.zip") - echo result - //String deploymentId = result.matcher('deploymentId\":\\s\"(.*)\"') + def json = new JsonSlurper().parseText(result) + String deploymentId = json.deploymentId //Wait until success - //sh("aws deploy wait deployment-successful --deployment-id ${deploymentId}") + sh("aws deploy wait deployment-successful --deployment-id ${deploymentId}") } } } From ea32f54e8ad2966b04855228a4b23aa09cce3c51 Mon Sep 17 00:00:00 2001 From: rfajarachmad Date: Wed, 1 Feb 2017 17:52:07 +0700 Subject: [PATCH 16/34] no message --- Jenkinsfile.groovy | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile.groovy b/Jenkinsfile.groovy index 4289352..839713c 100644 --- a/Jenkinsfile.groovy +++ b/Jenkinsfile.groovy @@ -1,6 +1,6 @@ //Codedeploy Config import static java.util.UUID.randomUUID -import groovy.json.* +import groovy.json.JsonSlurperClassic node { @@ -34,7 +34,7 @@ node { //Create Deployment def result = sh(returnStdout:true, script: "aws deploy create-deployment --application-name CDC-deploy --deployment-group-name ${stackName} --s3-location bucket=deployment-cdc,bundleType=zip,key=${applicationId}.zip") - def json = new JsonSlurper().parseText(result) + def json = parseJson(result) String deploymentId = json.deploymentId //Wait until success @@ -42,3 +42,7 @@ node { } } } + +def parseJson(String json) { + return new JsonSlurperClassic().parseText(json) +} From 98742a2dbe78889b4a5d85bf04b554a2c041ac29 Mon Sep 17 00:00:00 2001 From: rfajarachmad Date: Thu, 2 Feb 2017 14:27:21 +0700 Subject: [PATCH 17/34] no message --- Jenkinsfile.groovy | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile.groovy b/Jenkinsfile.groovy index 839713c..ae5085d 100644 --- a/Jenkinsfile.groovy +++ b/Jenkinsfile.groovy @@ -6,7 +6,7 @@ import groovy.json.JsonSlurperClassic node { env.AWS_DEFAULT_REGION = 'ap-southeast-1' - String stackName = 'cdc-fajar' + String trainerName = 'fajar' deleteDir() stage('Checkout') { @@ -24,16 +24,16 @@ node { usernameVariable: 'AWS_ACCESS_KEY_ID', passwordVariable: 'AWS_SECRET_ACCESS_KEY']]) { - String applicationId = randomUUID() + //ZIP - sh("zip -r ${applicationId}.zip .") + sh("zip -r ${env.JOB_NAME}.zip .") //Upload - sh("aws s3 cp ${applicationId}.zip s3://deployment-cdc/${applicationId}.zip") + sh("aws s3 cp ${applicationId}.zip s3://deployment-cdc/${env.JOB_NAME}.zip") //Create Deployment - def result = sh(returnStdout:true, script: "aws deploy create-deployment --application-name CDC-deploy --deployment-group-name ${stackName} --s3-location bucket=deployment-cdc,bundleType=zip,key=${applicationId}.zip") + def result = sh(returnStdout:true, script: "aws deploy create-deployment --application-name CDC-deploy --deployment-group-name ${trainerName} --s3-location bucket=deployment-cdc,bundleType=zip,key=${env.JOB_NAME}.zip") def json = parseJson(result) String deploymentId = json.deploymentId From 9fcd5f2a30a0d74260ba5b64ad7487fc24deda8b Mon Sep 17 00:00:00 2001 From: rfajarachmad Date: Thu, 2 Feb 2017 14:32:12 +0700 Subject: [PATCH 18/34] no message --- Jenkinsfile.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile.groovy b/Jenkinsfile.groovy index ae5085d..3a88f9f 100644 --- a/Jenkinsfile.groovy +++ b/Jenkinsfile.groovy @@ -30,7 +30,7 @@ node { sh("zip -r ${env.JOB_NAME}.zip .") //Upload - sh("aws s3 cp ${applicationId}.zip s3://deployment-cdc/${env.JOB_NAME}.zip") + sh("aws s3 cp ${env.JOB_NAME}.zip s3://deployment-cdc/${env.JOB_NAME}.zip") //Create Deployment def result = sh(returnStdout:true, script: "aws deploy create-deployment --application-name CDC-deploy --deployment-group-name ${trainerName} --s3-location bucket=deployment-cdc,bundleType=zip,key=${env.JOB_NAME}.zip") From dd6ec84164e7ee1d3c285ae001e7ed774adde682 Mon Sep 17 00:00:00 2001 From: rfajarachmad Date: Thu, 2 Feb 2017 14:35:06 +0700 Subject: [PATCH 19/34] no message --- Jenkinsfile.groovy | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile.groovy b/Jenkinsfile.groovy index 3a88f9f..aa7f600 100644 --- a/Jenkinsfile.groovy +++ b/Jenkinsfile.groovy @@ -15,7 +15,10 @@ node { stage("Sonar Analyze") { - + def scannerHome = tool 'default'; + withSonarQubeEnv('default') { + sh "${scannerHome}/bin/sonar-scanner -Dsonar.projectKey=sample-html -Dsonar.sources=app" + } } //deploy stage('Deploy') { From 9fb20550b0b7347091a4979dfaae0661af78dfdb Mon Sep 17 00:00:00 2001 From: rfajarachmad Date: Thu, 2 Feb 2017 14:39:21 +0700 Subject: [PATCH 20/34] no message --- Jenkinsfile.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile.groovy b/Jenkinsfile.groovy index aa7f600..c71f0ac 100644 --- a/Jenkinsfile.groovy +++ b/Jenkinsfile.groovy @@ -17,7 +17,7 @@ node { stage("Sonar Analyze") { def scannerHome = tool 'default'; withSonarQubeEnv('default') { - sh "${scannerHome}/bin/sonar-scanner -Dsonar.projectKey=sample-html -Dsonar.sources=app" + sh "${scannerHome}/bin/sonar-scanner -Dsonar.projectKey=${trainerName} -Dsonar.sources=app" } } //deploy From 619dbe347925481cfc1053eec6ece4b1356571ed Mon Sep 17 00:00:00 2001 From: rfajarachmad Date: Thu, 2 Feb 2017 14:42:13 +0700 Subject: [PATCH 21/34] no message --- Jenkinsfile.groovy | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile.groovy b/Jenkinsfile.groovy index c71f0ac..dfd25d6 100644 --- a/Jenkinsfile.groovy +++ b/Jenkinsfile.groovy @@ -1,5 +1,3 @@ -//Codedeploy Config -import static java.util.UUID.randomUUID import groovy.json.JsonSlurperClassic @@ -8,7 +6,9 @@ node { String trainerName = 'fajar' + //Cleanup workspace deleteDir() + stage('Checkout') { checkout scm } @@ -20,7 +20,8 @@ node { sh "${scannerHome}/bin/sonar-scanner -Dsonar.projectKey=${trainerName} -Dsonar.sources=app" } } - //deploy + + stage('Deploy') { withCredentials([[$class : 'UsernamePasswordMultiBinding', credentialsId : 'CdcAWS', @@ -29,10 +30,10 @@ node { - //ZIP + //Zip artifact sh("zip -r ${env.JOB_NAME}.zip .") - //Upload + //Upload artifact to S3 sh("aws s3 cp ${env.JOB_NAME}.zip s3://deployment-cdc/${env.JOB_NAME}.zip") //Create Deployment From e56d4b6b2bc88e566783c2939b0b4b75f0654021 Mon Sep 17 00:00:00 2001 From: rfajarachmad Date: Thu, 2 Feb 2017 16:47:53 +0700 Subject: [PATCH 22/34] no message --- appspec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appspec.yml b/appspec.yml index bcb1918..dd6e88b 100644 --- a/appspec.yml +++ b/appspec.yml @@ -2,7 +2,7 @@ version: 0.0 os: linux files: - source: /app - destination: /opt/bitnami/apache2/htdocs/app + destination: /opt/bitnami/apache2/htdocs/achmad hooks: ApplicationStart: - location: start_service From bb982db52b24a548445edefbe7d60a331c1db5ff Mon Sep 17 00:00:00 2001 From: rfajarachmad Date: Thu, 2 Feb 2017 16:52:10 +0700 Subject: [PATCH 23/34] no message --- appspec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appspec.yml b/appspec.yml index dd6e88b..4b79ff0 100644 --- a/appspec.yml +++ b/appspec.yml @@ -2,7 +2,7 @@ version: 0.0 os: linux files: - source: /app - destination: /opt/bitnami/apache2/htdocs/achmad + destination: /opt/bitnami/apache2/htdocs/ridwan hooks: ApplicationStart: - location: start_service From ee88203979c40c65202e86f14f134cd35b66dcad Mon Sep 17 00:00:00 2001 From: rfajarachmad Date: Thu, 2 Feb 2017 16:58:02 +0700 Subject: [PATCH 24/34] no message --- appspec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appspec.yml b/appspec.yml index 4b79ff0..2eca1c7 100644 --- a/appspec.yml +++ b/appspec.yml @@ -2,7 +2,7 @@ version: 0.0 os: linux files: - source: /app - destination: /opt/bitnami/apache2/htdocs/ridwan + destination: /opt/bitnami/apache2/htdocs/fajar hooks: ApplicationStart: - location: start_service From 2be3e6cd4257585b67288135cedd2d91314e10a9 Mon Sep 17 00:00:00 2001 From: rfajarachmad Date: Thu, 2 Feb 2017 17:15:53 +0700 Subject: [PATCH 25/34] no message --- Jenkinsfile.groovy | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile.groovy b/Jenkinsfile.groovy index dfd25d6..b6fe863 100644 --- a/Jenkinsfile.groovy +++ b/Jenkinsfile.groovy @@ -5,6 +5,7 @@ node { env.AWS_DEFAULT_REGION = 'ap-southeast-1' String trainerName = 'fajar' + String groupName = 'achmad' //Cleanup workspace deleteDir() @@ -17,7 +18,7 @@ node { stage("Sonar Analyze") { def scannerHome = tool 'default'; withSonarQubeEnv('default') { - sh "${scannerHome}/bin/sonar-scanner -Dsonar.projectKey=${trainerName} -Dsonar.sources=app" + sh "${scannerHome}/bin/sonar-scanner -Dsonar.projectKey=${groupName} -Dsonar.sources=app" } } @@ -31,13 +32,13 @@ node { //Zip artifact - sh("zip -r ${env.JOB_NAME}.zip .") + sh("zip -r ${groupName}.zip .") //Upload artifact to S3 - sh("aws s3 cp ${env.JOB_NAME}.zip s3://deployment-cdc/${env.JOB_NAME}.zip") + sh("aws s3 cp ${groupName}.zip s3://deployment-cdc/${groupName}.zip") //Create Deployment - def result = sh(returnStdout:true, script: "aws deploy create-deployment --application-name CDC-deploy --deployment-group-name ${trainerName} --s3-location bucket=deployment-cdc,bundleType=zip,key=${env.JOB_NAME}.zip") + def result = sh(returnStdout:true, script: "aws deploy create-deployment --application-name CDC-deploy --deployment-group-name ${groupName} --s3-location bucket=deployment-cdc,bundleType=zip,key=${groupName}.zip") def json = parseJson(result) String deploymentId = json.deploymentId From 9f78b8b6356ea30447a97723679280ca3f3e5443 Mon Sep 17 00:00:00 2001 From: rfajarachmad Date: Thu, 2 Feb 2017 17:18:10 +0700 Subject: [PATCH 26/34] no message --- appspec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appspec.yml b/appspec.yml index 2eca1c7..dd6e88b 100644 --- a/appspec.yml +++ b/appspec.yml @@ -2,7 +2,7 @@ version: 0.0 os: linux files: - source: /app - destination: /opt/bitnami/apache2/htdocs/fajar + destination: /opt/bitnami/apache2/htdocs/achmad hooks: ApplicationStart: - location: start_service From de935de2d0c2957b7eb5ec4eeb9d21f3953d66e4 Mon Sep 17 00:00:00 2001 From: Achmad Fajar Ridwan Date: Thu, 2 Feb 2017 22:42:08 +0700 Subject: [PATCH 27/34] Update Jenkinsfile.groovy --- Jenkinsfile.groovy | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile.groovy b/Jenkinsfile.groovy index b6fe863..2e7bee5 100644 --- a/Jenkinsfile.groovy +++ b/Jenkinsfile.groovy @@ -4,9 +4,10 @@ import groovy.json.JsonSlurperClassic node { env.AWS_DEFAULT_REGION = 'ap-southeast-1' - String trainerName = 'fajar' - String groupName = 'achmad' - + def applicationName = 'myapp' //change me + def deploymentGroupName = 'groupname' // change me + def s3BucketName = 'deployment-cdc' + //Cleanup workspace deleteDir() @@ -18,7 +19,7 @@ node { stage("Sonar Analyze") { def scannerHome = tool 'default'; withSonarQubeEnv('default') { - sh "${scannerHome}/bin/sonar-scanner -Dsonar.projectKey=${groupName} -Dsonar.sources=app" + sh "${scannerHome}/bin/sonar-scanner -Dsonar.projectKey=${deploymentGroupName} -Dsonar.sources=app" } } @@ -32,13 +33,14 @@ node { //Zip artifact - sh("zip -r ${groupName}.zip .") + def artifactName = "${applicationName}-${deploymentGroupName}" + sh("zip -r ${artifactName}.zip .") //Upload artifact to S3 - sh("aws s3 cp ${groupName}.zip s3://deployment-cdc/${groupName}.zip") + sh("aws s3 cp ${artifactName}.zip s3://${s3BucketName}/${artifactName}.zip") //Create Deployment - def result = sh(returnStdout:true, script: "aws deploy create-deployment --application-name CDC-deploy --deployment-group-name ${groupName} --s3-location bucket=deployment-cdc,bundleType=zip,key=${groupName}.zip") + 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 From 7663d7af7909b3d902749eb012b04895f01a3bbf Mon Sep 17 00:00:00 2001 From: Achmad Fajar Ridwan Date: Thu, 2 Feb 2017 22:43:30 +0700 Subject: [PATCH 28/34] Update appspec.yml --- appspec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appspec.yml b/appspec.yml index dd6e88b..ea28a31 100644 --- a/appspec.yml +++ b/appspec.yml @@ -2,7 +2,7 @@ version: 0.0 os: linux files: - source: /app - destination: /opt/bitnami/apache2/htdocs/achmad + destination: /opt/bitnami/apache2/htdocs/yourname hooks: ApplicationStart: - location: start_service From 02b56e241ba4db6c3373a1f9022f2e6e66588447 Mon Sep 17 00:00:00 2001 From: rfajarachmad Date: Fri, 3 Feb 2017 14:38:13 +0700 Subject: [PATCH 29/34] no message --- Jenkinsfile.groovy | 4 ++-- appspec.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile.groovy b/Jenkinsfile.groovy index 2e7bee5..bf6adfa 100644 --- a/Jenkinsfile.groovy +++ b/Jenkinsfile.groovy @@ -4,8 +4,8 @@ import groovy.json.JsonSlurperClassic node { env.AWS_DEFAULT_REGION = 'ap-southeast-1' - def applicationName = 'myapp' //change me - def deploymentGroupName = 'groupname' // change me + def applicationName = 'fajar-app' //change me + def deploymentGroupName = 'fajar-deployment-group' // change me def s3BucketName = 'deployment-cdc' //Cleanup workspace diff --git a/appspec.yml b/appspec.yml index ea28a31..2eca1c7 100644 --- a/appspec.yml +++ b/appspec.yml @@ -2,7 +2,7 @@ version: 0.0 os: linux files: - source: /app - destination: /opt/bitnami/apache2/htdocs/yourname + destination: /opt/bitnami/apache2/htdocs/fajar hooks: ApplicationStart: - location: start_service From 1b36fb8e0adee810d28af8631620d69fa6de240b Mon Sep 17 00:00:00 2001 From: rfajarachmad Date: Fri, 3 Feb 2017 15:51:47 +0700 Subject: [PATCH 30/34] no message --- appspec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appspec.yml b/appspec.yml index 2eca1c7..bcb1918 100644 --- a/appspec.yml +++ b/appspec.yml @@ -2,7 +2,7 @@ version: 0.0 os: linux files: - source: /app - destination: /opt/bitnami/apache2/htdocs/fajar + destination: /opt/bitnami/apache2/htdocs/app hooks: ApplicationStart: - location: start_service From 761a9ff891edc524be5f271961845fabdf5749ea Mon Sep 17 00:00:00 2001 From: rfajarachmad Date: Fri, 3 Feb 2017 15:52:26 +0700 Subject: [PATCH 31/34] no message --- Jenkinsfile.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile.groovy b/Jenkinsfile.groovy index bf6adfa..848283c 100644 --- a/Jenkinsfile.groovy +++ b/Jenkinsfile.groovy @@ -5,7 +5,7 @@ node { env.AWS_DEFAULT_REGION = 'ap-southeast-1' def applicationName = 'fajar-app' //change me - def deploymentGroupName = 'fajar-deployment-group' // change me + def deploymentGroupName = 'fajar-app' // change me def s3BucketName = 'deployment-cdc' //Cleanup workspace From 1abd529203734f9e6447f9d143cc4a593ee0dfbb Mon Sep 17 00:00:00 2001 From: Ken Kustian Date: Tue, 21 Feb 2017 16:37:59 +0700 Subject: [PATCH 32/34] change parameter name to trainer's name --- Jenkinsfile.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile.groovy b/Jenkinsfile.groovy index 848283c..c75d147 100644 --- a/Jenkinsfile.groovy +++ b/Jenkinsfile.groovy @@ -4,8 +4,8 @@ import groovy.json.JsonSlurperClassic node { env.AWS_DEFAULT_REGION = 'ap-southeast-1' - def applicationName = 'fajar-app' //change me - def deploymentGroupName = 'fajar-app' // change me + def applicationName = 'kustian' //change me + def deploymentGroupName = 'kustian' // change me def s3BucketName = 'deployment-cdc' //Cleanup workspace From 5d983461321d4393dd3361876b6f0127231d4cfb Mon Sep 17 00:00:00 2001 From: amelia Date: Tue, 22 Nov 2016 17:28:49 +0800 Subject: [PATCH 33/34] edit readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..969dfb1 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# sample-html +dasfdasf \ No newline at end of file From 3d227847d36fa90f4200641eacd9cd30143a79b8 Mon Sep 17 00:00:00 2001 From: Amelia Rahman Date: Thu, 23 Feb 2017 17:36:19 +0800 Subject: [PATCH 34/34] Update Jenkinsfile.groovy test --- Jenkinsfile.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile.groovy b/Jenkinsfile.groovy index c75d147..9d6f3bd 100644 --- a/Jenkinsfile.groovy +++ b/Jenkinsfile.groovy @@ -4,8 +4,8 @@ import groovy.json.JsonSlurperClassic node { env.AWS_DEFAULT_REGION = 'ap-southeast-1' - def applicationName = 'kustian' //change me - def deploymentGroupName = 'kustian' // change me + def applicationName = 'amelia-app' //change me + def deploymentGroupName = 'amelia-app-group' // change me def s3BucketName = 'deployment-cdc' //Cleanup workspace