├── README.md ├── Jenkinsfile_k8s ├── .github ├── release-drafter.yml └── workflows │ └── release-drafter.yml ├── updatecli ├── values.yaml └── updatecli.d │ ├── packer.yml │ └── packer-provisioner.yml └── Dockerfile /README.md: -------------------------------------------------------------------------------- 1 | # docker-packer 2 | a docker image containing Packer and additional provisioners 3 | -------------------------------------------------------------------------------- /Jenkinsfile_k8s: -------------------------------------------------------------------------------- 1 | parallelDockerUpdatecli([imageName: 'packer', rebuildImageOnPeriodicJob: false]) 2 | -------------------------------------------------------------------------------- /.github/release-drafter.yml: -------------------------------------------------------------------------------- 1 | _extends: .github 2 | 3 | name-template: 'next' 4 | tag-template: 'next' 5 | -------------------------------------------------------------------------------- /updatecli/values.yaml: -------------------------------------------------------------------------------- 1 | github: 2 | user: "updatebot" 3 | email: "updatebot@olblak.com" 4 | username: "jenkins-infra-bot" 5 | token: "UPDATECLI_GITHUB_TOKEN" 6 | branch: "main" 7 | owner: "jenkins-infra" 8 | repository: "docker-packer" 9 | -------------------------------------------------------------------------------- /.github/workflows/release-drafter.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Release Drafter 3 | 4 | on: 5 | push: 6 | branches: 7 | - main 8 | 9 | jobs: 10 | update_release_draft: 11 | runs-on: ubuntu-20.04 12 | steps: 13 | - uses: release-drafter/release-drafter@v5 14 | env: 15 | # This token is generated automatically by default in GitHub Actions: no need to create it manually 16 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 17 | -------------------------------------------------------------------------------- /updatecli/updatecli.d/packer.yml: -------------------------------------------------------------------------------- 1 | title: Bump packer docker image version 2 | sources: 3 | latestRelease: 4 | name: Get latest hashicorp/packer version 5 | kind: githubRelease 6 | spec: 7 | owner: "hashicorp" 8 | repository: "packer" 9 | token: "{{ requiredEnv .github.token }}" 10 | username: "{{ .github.username }}" 11 | versionFilter: 12 | # retrieve the latest version as semver (without 'v' prefix) 13 | kind: semver 14 | conditions: 15 | checkDockerImagePublished: 16 | name: "Is latest hashicorp/packer docker image published" 17 | kind: dockerImage 18 | spec: 19 | image: "hashicorp/packer" 20 | targets: 21 | updateReleaseInDockerfile: 22 | name: "Update the version of packer in the Dockerfile" 23 | kind: dockerfile 24 | spec: 25 | file: Dockerfile 26 | instruction: 27 | keyword: "FROM" 28 | matcher: "hashicorp/packer" 29 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM hashicorp/packer:1.6.5 2 | 3 | ARG WINDOWS_UPDATE_VERSION=v0.13.0 4 | 5 | ADD https://github.com/rgl/packer-plugin-windows-update/releases/download/${WINDOWS_UPDATE_VERSION}/packer-plugin-windows-update_${WINDOWS_UPDATE_VERSION}_SHA256SUMS ./ 6 | ADD https://github.com/rgl/packer-plugin-windows-update/releases/download/${WINDOWS_UPDATE_VERSION}/packer-plugin-windows-update_${WINDOWS_UPDATE_VERSION}_x5.0_linux_amd64.zip ./ 7 | 8 | RUN sed -i '/.*linux_amd64.zip/!d' packer-plugin-windows-update_${WINDOWS_UPDATE_VERSION}_SHA256SUMS && \ 9 | sha256sum -cs packer-plugin-windows-update_${WINDOWS_UPDATE_VERSION}_SHA256SUMS && \ 10 | unzip packer-plugin-windows-update_${WINDOWS_UPDATE_VERSION}_x5.0_linux_amd64.zip -d /bin && \ 11 | rm -f packer-plugin-windows-update_${WINDOWS_UPDATE_VERSION}_x5.0_linux_amd64.zip && \ 12 | mv /bin/packer-plugin-windows-update_v0.13.0_x5.0_linux_amd64 /bin/packer-plugin-windows-update && \ 13 | chmod a+x /bin/packer-plugin-windows-update 14 | -------------------------------------------------------------------------------- /updatecli/updatecli.d/packer-provisioner.yml: -------------------------------------------------------------------------------- 1 | title: Bump Packer Windows Update Provisioner plugin version 2 | sources: 3 | latestRelease: 4 | kind: githubRelease 5 | name: Get latest rgl/packer-plugin-windows-update version 6 | spec: 7 | owner: "rgl" 8 | repository: "packer-plugin-windows-update" 9 | token: "{{ requiredEnv .github.token }}" 10 | username: "{{ .github.username }}" 11 | # No condition here as we're downloading the plugin from github directly (no docker image involved) 12 | targets: 13 | updateReleaseInDockerfile: 14 | name: "Update the version of the Packer Windows Update Provisioner plugin in the Dockerfile" 15 | kind: dockerfile 16 | spec: 17 | file: Dockerfile 18 | instruction: 19 | keyword: "ARG" 20 | matcher: "WINDOWS_UPDATE_VERSION" 21 | scm: 22 | github: 23 | user: "{{ .github.user }}" 24 | email: "{{ .github.email }}" 25 | owner: "{{ .github.owner }}" 26 | repository: "{{ .github.repository }}" 27 | token: "{{ requiredEnv .github.token }}" 28 | username: "{{ .github.username }}" 29 | branch: "{{ .github.branch }}" 30 | --------------------------------------------------------------------------------