From 683fa05dc4c46601de606a0c26dad7bb0374c9b4 Mon Sep 17 00:00:00 2001 From: Nathan Wagner Date: Tue, 4 Oct 2022 12:39:37 -0400 Subject: [PATCH] attempt at a jenkins file, next to no attributes --- Jenkinsfile | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..9ba19e3 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,36 @@ +pipeline { + agent { label 'pipes-docker-agent' } + parameters { + string(name: 'GIT_URL', defaultValue: '', description: 'Url of helm chart git repo') + string(name: 'BRANCH_NAME', defaultValue: '', description: 'Branch name from helm repo') + string(name: 'TAG_NAME', defaultValue: '', description: 'Latest tag') + string(name: 'REPO_PATH', defaultValue: '', description: 'Path in acr') + } + environment { + // URL of helm repo + GIT_URL = "${params.GIT_URL}" + BRANCH_NAME= "${params.BRANCH_NAME}" + + GITHUB = credentials('github_credential') + GITHUB_USERNAME = "${env.GITHUB_USR}" + GITHUB_PASSWORD = "${env.GITHUB_PSW}" + + + + EMAIL = "nathan_wagner@gap.com" + } +stages { + stage('GitCheckOut') { + checkout([$class: 'GitSCM', branches: [[name: "${env.CHECKOUT}"]], extensions: [], userRemoteConfigs: [[credentialsId: 'gitea', url: "$GIT_URL"]]]) + +} + stage('buildPush') { + sh(''' + docker buildx create docker buildx create --bootstrap --name=jenkins-agent --driver=kubernetes --driver-opt=namespace=jenkinsagent --driver-opt=qemu.install=true --driver-opt=insecure=true + docker buildx build . -t registry.local:/rgbBoard:v0.0.1 --push --platform=linux/arm64,linux/amd64 + ''') + } + +} + +}