Update Jenkinsfile

This commit is contained in:
Ramón Vásquez 2025-10-07 13:46:46 -03:00
parent ca1a3b458d
commit 5665f72481

43
Jenkinsfile vendored
View file

@ -1,49 +1,12 @@
pipeline { pipeline {
agent any agent any
environment {
IMAGE_NAME = 'rd.jenkins'
AWS_USER = 'liesa'
AWS_REPO = "${AWS_USER}/${IMAGE_NAME}"
AWS_URL = '231670719202.dkr.ecr.sa-east-1.amazonaws.com'
TAG = 'latest'
}
stages { stages {
stage('Checkout (with submodules)') { stage('Stage Test')
{
steps { steps {
checkout(scmGit( echo 'Hello World'
branches: [[name: '*/main']],
userRemoteConfigs: [[
url: 'https://stalked-noegenetic-amari.ngrok-free.dev/hermes/pl-1.git',
credentialsId: 'hermes-forgejo-local'
]]
))
}
}
stage('Build Image') {
steps {
script {
docker.build("${AWS_REPO}:${TAG}", '-f Dockerfile .')
}
}
}
stage('Push Image') {
steps {
sh '''
set -eu pipefail
aws ecr get-login-password --region sa-east-1 | docker login --username AWS --password-stdin $AWS_URL
'''
script {
docker.withRegistry("http://${AWS_URL}", 'ecr:sa-east-1:aws-prod') {
docker.image("${AWS_REPO}:${TAG}").push()
} }
} }
} }
} }
}
}
//