build: Push to correct registry & Housekeeping
This commit is contained in:
parent
752f46a358
commit
8af7c465bb
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
|
|
@ -43,7 +43,7 @@ jobs:
|
|||||||
echo 'Release tag set correctly: ${{ steps.sem_rel.outputs.version }}'; exit 0
|
echo 'Release tag set correctly: ${{ steps.sem_rel.outputs.version }}'; exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
build-image:
|
build_image:
|
||||||
name: Container image
|
name: Container image
|
||||||
runs-on: dind
|
runs-on: dind
|
||||||
needs: semrel_dryrun
|
needs: semrel_dryrun
|
||||||
@ -51,10 +51,11 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Check out repository code
|
- name: Check out repository code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: Install QEMU
|
- name: Set up qemu
|
||||||
run: |
|
uses: docker/setup-qemu-action@v3
|
||||||
sudo apt-get update
|
# run: |
|
||||||
sudo apt-get install -y qemu-user-static
|
# sudo apt-get update
|
||||||
|
# sudo apt-get install -y qemu-user-static
|
||||||
- name: Create builder context
|
- name: Create builder context
|
||||||
id: buildx-context
|
id: buildx-context
|
||||||
run: |
|
run: |
|
||||||
@ -79,14 +80,14 @@ jobs:
|
|||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: code.spamasaurus.com
|
registry: code.spamasaurus.com
|
||||||
username: ${{ gitea.actor }}
|
username: ${{ secrets.GIT_USERNAME }}
|
||||||
password: ${{ secrets.GIT_APIKEY }}
|
password: ${{ secrets.GIT_APIKEY }}
|
||||||
- name: Build & push container image
|
- name: Build & push container image
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
push: true
|
push: true
|
||||||
context: .
|
context: .
|
||||||
tags: djpbessems/packer-extended:${{ needs.semrel_dryrun.outputs.version }}
|
tags: code.spamasaurus.com/djpbessems/packer-extended:${{ needs.semrel_dryrun.outputs.version }}
|
||||||
build-args: |
|
build-args: |
|
||||||
REPO_USERNAME=${{ secrets.REPO_USERNAME }}
|
REPO_USERNAME=${{ secrets.REPO_USERNAME }}
|
||||||
REPO_PASSWORD=${{ secrets.REPO_PASSWORD }}
|
REPO_PASSWORD=${{ secrets.REPO_PASSWORD }}
|
||||||
@ -95,3 +96,31 @@ jobs:
|
|||||||
DOCKER_TLS_CERTDIR: "/certs"
|
DOCKER_TLS_CERTDIR: "/certs"
|
||||||
DOCKER_TLS_VERIFY: 1
|
DOCKER_TLS_VERIFY: 1
|
||||||
DOCKER_CERT_PATH: "/certs/client"
|
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 }}
|
||||||
|
@ -1,92 +0,0 @@
|
|||||||
name: Container
|
|
||||||
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: Setup 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_container:
|
|
||||||
name: Container image
|
|
||||||
# container: catthehacker/ubuntu:act-latest
|
|
||||||
# runs-on: dind
|
|
||||||
# needs: semrel_dryrun
|
|
||||||
# steps:
|
|
||||||
# - name: Checkout
|
|
||||||
# uses: actions/checkout@v4
|
|
||||||
# - name: Kaniko build
|
|
||||||
# uses: aevea/action-kaniko@master
|
|
||||||
# with:
|
|
||||||
# extra_args: |
|
|
||||||
# --build-arg REPO_USERNAME=${{ secrets.REPO_USERNAME }} \
|
|
||||||
# --build-arg REPO_PASSWORD=${{ secrets.REPO_PASSWORD }}
|
|
||||||
# registry: code.spamasaurus.com
|
|
||||||
# image: djpbessems/packer-extended
|
|
||||||
# username: ${{ secrets.GIT_USERNAME }}
|
|
||||||
# password: ${{ secrets.GIT_APIKEY }}
|
|
||||||
# tag: ${{ needs.semrel_dryrun.outputs.version }}
|
|
||||||
|
|
||||||
semrel:
|
|
||||||
name: Semantic Release
|
|
||||||
runs-on: dind-rootless
|
|
||||||
needs: build_container
|
|
||||||
steps:
|
|
||||||
- name: Check out repository code
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
- name: Setup 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 }}
|
|
@ -10,9 +10,6 @@ ARG REPO_USERNAME
|
|||||||
ARG REPO_PASSWORD
|
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 \
|
|
||||||
openssl && \
|
|
||||||
openssl s_client -connect api.github.com:443 -msg -tls1_2
|
|
||||||
RUN apk --update add --no-cache \
|
RUN apk --update add --no-cache \
|
||||||
curl \
|
curl \
|
||||||
jq && \
|
jq && \
|
||||||
@ -73,8 +70,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||||||
pyvmomi \
|
pyvmomi \
|
||||||
requests && \
|
requests && \
|
||||||
update-ca-certificates --fresh && \
|
update-ca-certificates --fresh && \
|
||||||
pwsh -Command "Set-PSRepository -Name 'PSGallery' -InstallationPolicy 'Trusted' -Verbose" && \
|
pwsh -Command "Set-PSRepository -Name 'PSGallery' -InstallationPolicy 'Trusted'" && \
|
||||||
pwsh -Command "Install-Module -Name 'powershell-yaml','VMware.PowerCLI' -Verbose" && \
|
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 \
|
||||||
|
Loading…
Reference in New Issue
Block a user