This commit is contained in:
Matias Pou 2026-01-06 15:41:33 -03:00
parent cecd1a7497
commit 2d38cd5baf

46
Jenkinsfile vendored
View file

@ -6,9 +6,9 @@ pipeline {
environment { environment {
IMAGE_NAME = 'rd.jenkins' IMAGE_NAME = 'rd.jenkins'
AWS_URL = "test" //credentials('aws-ecr-url') AWS_URL = credentials('aws-ecr-url')
AWS_USER = "test" //credentials('aws-ecr-username') AWS_USER = credentials('aws-ecr-username')
AWS_REGION = "test" //credentials('aws-ecr-region') AWS_REGION = credentials('aws-ecr-region')
AWS_CREDS_ID = 'aws-jenkins' AWS_CREDS_ID = 'aws-jenkins'
} }
@ -42,31 +42,31 @@ pipeline {
} }
} }
stage('Build Image') { // stage('Build Image') {
steps {
sh "echo ${AWS_IMAGE}"
script {
docker.build("${AWS_IMAGE}", '-f src/worker/Dockerfile ./src/worker/ --no-cache')
// docker.build("${AWS_IMAGE}", '--no-cache --pull -f src/Service/Infrastructure/App/Dockerfile .')
}
}
}
// stage('AWS ECR Login') {
// steps { // steps {
// withAWS(credentials: AWS_CREDS_ID, region: AWS_REGION) { // sh "echo ${AWS_IMAGE}"
// script { // script {
// sh """ // docker.build("${AWS_IMAGE}", '-f src/worker/Dockerfile ./src/worker/ --no-cache')
// set -euo pipefail // // docker.build("${AWS_IMAGE}", '--no-cache --pull -f src/Service/Infrastructure/App/Dockerfile .')
// echo "Logging in to AWS ECR: \${AWS_URL}"
// aws ecr get-login-password --region "\${AWS_REGION}" \\
// | docker login --username AWS --password-stdin "\${AWS_URL}"
// """
// }
// } // }
// } // }
// } // }
stage('AWS ECR Login') {
steps {
withAWS(credentials: AWS_CREDS_ID, region: AWS_REGION) {
script {
sh """
set -euo pipefail
echo "Logging in to AWS ECR: \${AWS_URL}"
aws ecr get-login-password --region "\${AWS_REGION}" \\
| docker login --username AWS --password-stdin "\${AWS_URL}"
"""
}
}
}
}
// stage('Push Image') { // stage('Push Image') {
// steps { // steps {
// sh "docker push ${AWS_IMAGE}" // sh "docker push ${AWS_IMAGE}"