Compare commits
60 Commits
b1bcc4da42
...
master
Author | SHA1 | Date | |
---|---|---|---|
![]() |
357667b352 | ||
c32a19ab36 | |||
![]() |
739047e477 | ||
77dab0de04 | |||
31347764ae | |||
![]() |
e4749fd0c4 | ||
12c75403a0 | |||
29e242c30c | |||
![]() |
ee57c502d7 | ||
d36d9d7eb6 | |||
8af7c465bb | |||
752f46a358 | |||
822c235f3f | |||
6249c093f4 | |||
12fa6bb959 | |||
a78501ade7 | |||
98d832d5fb | |||
52f8b84332 | |||
879c13a440 | |||
d3a437fecd | |||
f90cf62a71 | |||
2e6ea3f060 | |||
db7860a0e8 | |||
1a90e017c7 | |||
85b8c36315 | |||
49779d8b31 | |||
3aad828587 | |||
d04cbb9764 | |||
621de81ab9 | |||
9e6c071cce | |||
5df8233e83 | |||
89c2b456e2 | |||
98478ff55d | |||
dda78b7334 | |||
50de7d558a | |||
6b1c97f6e7 | |||
25d21e11b6 | |||
8eb849b671 | |||
342556c25b | |||
3e401c35fc | |||
2dbecabed8 | |||
5c692b03d2 | |||
6d62686091 | |||
73337a661b | |||
40c87c2ed4 | |||
e3cc74cfba | |||
b1ad86f5e5 | |||
041b85772e | |||
d1c4c1bca4 | |||
d42a672e3b | |||
5601e13bad | |||
436ec64266 | |||
4f36a48581 | |||
8ee8e727c2 | |||
f0ab12a145 | |||
3ab936b510 | |||
50c7536bf4 | |||
6682f1306f | |||
e218e28667 | |||
0a8000bbe7 |
51
.drone.yml
51
.drone.yml
@@ -1,51 +0,0 @@
|
|||||||
kind: pipeline
|
|
||||||
type: kubernetes
|
|
||||||
name: Harbor
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: build & publish
|
|
||||||
image: plugins/docker
|
|
||||||
context: .
|
|
||||||
settings:
|
|
||||||
repo: bv11-cr01.bessems.eu/library/packer-extended
|
|
||||||
registry: bv11-cr01.bessems.eu
|
|
||||||
tags: latest
|
|
||||||
mtu: 1450
|
|
||||||
username:
|
|
||||||
from_secret: harbor_username
|
|
||||||
password:
|
|
||||||
from_secret: harbor_password
|
|
||||||
build_args_from_env:
|
|
||||||
- REPO_USERNAME
|
|
||||||
- REPO_PASSWORD
|
|
||||||
environment:
|
|
||||||
REPO_USERNAME:
|
|
||||||
from_secret: repo_username
|
|
||||||
REPO_PASSWORD:
|
|
||||||
from_secret: repo_password
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
type: kubernetes
|
|
||||||
name: Dockerhub
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: build & publish
|
|
||||||
image: plugins/docker
|
|
||||||
context: .
|
|
||||||
settings:
|
|
||||||
repo: djpbessems/packer-extended
|
|
||||||
tags: latest
|
|
||||||
mtu: 1450
|
|
||||||
username:
|
|
||||||
from_secret: docker_username
|
|
||||||
password:
|
|
||||||
from_secret: docker_password
|
|
||||||
build_args_from_env:
|
|
||||||
- REPO_USERNAME
|
|
||||||
- REPO_PASSWORD
|
|
||||||
environment:
|
|
||||||
REPO_USERNAME:
|
|
||||||
from_secret: repo_username
|
|
||||||
REPO_PASSWORD:
|
|
||||||
from_secret: repo_password
|
|
128
.gitea/workflows/actions.yaml
Normal file
128
.gitea/workflows/actions.yaml
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
name: build-image
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
semrel_dryrun:
|
||||||
|
name: Semantic Release (Dry-run)
|
||||||
|
runs-on: dind-rootless
|
||||||
|
outputs:
|
||||||
|
version: ${{ steps.sem_rel.outputs.version }}
|
||||||
|
steps:
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Set up Node
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: 20
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
npm install \
|
||||||
|
semantic-release \
|
||||||
|
@semantic-release/commit-analyzer \
|
||||||
|
@semantic-release/exec
|
||||||
|
- name: Semantic Release (dry-run)
|
||||||
|
id: sem_rel
|
||||||
|
run: |
|
||||||
|
npx semantic-release \
|
||||||
|
--package @semantic-release/exec \
|
||||||
|
--package semantic-release \
|
||||||
|
--branches ${{ gitea.refname }} \
|
||||||
|
--tag-format 'v${version}' \
|
||||||
|
--dry-run \
|
||||||
|
--plugins @semantic-release/commit-analyzer,@semantic-release/exec \
|
||||||
|
--analyzeCommits @semantic-release/commit-analyzer \
|
||||||
|
--verifyRelease @semantic-release/exec \
|
||||||
|
--verifyReleaseCmd 'echo "version=${nextRelease.version}" >> $GITHUB_OUTPUT'
|
||||||
|
env:
|
||||||
|
GIT_CREDENTIALS: ${{ secrets.GIT_USERNAME }}:${{ secrets.GIT_APIKEY }}
|
||||||
|
- name: Assert semantic release output
|
||||||
|
run: |
|
||||||
|
[[ -z "${{ steps.sem_rel.outputs.version }}" ]] && {
|
||||||
|
echo 'No release tag - exiting'; exit 1
|
||||||
|
} || {
|
||||||
|
echo 'Release tag set correctly: ${{ steps.sem_rel.outputs.version }}'; exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
build_image:
|
||||||
|
name: Container image
|
||||||
|
runs-on: dind
|
||||||
|
needs: semrel_dryrun
|
||||||
|
container: ghcr.io/catthehacker/ubuntu:act-latest
|
||||||
|
steps:
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Set up qemu
|
||||||
|
# Will not work out of the box; instead using dind
|
||||||
|
# uses: docker/setup-qemu-action@v3
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y qemu-user-static
|
||||||
|
- name: Create builder context
|
||||||
|
id: buildx-context
|
||||||
|
run: |
|
||||||
|
docker context create builders
|
||||||
|
env:
|
||||||
|
DOCKER_HOST: tcp://docker:2376/
|
||||||
|
DOCKER_TLS_CERTDIR: /certs
|
||||||
|
DOCKER_TLS_VERIFY: 1
|
||||||
|
DOCKER_CERT_PATH: "/certs/client"
|
||||||
|
- name: Set up buildx
|
||||||
|
id: buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
with:
|
||||||
|
# buildkitd-flags: --debug
|
||||||
|
endpoint: builders
|
||||||
|
env:
|
||||||
|
DOCKER_HOST: "tcp://docker:2376/"
|
||||||
|
DOCKER_TLS_CERTDIR: "/certs"
|
||||||
|
DOCKER_TLS_VERIFY: 1
|
||||||
|
DOCKER_CERT_PATH: "/certs/client"
|
||||||
|
- name: Login to target repository
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: code.spamasaurus.com
|
||||||
|
username: ${{ secrets.GIT_USERNAME }}
|
||||||
|
password: ${{ secrets.GIT_APIKEY }}
|
||||||
|
- name: Build & push container image
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
build-args: |
|
||||||
|
REPO_USERNAME=${{ secrets.REPO_USERNAME }}
|
||||||
|
REPO_PASSWORD=${{ secrets.REPO_PASSWORD }}
|
||||||
|
context: .
|
||||||
|
tags: code.spamasaurus.com/djpbessems/packer-extended:${{ needs.semrel_dryrun.outputs.version }}
|
||||||
|
provenance: false
|
||||||
|
push: true
|
||||||
|
env:
|
||||||
|
DOCKER_HOST: "tcp://docker:2376/"
|
||||||
|
DOCKER_TLS_CERTDIR: "/certs"
|
||||||
|
DOCKER_TLS_VERIFY: 1
|
||||||
|
DOCKER_CERT_PATH: "/certs/client"
|
||||||
|
|
||||||
|
semrel:
|
||||||
|
name: Semantic Release
|
||||||
|
runs-on: dind-rootless
|
||||||
|
needs: build_image
|
||||||
|
steps:
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Set up Node
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: 20
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
npm install \
|
||||||
|
semantic-release \
|
||||||
|
@semantic-release/changelog \
|
||||||
|
@semantic-release/commit-analyzer \
|
||||||
|
@semantic-release/git \
|
||||||
|
@semantic-release/release-notes-generator
|
||||||
|
- name: Semantic Release
|
||||||
|
run: |
|
||||||
|
npx semantic-release \
|
||||||
|
--branches ${{ gitea.refname }} \
|
||||||
|
--tag-format 'v${version}' \
|
||||||
|
--plugins @semantic-release/commit-analyzer,@semantic-release/release-notes-generator,@semantic-release/changelog,@semantic-release/git
|
||||||
|
env:
|
||||||
|
GIT_CREDENTIALS: ${{ secrets.GIT_USERNAME }}:${{ secrets.GIT_APIKEY }}
|
27
CHANGELOG.md
Normal file
27
CHANGELOG.md
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
# [1.3.0](http://gitea.gitea.svc.cluster.local:3000/djpbessems/ContainerImage.PackerExtended/compare/v1.2.0...v1.3.0) (2024-06-06)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* Add helm binary (required for helm package action) ([c32a19a](http://gitea.gitea.svc.cluster.local:3000/djpbessems/ContainerImage.PackerExtended/commit/c32a19ab36378ae7263054035ceabfc0510e589e))
|
||||||
|
|
||||||
|
# [1.2.0](http://gitea.gitea.svc.cluster.local:3000/djpbessems/ContainerImage.PackerExtended/compare/v1.1.0...v1.2.0) (2024-06-06)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* Add unzip (required for packer action) ([3134776](http://gitea.gitea.svc.cluster.local:3000/djpbessems/ContainerImage.PackerExtended/commit/31347764ae36478ddbb89735656cb044e6931276))
|
||||||
|
|
||||||
|
# [1.1.0](http://gitea.gitea.svc.cluster.local:3000/djpbessems/ContainerImage.PackerExtended/compare/v1.0.0...v1.1.0) (2024-06-06)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* Add nodejs (prereq for majority of actions) ([29e242c](http://gitea.gitea.svc.cluster.local:3000/djpbessems/ContainerImage.PackerExtended/commit/29e242c30c037a4e1f7102370b97b25d7f926c34))
|
||||||
|
|
||||||
|
# 1.0.0 (2024-06-05)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* Initial release w/ semantic release ([dda78b7](http://gitea.gitea.svc.cluster.local:3000/djpbessems/ContainerImage.PackerExtended/commit/dda78b733498b8cc1d48e96dc5630554828e6d62))
|
61
Dockerfile
61
Dockerfile
@@ -11,33 +11,48 @@ ARG REPO_PASSWORD
|
|||||||
ADD https://${REPO_USERNAME}:${REPO_PASSWORD}@sn.itch.fyi/Repository/bin/VMware/ovftool/4.4.x/${OVFTOOL_INSTALLER} /tmp/ovftool-installer
|
ADD https://${REPO_USERNAME}:${REPO_PASSWORD}@sn.itch.fyi/Repository/bin/VMware/ovftool/4.4.x/${OVFTOOL_INSTALLER} /tmp/ovftool-installer
|
||||||
|
|
||||||
RUN apk --update add --no-cache \
|
RUN apk --update add --no-cache \
|
||||||
curl && \
|
curl \
|
||||||
curl -L https://packages.microsoft.com/config/debian/10/packages-microsoft-prod.deb -o /tmp/packages-microsoft-prod.deb
|
jq && \
|
||||||
|
curl -L https://api.github.com/repos/helm/helm/releases/latest | \
|
||||||
|
jq -r '.tag_name' | \
|
||||||
|
xargs -I {} curl -L -o /tmp/helm.tar.gz https://get.helm.sh/helm-{}-linux-amd64.tar.gz && \
|
||||||
|
tar -xzf /tmp/helm.tar.gz --strip-components=1 -C /tmp && \
|
||||||
|
curl -L https://api.github.com/repos/mikefarah/yq/releases/latest | \
|
||||||
|
jq -r '.assets[] | select(.name | endswith("yq_linux_amd64")) | .browser_download_url' | \
|
||||||
|
xargs -I {} curl -L -o /tmp/yq {} && \
|
||||||
|
chmod +x /tmp/yq
|
||||||
|
|
||||||
FROM ruby:slim
|
FROM debian:11-slim
|
||||||
|
|
||||||
COPY --from=packer /bin/packer /bin/packer
|
COPY --from=packer /bin/packer /bin/packer
|
||||||
COPY --from=terraform /bin/terraform /bin/terraform
|
COPY --from=terraform /bin/terraform /bin/terraform
|
||||||
COPY --from=download /tmp/packages-microsoft-prod.deb /tmp/packages-microsoft-prod.deb
|
|
||||||
COPY --from=download /tmp/ovftool-installer /tmp/ovftool-installer
|
COPY --from=download /tmp/ovftool-installer /tmp/ovftool-installer
|
||||||
|
COPY --from=download /tmp/yq /bin/yq
|
||||||
|
COPY --from=download /tmp/helm /usr/bin/helm
|
||||||
|
|
||||||
ENV LANG en_US.UTF-8
|
ENV LANG en_US.UTF-8
|
||||||
ENV LANGUAGE en_US:en
|
ENV LANGUAGE en_US:en
|
||||||
ENV LC_ALL en_US.UTF-8
|
ENV LC_ALL en_US.UTF-8
|
||||||
|
|
||||||
RUN dpkg -i /tmp/packages-microsoft-prod.deb && \
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
rm -f /tmp/packages-microsoft-prod.deb && \
|
apt-transport-https \
|
||||||
|
ca-certificates \
|
||||||
|
curl \
|
||||||
|
gnupg && \
|
||||||
|
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o /usr/share/keyrings/microsoft.gpg && \
|
||||||
|
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/microsoft.gpg] https://packages.microsoft.com/repos/microsoft-debian-bullseye-prod bullseye main" > /etc/apt/sources.list.d/microsoft.list && \
|
||||||
apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends \
|
apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends \
|
||||||
# (build-essential) Dependency for installation of InSpec
|
# (build-essential) Dependency for installation of InSpec
|
||||||
build-essential \
|
build-essential \
|
||||||
curl \
|
|
||||||
git \
|
git \
|
||||||
jq \
|
jq \
|
||||||
# (locales) Dependency for InSpec
|
|
||||||
locales \
|
locales \
|
||||||
|
make \
|
||||||
netcat-openbsd \
|
netcat-openbsd \
|
||||||
|
# (npm) Dependency for Gitea Actions
|
||||||
|
npm \
|
||||||
openssh-client \
|
openssh-client \
|
||||||
powershell \
|
powershell-lts \
|
||||||
# (python3-*) Dependency for installation of Ansible
|
# (python3-*) Dependency for installation of Ansible
|
||||||
python3-pip \
|
python3-pip \
|
||||||
python3-setuptools \
|
python3-setuptools \
|
||||||
@@ -46,25 +61,39 @@ RUN dpkg -i /tmp/packages-microsoft-prod.deb && \
|
|||||||
qemu-utils \
|
qemu-utils \
|
||||||
# (sshpass) Dependency for Packer (non-interactive password authentication)
|
# (sshpass) Dependency for Packer (non-interactive password authentication)
|
||||||
sshpass \
|
sshpass \
|
||||||
|
# (unzip) Dependency for Gitea Actions
|
||||||
|
unzip \
|
||||||
# (xorriso) Dependency for Packer (generating isofs image)
|
# (xorriso) Dependency for Packer (generating isofs image)
|
||||||
xorriso \
|
xorriso \
|
||||||
yamllint && \
|
yamllint && \
|
||||||
sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
|
sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
|
||||||
locale-gen && \
|
locale-gen && \
|
||||||
curl https://omnitruck.chef.io/install.sh | bash -s -- -P inspec && \
|
npm install npm@latest -g && \
|
||||||
gem update --system && gem update && \
|
npm install n -g && \
|
||||||
|
n latest && \
|
||||||
pip3 install --upgrade pip && \
|
pip3 install --upgrade pip && \
|
||||||
pip3 install ansible-core && \
|
pip3 install \
|
||||||
pwsh -Command "Set-PSRepository -Name 'PSGallery' -InstallationPolicy 'Trusted' -Verbose" && \
|
ansible-core~=2.14.0 \
|
||||||
pwsh -Command "Install-Module -Name 'powershell-yaml','VMware.PowerCLI' -Verbose" && \
|
# (jmespath) Dependency for Ansible 'json_query' filter
|
||||||
|
jmespath \
|
||||||
|
# (netaddr) Dependency for Ansible 'ipaddr' filter
|
||||||
|
netaddr \
|
||||||
|
# (pyvmomi & requests) Dependency for Ansible 'vmware_guest' module
|
||||||
|
pyvmomi \
|
||||||
|
requests && \
|
||||||
|
update-ca-certificates --fresh && \
|
||||||
|
pwsh -Command "Set-PSRepository -Name 'PSGallery' -InstallationPolicy 'Trusted'" && \
|
||||||
|
pwsh -Command "Install-Module -Name 'powershell-yaml','VMware.PowerCLI'" && \
|
||||||
pwsh -Command "Set-PowerCLIConfiguration -Scope User -ParticipateInCEIP \$False -Confirm:\$False" && \
|
pwsh -Command "Set-PowerCLIConfiguration -Scope User -ParticipateInCEIP \$False -Confirm:\$False" && \
|
||||||
sh /tmp/ovftool-installer --console --eulas-agreed --required && \
|
sh /tmp/ovftool-installer --console --eulas-agreed --required && \
|
||||||
apt-get remove -y \
|
apt-get remove -y \
|
||||||
|
apt-transport-https \
|
||||||
build-essential \
|
build-essential \
|
||||||
curl && \
|
# ca-certificates \
|
||||||
|
gnupg && \
|
||||||
apt-get autoremove -y && \
|
apt-get autoremove -y && \
|
||||||
rm -rf /var/lib/apt/lists/* && \
|
rm -rf /var/lib/apt/lists/* && \
|
||||||
rm -f /tmp/ovftool-installer
|
rm -f /tmp/ovftool-installer
|
||||||
|
|
||||||
ENTRYPOINT []
|
ENTRYPOINT []
|
||||||
CMD []
|
CMD []
|
||||||
|
6814
package-lock.json
generated
Normal file
6814
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
9
package.json
Normal file
9
package.json
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"dependencies": {
|
||||||
|
"@semantic-release/changelog": "^6.0.3",
|
||||||
|
"@semantic-release/commit-analyzer": "^13.0.0",
|
||||||
|
"@semantic-release/git": "^10.0.1",
|
||||||
|
"@semantic-release/release-notes-generator": "^14.0.0",
|
||||||
|
"semantic-release": "^24.0.0"
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user