build: Populate/Reference packer parameters
All checks were successful
Container & Helm chart / Linting (push) Successful in 6s
Container & Helm chart / Semantic Release (Dry-run) (push) Successful in 49s
Container & Helm chart / Kubernetes Bootstrap Appliance (push) Successful in 30s

This commit is contained in:
Danny Bessems 2024-06-05 11:16:12 +10:00
parent 092ce5eabc
commit 6568acf541

View File

@ -62,6 +62,11 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Parse Kubernetes version
uses: mikefarah/yq@master
id: get_k8sversion
with:
cmd: yq '.components.clusterapi.workload.version.k8s' ansible/vars/metacluster.yml
- name: Setup `packer` - name: Setup `packer`
uses: hashicorp/setup-packer@main uses: hashicorp/setup-packer@main
id: setup id: setup
@ -75,15 +80,15 @@ jobs:
run: | run: |
packer validate \ packer validate \
-only=vsphere-iso.bootstrap \ -only=vsphere-iso.bootstrap \
-var vm_name=${DRONE_BUILD_NUMBER}-${DRONE_COMMIT_SHA:0:10}-$(openssl rand -hex 3) \ -var vm_name=${{ gitea.job }}-${{ gitea.sha:0:10 }}-$(openssl rand -hex 3) \
-var docker_username=${{ secrets.DOCKER_USERNAME }} \ -var docker_username=${{ secrets.DOCKER_USERNAME }} \
-var docker_password=${{ secrets.DOCKER_PASSWORD }} \ -var docker_password=${{ secrets.DOCKER_PASSWORD }} \
-var repo_username=${{ secrets.REPO_USERNAME }} \ -var repo_username=${{ secrets.REPO_USERNAME }} \
-var repo_password=${{ secrets.REPO_PASSWORD }} \ -var repo_password=${{ secrets.REPO_PASSWORD }} \
-var ssh_password=${{ secrets.SSH_PASSWORD }} \ -var ssh_password=${{ secrets.SSH_PASSWORD }} \
-var hv_password=${{ secrets.HV_PASSWORD }} \ -var hv_password=${{ secrets.HV_PASSWORD }} \
-var k8s_version=$K8S_VERSION \ -var k8s_version=${{ steps.get_k8sversion.outputs.result }} \
-var appliance_version=$APPLIANCE_VERSION \ -var appliance_version=${{ needs.semrel_dryrun.outputs.version }} \
./packer ./packer
# - name: Build Artifact # - name: Build Artifact
# run: packer build -color=false -on-error=abort ./image.pkr.hcl # run: packer build -color=false -on-error=abort ./image.pkr.hcl