diff options
| author | Max Nanis | 2026-02-27 16:52:38 -0500 |
|---|---|---|
| committer | Max Nanis | 2026-02-27 16:52:38 -0500 |
| commit | 5a3e20ee7bf6088330ffe2bd43eed1ef41dd3b02 (patch) | |
| tree | 9d72540b1fa352fbea811094705d2248c38f4d25 /Jenkinsfile | |
| parent | 24bc0a8f3ad434932c0b35a3a4d6715a18a8f919 (diff) | |
| download | amt-jb-5a3e20ee7bf6088330ffe2bd43eed1ef41dd3b02.tar.gz amt-jb-5a3e20ee7bf6088330ffe2bd43eed1ef41dd3b02.zip | |
Jenkins Attempt #2 (linter, and env stage)
Diffstat (limited to 'Jenkinsfile')
| -rw-r--r-- | Jenkinsfile | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/Jenkinsfile b/Jenkinsfile index 265e6c6..cb285e0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -18,22 +18,32 @@ pipeline { } stages { - stage('Setup DB'){ + stage('Setup DB') { steps { script { - env.DB_NAME = "unittest-amt-jb-" + UUID.randomUUID().toString().replace("-", "").take(12) - env.AMT_JB_DB = "postgres://jenkins:123456789@unittest-postgresql.fmt2.grl.internal/${env.DB_NAME}" + env.DB_NAME = 'unittest-amt-jb-' + UUID.randomUUID().toString().replace('-', '').take(12) + env.AMT_JB_DB = "postgres://${env.DB_USER}:${env.DB_PASSWORD}@${env.DB_POSTGRESQL_HOST}/${env.DB_NAME}" echo "Using database: ${env.DB_NAME}" } sh """ - PGPASSWORD=123456789 psql -h unittest-postgresql.fmt2.grl.internal -U jenkins -d postgres <<EOF + PGPASSWORD=${env.DB_PASSWORD} psql -h ${env.DB_POSTGRESQL_HOST} -U ${env.DB_USER} -d ${env.DB_PASSWORD} <<EOF CREATE DATABASE "${env.DB_NAME}" WITH TEMPLATE = template0 ENCODING = 'UTF8'; EOF """ } } + stage('env') { + steps { + withCredentials([file( + credentialsId: 'amt-jb-app-env', + variable: 'ENV_FILE_PATH')]) { + sh "cp \$ENV_FILE_PATH ${WORKSPACE}/.env.test" + } + } + } + stage('setup:amt-jb-carer') { steps { checkout scmGit( @@ -45,7 +55,7 @@ pipeline { ], ) - dir("carer/") { + dir('carer/') { sh 'python3.13 -m venv $AMT_JB_CARER_VENV' sh '$AMT_JB_CARER_VENV/bin/pip install -U setuptools wheel pip' sh '$AMT_JB_CARER_VENV/bin/pip install -r requirements.txt' @@ -65,12 +75,11 @@ pipeline { withCredentials([sshUserPrivateKey( credentialsId: 'abdeb570-b708-44f3-b857-8a6b06ed9822', keyFileVariable: 'SSH_PRIVATE_KEY')]) { - sh """ eval \$(ssh-agent) && ssh-add ${SSH_PRIVATE_KEY} && \ ${AMT_JB_VENV}/bin/pip install -r requirements.txt """ - } + } } } @@ -86,7 +95,7 @@ pipeline { deleteDir() /* clean up our workspace */ sh """ - PGPASSWORD=123456789 psql -h unittest-postgresql.fmt2.grl.internal -U jenkins -d postgres <<EOF + PGPASSWORD=${env.DB_PASSWORD} psql -h ${env.DB_POSTGRESQL_HOST} -U ${env.DB_USER} -d postgres <<EOF DROP DATABASE "${env.DB_NAME}"; EOF """ |
