Posts

Showing posts from August, 2023

Declarative Groovy Pipeline

  -- A Sample Declarative Pipeline - Build, test and , build docker image , update GitOps repository pipeline { agent any environment { DOCKER_REGISTRY = "your-docker-registry-url" GITOPS_REPO = "your-gitops-repo-url" GITOPS_BRANCH = "main" } stages { stage('Build and Test') { steps { // Checkout your source code from version control checkout scm // Run tests, build binaries, etc. sh 'make test' } } stage('Build Docker Image') { steps { script { def dockerImageTag = "test-${env.BUILD_NUMBER}" // Build Docker image sh "docker build -t ${DOCKER_REGISTRY}/your-image-name:${dockerImageTag} ." ...