From 1cbfa5b75d7a8ff814c5df74d8b5c7f1c0670f69 Mon Sep 17 00:00:00 2001 From: K Siva Prasad Reddy Date: Tue, 9 Jan 2024 14:43:38 +0530 Subject: [PATCH] Using TCC in Jenkins --- .github/workflows/maven.yml | 4 ++-- Jenkinsfile | 35 +++++++++++++++++++++++------------ 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index e6e9c1a..4668ee1 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -11,10 +11,10 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Setup Java 17 + - name: Setup Java 21 uses: actions/setup-java@v3 with: - java-version: 17 + java-version: 21 distribution: 'temurin' cache: 'maven' diff --git a/Jenkinsfile b/Jenkinsfile index 86a8d11..9c3be5b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,13 +1,24 @@ pipeline { - agent any - - triggers { pollSCM 'H/2 * * * *' } // poll every 2 mins - - stages { - stage('Build') { - steps { - sh './mvnw verify' - } - } - } -} + agent any + + triggers { pollSCM 'H/2 * * * *' } + + environment { + TC_CLOUD_TOKEN = credentials('tc-cloud-token-secret-id') + } + + stages { + + stage('TCC SetUp') { + steps { + sh "curl -fsSL https://get.testcontainers.cloud/bash | sh" + } + } + + stage('Build') { + steps { + sh './mvnw verify' + } + } + } +} \ No newline at end of file