From f01bd5eabd0b84ed2fec1b280260f3c6fb151f64 Mon Sep 17 00:00:00 2001 From: deepanshu-ops0 Date: Thu, 31 Jul 2025 18:07:44 +0530 Subject: [PATCH] IaC changes --- .../Jenkinsfile | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 5d1a38e8-e15a-450e-903c-562255e51faf/Jenkinsfile diff --git a/5d1a38e8-e15a-450e-903c-562255e51faf/Jenkinsfile b/5d1a38e8-e15a-450e-903c-562255e51faf/Jenkinsfile new file mode 100644 index 0000000..b1f996e --- /dev/null +++ b/5d1a38e8-e15a-450e-903c-562255e51faf/Jenkinsfile @@ -0,0 +1,61 @@ +pipeline { + agent any + + environment { + GO_VERSION = '1.21' + GOPATH = "${WORKSPACE}/gopath" + PATH = "${GOPATH}/bin:${PATH}" + } + + stages { + stage('Clone Repository') { + steps { + git url: 'https://github.com/deepanshu-ops0/ops0-cli', branch: 'main' + } + } + + stage('Setup Go Environment') { + steps { + sh 'go version' + sh 'mkdir -p ${GOPATH}/src ${GOPATH}/bin' + sh 'go env' + } + } + + stage('Download Dependencies') { + steps { + sh 'go mod download' + } + } + + stage('Run Tests') { + steps { + sh 'go test ./...' + } + } + + stage('Build Binary') { + steps { + sh 'go build -o bin/ops0-cli' + } + } + + stage('Archive Artifacts') { + steps { + archiveArtifacts artifacts: 'bin/ops0-cli', fingerprint: true + } + } + } + + post { + success { + echo 'Pipeline completed successfully!' + } + failure { + echo 'Pipeline failed!' + } + always { + cleanWs() + } + } +} \ No newline at end of file