-
Notifications
You must be signed in to change notification settings - Fork 25
/
JenkinsfileArgoCDTemplate
34 lines (31 loc) · 1.14 KB
/
JenkinsfileArgoCDTemplate
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
pipeline {
agent any
stages {
stage('Build') {
steps {
// Your build steps here
sh 'make build'
}
}
stage('Test') {
steps {
// Your test steps here
sh 'make test'
}
}
stage('Deploy') {
steps {
// Deploy to Argo CD
script {
// Install argocd CLI if not already installed
sh 'curl -sSL -o /usr/local/bin/argocd https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-amd64'
sh 'chmod +x /usr/local/bin/argocd'
// Login to Argo CD (replace placeholders with your Argo CD credentials)
sh 'argocd login <ARGOCD_SERVER> --insecure --username=<USERNAME> --password=<PASSWORD>'
// Sync your application with Argo CD (replace placeholders with your application details)
sh 'argocd app sync <APPLICATION_NAME> --namespace <NAMESPACE>'
}
}
}
}
}