Actualiser Jenkinsfile
This commit is contained in:
1 parent
0aa4c0dcbf
commit
d094e046e7
1 file changed
+5
-41
Vendored
+5
-41
@@ -1,42 +1,6 @@
|
|||||||
pipeline {
|
@Library('my-shared-library')
|
||||||
agent none
|
|
||||||
|
|
||||||
parameters {
|
pythonBuildPipeline(
|
||||||
string(name: 'PYTHON_VERSION', defaultValue: '3.12-slim', description: 'Version de l\'image Python')
|
PYTHON_VERSION: '3.12-slim',
|
||||||
choice(name: 'ENVIRONMENT', choices: ['DEV', 'PROD'], description: 'Environnement de déploiement')
|
ENVIRONMENT: 'DEV'
|
||||||
}
|
)
|
||||||
|
|
||||||
stages {
|
|
||||||
stage('Package') {
|
|
||||||
agent {
|
|
||||||
kubernetes {
|
|
||||||
yaml """
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Pod
|
|
||||||
spec:
|
|
||||||
containers:
|
|
||||||
- name: build
|
|
||||||
image: python:${params.PYTHON_VERSION}
|
|
||||||
command: ["sleep"]
|
|
||||||
args: ["infinity"]
|
|
||||||
env:
|
|
||||||
- name: ENV_TYPE
|
|
||||||
value: "${params.ENVIRONMENT}"
|
|
||||||
"""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
steps {
|
|
||||||
container('build') {
|
|
||||||
sh '''
|
|
||||||
echo "Image Python utilisée : python:${PYTHON_VERSION}"
|
|
||||||
echo "Environnement ciblé : ${ENVIRONMENT}"
|
|
||||||
echo "Nom de l'hôte dans le pod : $(hostname)"
|
|
||||||
echo "webhook"
|
|
||||||
sleep 5
|
|
||||||
echo "done"
|
|
||||||
'''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in new issue
Block a user