Compare commits
No commits in common. "main" and "stage" have entirely different histories.
1 changed files with 14 additions and 87 deletions
101
Jenkinsfile
vendored
101
Jenkinsfile
vendored
|
|
@ -1,95 +1,22 @@
|
|||
pipeline {
|
||||
agent {
|
||||
docker {
|
||||
image 'docker:27-cli'
|
||||
args '-v /var/run/docker.sock:/var/run/docker.sock'
|
||||
}
|
||||
}
|
||||
|
||||
environment {
|
||||
IMAGE_NAME = 'core-pim-test'
|
||||
IMAGE_TAG = 'latest'
|
||||
CONTAINER_NAME = "${IMAGE_NAME}-container"
|
||||
|
||||
DOCKERHUB_USER = 'ramonvasquezliesa'
|
||||
DOCKERHUB_REPO = "${DOCKERHUB_USER}/${IMAGE_NAME}"
|
||||
DOCKERHUB_IMAGE = "${DOCKERHUB_REPO}:${IMAGE_TAG}"
|
||||
|
||||
FORGEJO_URL = 'https://forgejo.test.dev.it.liesa.com.ar'
|
||||
FORGEJO_OWNER = 'it.dev'
|
||||
FORGEJO_REPO = 'integrations.core.pim.git'
|
||||
|
||||
REQUIRE_VERSION_TAG = 'true'
|
||||
REMOVE_DANGLING_IMAGES = 'true'
|
||||
|
||||
PORTS = '8081:80'
|
||||
ENV_FILE = ''
|
||||
VOLUMES = ''
|
||||
}
|
||||
agent any
|
||||
|
||||
stages {
|
||||
stage('Checkout (with submodules)') {
|
||||
stage('Stage Test')
|
||||
{
|
||||
steps {
|
||||
checkout(scmGit(
|
||||
// branches: [[name: '*/dev']],
|
||||
userRemoteConfigs: [[
|
||||
url: "${FORGEJO_URL}/${FORGEJO_OWNER}/${FORGEJO_REPO}",
|
||||
credentialsId: 'forgejo-token-hermes'
|
||||
]],
|
||||
extensions: [
|
||||
[$class: 'SubmoduleOption',
|
||||
disableSubmodules: false,
|
||||
recursiveSubmodules: true,
|
||||
parentCredentials: true,
|
||||
trackingSubmodules: true
|
||||
]
|
||||
]
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
stage('Login Docker') {
|
||||
steps {
|
||||
sh '''
|
||||
docker --version
|
||||
echo "$DOCKERHUB_TOKEN" | docker login -u "$DOCKERHUB_USER" --password-stdin
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
||||
stage('Docker Login') {
|
||||
steps {
|
||||
withCredentials([
|
||||
usernamePassword(
|
||||
credentialsId: 'dockerhub-credentials-hermes',
|
||||
usernameVariable: 'DOCKERHUB_USER',
|
||||
passwordVariable: 'DOCKERHUB_PASS'
|
||||
)
|
||||
]) {
|
||||
sh '''
|
||||
set -eu pipefail
|
||||
echo "$DOCKERHUB_PASS" | docker login -u "$DOCKERHUB_USER" --password-stdin
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Build Image') {
|
||||
steps {
|
||||
script {
|
||||
docker.build("${DOCKERHUB_REPO}:${TAG}", '-f src/Service/Infrastructure/App/Dockerfile .')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Push Image') {
|
||||
steps {
|
||||
script {
|
||||
docker.withRegistry('https://index.docker.io/v1/', 'dockerhub-credentials-hermes') {
|
||||
docker.image("${DOCKERHUB_REPO}:${TAG}").push()
|
||||
}
|
||||
}
|
||||
echo 'Un día me preguntaron qué es lo que quería...'
|
||||
echo 'les contesté que Racing el domingo me dé una alegría...'
|
||||
echo 'para poder festejar con toda la gente...'
|
||||
echo 'Racing, mi buen amigo...'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue