-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Jenkinsfile for multibranch pipeline jenkins job (#280)
* Add initial Jenkinsfile * Add environment variables from credentials * Fix syntax issue * Fix matrix and go tool issues * Remove debugging steps * Test matrix with additional tf version * Add lock to prevent multiple concurrent builds * Add required resource parameter * Try without keyword arguments * Ensure TF_ACC_TERRAFORM_VERSION is set
- Loading branch information
Showing
2 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
pipeline { | ||
agent any | ||
environment { | ||
XOA_URL = credentials("terraform-provider-xoa-url") | ||
XOA_USER = credentials("terraform-provider-xoa-user") | ||
XOA_PASSWORD = credentials("terraform-provider-xoa-password") | ||
XOA_POOL = credentials("terraform-provider-xoa-pool") | ||
XOA_TEMPLATE = credentials("terraform-provider-xoa-template") | ||
XOA_DISKLESS_TEMPLATE = credentials("terraform-provider-xoa-diskless-template") | ||
XOA_ISO = credentials("terraform-provider-xoa-iso") | ||
XOA_ISO_SR = credentials("terraform-provider-xoa-iso-sr") | ||
XOA_NETWORK = credentials("terraform-provider-xoa-network") | ||
XOA_RETRY_MAX_TIME = credentials("terraform-provider-xoa-retry-max-time") | ||
XOA_RETRY_MODE = credentials("terraform-provider-xoa-retry-mode") | ||
} | ||
|
||
// Ensure the desired Go version is installed for all stages, | ||
// using the name defined in the Global Tool Configuration | ||
tools { go '1.20' } | ||
|
||
stages { | ||
stage('BuildAndTest') { | ||
matrix { | ||
axes { | ||
axis { | ||
name 'TF_VERSION' | ||
values 'v0.14.11', 'v1.6.5' | ||
} | ||
} | ||
stages { | ||
stage('Test') { | ||
steps { | ||
lock('xoa-test-runner') { | ||
sh 'cp /opt/terraform-provider-xenorchestra/testdata/images/alpine-virt-3.17.0-x86_64.iso xoa/testdata/alpine-virt-3.17.0-x86_64.iso' | ||
sh 'TF_VERSION=${TF_VERSION} make ci' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters