-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yaml
37 lines (33 loc) · 1.05 KB
/
.gitlab-ci.yaml
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
35
36
37
# Gitlab ci/cd pipeline example for deploying templates to vmware
# use -force to replace existing templates
stages:
- fmt
- validate
- build
format_code:
stage: fmt
script:
- echo "formatting packer files"
- packer fmt -recursive .
validate_windows-2022-core:
stage: validate
script:
- echo "validate Windows 2022 Core config"
- packer init .
- packer validate --only vsphere-iso.windows
--var-file variables/build/vsphere-iso.pkrvars.hcl
--var-file=variables/os/vsphere-iso.windows.2022.core.pkrvars.hcl
-var "vcenter_username=username"
-var "vcenter_password=password" .
deploy_windows-2022-core:
stage: build
script:
- echo "Building Windows 2022 Core"
- packer init .
- packer build --only vsphere-iso.windows -force
--var-file variables/build/vsphere-iso.pkrvars.hcl
--var-file=variables/os/vsphere-iso.windows.2022.core.pkrvars.hcl
-var "vcenter_username=$username"
-var "vcenter_password=$password" .
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'