From 37d21dd1d47a577133f21bd28d0979469a7523b3 Mon Sep 17 00:00:00 2001 From: Octavian Ciubotaru Date: Fri, 9 Dec 2022 16:08:27 +0200 Subject: [PATCH 1/6] AMP-30342: Switched to AWS ECR --- Jenkinsfile | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 93ee425ed91..ecb50716645 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -25,7 +25,7 @@ def dbVersion def pgVersion = 14 def country def ampUrl -def dockerRepo = "registry.developmentgateway.org/" +def dockerRepo = "798366298150.dkr.ecr.us-east-1.amazonaws.com/" def updateGitHubCommitStatus(context, message, state) { repoUrl = sh(returnStdout: true, script: "git config --get remote.origin.url").trim() @@ -82,13 +82,9 @@ stage('Build') { checkout scm def image = "${dockerRepo}amp-webapp:${tag}" - def format = branch != null ? "%H" : "%P" - def hash = sh(returnStdout: true, script: "git log --pretty=${format} -n 1").trim() - sh(returnStatus: true, script: "docker pull ${image} > /dev/null") - def imageIds = sh(returnStdout: true, script: "docker images -q -f \"label=git-hash=${hash}\"").trim() - sh(returnStatus: true, script: "docker rmi ${image} > /dev/null") + def hash = sh(returnStdout: true, script: "git log --pretty=%H -n 1").trim() - if (imageIds.equals("")) { + docker.withRegistry("https://798366298150.dkr.ecr.us-east-1.amazonaws.com", "ecr:us-east-1:aws-ecr-credentials-id") { try { updateGitHubCommitStatus('jenkins/build', 'Build in progress', 'PENDING') @@ -130,7 +126,7 @@ stage('Deploy') { dbVersion = sh(returnStdout: true, script: "ssh boad.aws.devgateway.org 'cd /opt/amp_dbs && amp-db find ${codeVersion} ${country}'").trim() // Deploy AMP - sh "ssh boad.aws.devgateway.org 'amp-up ${tag} ${country} ${dbVersion} ${pgVersion}'" + sh "ssh boad.aws.devgateway.org 'amp-up2 ${tag} ${country} ${dbVersion} ${pgVersion}'" slackSend(channel: 'amp-ci', color: 'good', message: "Deploy AMP - Success\nDeployed ${changePretty} will be ready for testing at ${ampUrl} in about 3 minutes") @@ -155,7 +151,7 @@ stage('Deploy again') { } node { try { - sh "ssh boad.aws.devgateway.org 'amp-up ${tag} ${country} ${dbVersion} ${pgVersion}'" + sh "ssh boad.aws.devgateway.org 'amp-up2 ${tag} ${country} ${dbVersion} ${pgVersion}'" slackSend(channel: 'amp-ci', color: 'good', message: "Deploy AMP - Success\nDeployed ${changePretty} will be ready for testing at ${ampUrl} in about 3 minutes") From 1ccf2f58dc355a56f34f8e1e6605c5fba01650f4 Mon Sep 17 00:00:00 2001 From: Octavian Ciubotaru Date: Thu, 15 Dec 2022 15:23:39 +0200 Subject: [PATCH 2/6] BOAD-7: Parameterized the staging server hostname --- Jenkinsfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ecb50716645..c1162c6756d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -60,7 +60,7 @@ stage('Build') { println "AMP Version: ${codeVersion}" countries = sh(returnStdout: true, - script: "ssh boad.aws.devgateway.org 'cd /opt/amp_dbs && amp-db ls ${codeVersion} | sort'") + script: "ssh ${env.AMP_STAGING_HOSTNAME} 'cd /opt/amp_dbs && amp-db ls ${codeVersion} | sort'") .trim() if (countries == "") { println "There are no database backups compatible with ${codeVersion}" @@ -123,10 +123,10 @@ stage('Deploy') { node { try { // Find latest database version compatible with ${codeVersion} - dbVersion = sh(returnStdout: true, script: "ssh boad.aws.devgateway.org 'cd /opt/amp_dbs && amp-db find ${codeVersion} ${country}'").trim() + dbVersion = sh(returnStdout: true, script: "ssh ${env.AMP_STAGING_HOSTNAME} 'cd /opt/amp_dbs && amp-db find ${codeVersion} ${country}'").trim() // Deploy AMP - sh "ssh boad.aws.devgateway.org 'amp-up2 ${tag} ${country} ${dbVersion} ${pgVersion}'" + sh "ssh ${env.AMP_STAGING_HOSTNAME} 'amp-up2 ${tag} ${country} ${dbVersion} ${pgVersion}'" slackSend(channel: 'amp-ci', color: 'good', message: "Deploy AMP - Success\nDeployed ${changePretty} will be ready for testing at ${ampUrl} in about 3 minutes") @@ -151,7 +151,7 @@ stage('Deploy again') { } node { try { - sh "ssh boad.aws.devgateway.org 'amp-up2 ${tag} ${country} ${dbVersion} ${pgVersion}'" + sh "ssh ${env.AMP_STAGING_HOSTNAME} 'amp-up2 ${tag} ${country} ${dbVersion} ${pgVersion}'" slackSend(channel: 'amp-ci', color: 'good', message: "Deploy AMP - Success\nDeployed ${changePretty} will be ready for testing at ${ampUrl} in about 3 minutes") From 076064bb6595c3d6fc6637bcb60687ec2419ba4f Mon Sep 17 00:00:00 2001 From: Octavian Ciubotaru Date: Thu, 22 Dec 2022 11:38:27 +0200 Subject: [PATCH 3/6] AMP-30342: Renamed the image name to use the forward slash --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index c1162c6756d..a6ea507ffe2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -81,7 +81,7 @@ stage('Build') { node { checkout scm - def image = "${dockerRepo}amp-webapp:${tag}" + def image = "${dockerRepo}amp/webapp:${tag}" def hash = sh(returnStdout: true, script: "git log --pretty=%H -n 1").trim() docker.withRegistry("https://798366298150.dkr.ecr.us-east-1.amazonaws.com", "ecr:us-east-1:aws-ecr-credentials-id") { From 07e6663a3dd0ca03915591ad3fac2257725e03fa Mon Sep 17 00:00:00 2001 From: Damian Rychter Date: Thu, 6 Apr 2023 16:16:11 -0300 Subject: [PATCH 4/6] AMP-30533 Create a new instance to deploy AMP servers --- Jenkinsfile | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index a6ea507ffe2..f36a86b93d9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -49,9 +49,20 @@ def updateGitHubCommitStatus(context, message, state) { def codeVersion def countries +def environment stage('Build') { + timeout(15) { + milestone() + environment = input( + message: "Server to deploy", + parameters: [choice(choices: ["${env.AMP_STAGING_HOSTNAME}", "${env.AMP_DE_HOSTNAME}"], name: 'environment')]) + milestone() + } + + println "Using environment: ${environment}" + node { checkout scm @@ -60,7 +71,7 @@ stage('Build') { println "AMP Version: ${codeVersion}" countries = sh(returnStdout: true, - script: "ssh ${env.AMP_STAGING_HOSTNAME} 'cd /opt/amp_dbs && amp-db ls ${codeVersion} | sort'") + script: "ssh ${environment} 'cd /opt/amp_dbs && amp-db ls ${codeVersion} | sort'") .trim() if (countries == "") { println "There are no database backups compatible with ${codeVersion}" @@ -76,7 +87,15 @@ stage('Build') { milestone() } - ampUrl = "http://amp-${country}-${tag}.stg.ampsite.net/" + println "Let set amp url based on ${environment}" + + if ("${environment}".toLowerCase().contains("ampdevde")) { + ampUrl = "http://amp-${country}-${tag}.de.ampsite.net/" + } else { + ampUrl = "http://amp-${country}-${tag}.stg.ampsite.net/" + } + + println "amp url is ${ampUrl}" node { checkout scm @@ -123,10 +142,10 @@ stage('Deploy') { node { try { // Find latest database version compatible with ${codeVersion} - dbVersion = sh(returnStdout: true, script: "ssh ${env.AMP_STAGING_HOSTNAME} 'cd /opt/amp_dbs && amp-db find ${codeVersion} ${country}'").trim() + dbVersion = sh(returnStdout: true, script: "ssh ${environment} 'cd /opt/amp_dbs && amp-db find ${codeVersion} ${country}'").trim() // Deploy AMP - sh "ssh ${env.AMP_STAGING_HOSTNAME} 'amp-up2 ${tag} ${country} ${dbVersion} ${pgVersion}'" + sh "ssh ${environment} 'amp-up2 ${tag} ${country} ${dbVersion} ${pgVersion}'" slackSend(channel: 'amp-ci', color: 'good', message: "Deploy AMP - Success\nDeployed ${changePretty} will be ready for testing at ${ampUrl} in about 3 minutes") @@ -151,7 +170,7 @@ stage('Deploy again') { } node { try { - sh "ssh ${env.AMP_STAGING_HOSTNAME} 'amp-up2 ${tag} ${country} ${dbVersion} ${pgVersion}'" + sh "ssh ${environment} 'amp-up2 ${tag} ${country} ${dbVersion} ${pgVersion}'" slackSend(channel: 'amp-ci', color: 'good', message: "Deploy AMP - Success\nDeployed ${changePretty} will be ready for testing at ${ampUrl} in about 3 minutes") From a9ecd54238ead27e1e02a847e125f915c9a56add Mon Sep 17 00:00:00 2001 From: Julian de Anquin Date: Mon, 26 Jun 2023 10:18:39 -0300 Subject: [PATCH 5/6] AMP-30610 fix zero funding --- .../reamp/modules/activity/preview/actions/ActivityActions.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/amp/TEMPLATE/reamp/modules/activity/preview/actions/ActivityActions.jsx b/amp/TEMPLATE/reamp/modules/activity/preview/actions/ActivityActions.jsx index 8066c3be13c..e44289e3474 100644 --- a/amp/TEMPLATE/reamp/modules/activity/preview/actions/ActivityActions.jsx +++ b/amp/TEMPLATE/reamp/modules/activity/preview/actions/ActivityActions.jsx @@ -166,7 +166,7 @@ export function loadActivityForActivityPreview(activityId) { fundings.forEach(funding => { const fundingFromConverted = activityFundingInformation[FUNDING_INFORMATION][ActivityConstants.FUNDINGS].find(fundingInWsCurrency => - funding[ActivityConstants.FUNDING_ID] === fundingInWsCurrency[ActivityConstants.FUNDING_ID]); + funding[ActivityConstants.AMP_FUNDING_ID] === fundingInWsCurrency[ActivityConstants.AMP_FUNDING_ID]); if (activityFundingInformation) { transactions.forEach(tt => { const rawTransactionsList = funding[tt]; From 1b02758f1a2250fc61701dfc036fa86d169e393e Mon Sep 17 00:00:00 2001 From: Julian de Anquin Date: Mon, 3 Jul 2023 13:49:14 -0300 Subject: [PATCH 6/6] AMP-30610 adjust version --- amp/TEMPLATE/ampTemplate/site-config.xml | 2 +- amp/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/amp/TEMPLATE/ampTemplate/site-config.xml b/amp/TEMPLATE/ampTemplate/site-config.xml index 4c8c7114f07..a803ff0f80b 100644 --- a/amp/TEMPLATE/ampTemplate/site-config.xml +++ b/amp/TEMPLATE/ampTemplate/site-config.xml @@ -1,7 +1,7 @@ - + ]> diff --git a/amp/pom.xml b/amp/pom.xml index 0b7e4424b14..0c6b6472157 100644 --- a/amp/pom.xml +++ b/amp/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.devgateway amp - 3.5.5 + 3.5.5.1 war Aid Management Platform