Skip to content

Commit

Permalink
fix(build): fix vagrant issue related to WinRM
Browse files Browse the repository at this point in the history
  • Loading branch information
ruzickap committed Jan 31, 2024
1 parent 201a258 commit 8724a2a
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 18 deletions.
38 changes: 25 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ on:
ANSIBLE_DEBUG:
type: choice
description: ANSIBLE_DEBUG (true, false)
default: "false"
options:
- "false"
- "true"
Expand All @@ -54,7 +53,6 @@ on:
build_upload:
type: choice
description: Upload release to Vagrant Cloud
default: "false"
options:
- "false"
- "true"
Expand All @@ -63,6 +61,7 @@ on:
- cron: "0 1 1 * *"

env:
PACKER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PACKER_IMAGES_OUTPUT_DIR: /var/tmp/packer-templates-images
PACKER_CACHE_DIR: /var/tmp/packer_cache
LOGDIR: /var/tmp/packer-templates-logs
Expand Down Expand Up @@ -153,7 +152,7 @@ jobs:
build-boxes:
name: "*"
runs-on: macos-12
runs-on: macos-11
needs: generate-matrix
if: ${{ needs.generate-matrix.outputs.MATRIX != '[]' && needs.generate-matrix.outputs.MATRIX != '' }}
concurrency:
Expand Down Expand Up @@ -196,26 +195,39 @@ jobs:
- name: Install packages
run: |
set -euxo pipefail
# Remove unused packages to save some disk space
rm -rf /Users/runner/Library/Developer /Users/runner/Library/Android /Users/runner/hostedtoolcache /Users/runner/.dotnet
brew update
brew install bash coreutils gnu-sed jq packer hudochenkov/sshpass/sshpass vagrant
brew install ansible bash coreutils gnu-sed jq packer hudochenkov/sshpass/sshpass hashicorp/tap/hashicorp-vagrant
if [[ "${PACKER_VAGRANT_PROVIDER}" = "libvirt" ]]; then
brew install qemu xorriso
qemu-system-x86_64 --version
fi
if [[ "${PACKER_VAGRANT_PROVIDER}" = "virtualbox" ]]; then
brew install virtualbox
vboxmanage --version
fi
# renovate: datasource=pypi depName=ansible
ANSIBLE_VERSION="8.2.0"
pip3 install ansible=="${ANSIBLE_VERSION}"
packer plugins install github.com/hashicorp/ansible
packer plugins install github.com/hashicorp/qemu
packer plugins install github.com/hashicorp/vagrant
packer plugins install github.com/hashicorp/virtualbox
vagrant --version
packer --version
ansible --version
if [[ "${BUILD}" =~ windows ]]; then
# renovate: datasource=pypi depName=pywinrm
PYWINRM_VERSION="0.4.3"
pip3 install pywinrm=="${PYWINRM_VERSION}"
ansible-galaxy collection install -v -r ansible/requirements.yml
ansible-galaxy collection install --force -r ansible/requirements.yml
fi
echo "/usr/local/bin:/usr/local/opt/gnu-sed/libexec/gnubin:/usr/local/opt/coreutils/libexec/gnubin" >> "${GITHUB_PATH}"
# Remove unused packages to save some disk space
rm -rf /Users/runner/Library/Developer /Users/runner/Library/Android /Users/runner/hostedtoolcache /Users/runner/.dotnet
# Used by mxschmitt/action-tmate
touch continue
Expand All @@ -231,11 +243,11 @@ jobs:
- name: Upload logs to GitHub artifact store in case of VirtualBox failure
uses: actions/upload-artifact@v3
if: ${{ always() && (steps.build_image.outcome == 'failure') && contains(matrix.stage, 'virtualbox') }}
if: ${{ always() && contains(matrix.stage, 'virtualbox') }}
with:
name: ${{ matrix.stage }}
path: ${{ env.LOGDIR }}/*
retention-days: 1
retention-days: 3

- name: Check the created box image
run: |
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,3 @@ packer_cache/

# pre-commit config file
.pre-commit-config.yaml

# release-it configuration file
.release-it.yml

0 comments on commit 8724a2a

Please sign in to comment.