Add semantic-release prerequisites
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Danny Bessems 2023-05-20 12:48:40 +02:00
parent 68445ee13f
commit 6d168f0517

View File

@ -38,162 +38,168 @@ steps:
image: bv11-cr01.bessems.eu/proxy/library/node:20-slim image: bv11-cr01.bessems.eu/proxy/library/node:20-slim
pull: always pull: always
commands: commands:
- |
apt-get update
- |
apt-get install -y --no-install-recommends \
git-core \
ca-certificates
- | - |
npm install semantic-release npm install semantic-release
- | - |
npx semantic-release --dry-run npx semantic-release --dry-run
- name: Install Ansible Galaxy collections # - name: Install Ansible Galaxy collections
depends_on: # depends_on:
- Semantic Release (Dry-run) # - Semantic Release (Dry-run)
image: bv11-cr01.bessems.eu/library/packer-extended # image: bv11-cr01.bessems.eu/library/packer-extended
pull: always # pull: always
commands: # commands:
- | # - |
ansible-galaxy collection install \ # ansible-galaxy collection install \
-r ansible/requirements.yml \ # -r ansible/requirements.yml \
-p ./ansible/collections # -p ./ansible/collections
volumes: # volumes:
- name: scratch # - name: scratch
path: /scratch # path: /scratch
- name: Kubernetes Bootstrap Appliance # - name: Kubernetes Bootstrap Appliance
depends_on: # depends_on:
- Install Ansible Galaxy collections # - Install Ansible Galaxy collections
image: bv11-cr01.bessems.eu/library/packer-extended # image: bv11-cr01.bessems.eu/library/packer-extended
pull: always # pull: always
commands: # commands:
- | # - |
sed -i -e "s/<<img-password>>/$${SSH_PASSWORD}/g" \ # sed -i -e "s/<<img-password>>/$${SSH_PASSWORD}/g" \
packer/preseed/UbuntuServer22.04/user-data # packer/preseed/UbuntuServer22.04/user-data
- | # - |
export K8S_VERSION=$(yq '.components.clusterapi.workload.version.k8s' < ./ansible/vars/metacluster.yml) # export K8S_VERSION=$(yq '.components.clusterapi.workload.version.k8s' < ./ansible/vars/metacluster.yml)
- | # - |
packer init -upgrade \ # packer init -upgrade \
./packer # ./packer
- | # - |
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=${DRONE_BUILD_NUMBER}-${DRONE_COMMIT_SHA:0:10}-$(openssl rand -hex 3) \
-var docker_username=$${DOCKER_USERNAME} \ # -var docker_username=$${DOCKER_USERNAME} \
-var docker_password=$${DOCKER_PASSWORD} \ # -var docker_password=$${DOCKER_PASSWORD} \
-var repo_username=$${REPO_USERNAME} \ # -var repo_username=$${REPO_USERNAME} \
-var repo_password=$${REPO_PASSWORD} \ # -var repo_password=$${REPO_PASSWORD} \
-var ssh_password=$${SSH_PASSWORD} \ # -var ssh_password=$${SSH_PASSWORD} \
-var vsphere_password=$${VSPHERE_PASSWORD} \ # -var vsphere_password=$${VSPHERE_PASSWORD} \
-var k8s_version=$K8S_VERSION \ # -var k8s_version=$K8S_VERSION \
./packer # ./packer
- | # - |
packer build \ # packer build \
-on-error=cleanup -timestamp-ui \ # -on-error=cleanup -timestamp-ui \
-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=${DRONE_BUILD_NUMBER}-${DRONE_COMMIT_SHA:0:10}-$(openssl rand -hex 3) \
-var docker_username=$${DOCKER_USERNAME} \ # -var docker_username=$${DOCKER_USERNAME} \
-var docker_password=$${DOCKER_PASSWORD} \ # -var docker_password=$${DOCKER_PASSWORD} \
-var repo_username=$${REPO_USERNAME} \ # -var repo_username=$${REPO_USERNAME} \
-var repo_password=$${REPO_PASSWORD} \ # -var repo_password=$${REPO_PASSWORD} \
-var ssh_password=$${SSH_PASSWORD} \ # -var ssh_password=$${SSH_PASSWORD} \
-var vsphere_password=$${VSPHERE_PASSWORD} \ # -var vsphere_password=$${VSPHERE_PASSWORD} \
-var k8s_version=$K8S_VERSION \ # -var k8s_version=$K8S_VERSION \
./packer # ./packer
environment: # environment:
DOCKER_USERNAME: # DOCKER_USERNAME:
from_secret: docker_username # from_secret: docker_username
DOCKER_PASSWORD: # DOCKER_PASSWORD:
from_secret: docker_password # from_secret: docker_password
# PACKER_LOG: 1 # # PACKER_LOG: 1
REPO_USERNAME: # REPO_USERNAME:
from_secret: repo_username # from_secret: repo_username
REPO_PASSWORD: # REPO_PASSWORD:
from_secret: repo_password # from_secret: repo_password
SSH_PASSWORD: # SSH_PASSWORD:
from_secret: ssh_password # from_secret: ssh_password
VSPHERE_PASSWORD: # VSPHERE_PASSWORD:
from_secret: vsphere_password # from_secret: vsphere_password
volumes: # volumes:
- name: output # - name: output
path: /output # path: /output
- name: scratch # - name: scratch
path: /scratch # path: /scratch
- name: Kubernetes Upgrade Appliance # - name: Kubernetes Upgrade Appliance
depends_on: # depends_on:
- Install Ansible Galaxy collections # - Install Ansible Galaxy collections
image: bv11-cr01.bessems.eu/library/packer-extended # image: bv11-cr01.bessems.eu/library/packer-extended
pull: alwaysquery( # pull: alwaysquery(
commands: # commands:
- | # - |
sed -i -e "s/<<img-password>>/$${SSH_PASSWORD}/g" \ # sed -i -e "s/<<img-password>>/$${SSH_PASSWORD}/g" \
packer/preseed/UbuntuServer22.04/user-data # packer/preseed/UbuntuServer22.04/user-data
- | # - |
export K8S_VERSION=$(yq '.components.clusterapi.workload.version.k8s' < ./ansible/vars/metacluster.yml) # export K8S_VERSION=$(yq '.components.clusterapi.workload.version.k8s' < ./ansible/vars/metacluster.yml)
- | # - |
packer init -upgrade \ # packer init -upgrade \
./packer # ./packer
- | # - |
packer validate \ # packer validate \
-only=vsphere-iso.upgrade \ # -only=vsphere-iso.upgrade \
-var vm_name=${DRONE_BUILD_NUMBER}-${DRONE_COMMIT_SHA:0:10}-$(openssl rand -hex 3) \ # -var vm_name=${DRONE_BUILD_NUMBER}-${DRONE_COMMIT_SHA:0:10}-$(openssl rand -hex 3) \
-var docker_username=$${DOCKER_USERNAME} \ # -var docker_username=$${DOCKER_USERNAME} \
-var docker_password=$${DOCKER_PASSWORD} \ # -var docker_password=$${DOCKER_PASSWORD} \
-var repo_username=$${REPO_USERNAME} \ # -var repo_username=$${REPO_USERNAME} \
-var repo_password=$${REPO_PASSWORD} \ # -var repo_password=$${REPO_PASSWORD} \
-var ssh_password=$${SSH_PASSWORD} \ # -var ssh_password=$${SSH_PASSWORD} \
-var vsphere_password=$${VSPHERE_PASSWORD} \ # -var vsphere_password=$${VSPHERE_PASSWORD} \
-var k8s_version=$K8S_VERSION \ # -var k8s_version=$K8S_VERSION \
./packer # ./packer
- | # - |
packer build \ # packer build \
-on-error=cleanup -timestamp-ui \ # -on-error=cleanup -timestamp-ui \
-only=vsphere-iso.upgrade \ # -only=vsphere-iso.upgrade \
-var vm_name=${DRONE_BUILD_NUMBER}-${DRONE_COMMIT_SHA:0:10}-$(openssl rand -hex 3) \ # -var vm_name=${DRONE_BUILD_NUMBER}-${DRONE_COMMIT_SHA:0:10}-$(openssl rand -hex 3) \
-var docker_username=$${DOCKER_USERNAME} \ # -var docker_username=$${DOCKER_USERNAME} \
-var docker_password=$${DOCKER_PASSWORD} \ # -var docker_password=$${DOCKER_PASSWORD} \
-var repo_username=$${REPO_USERNAME} \ # -var repo_username=$${REPO_USERNAME} \
-var repo_password=$${REPO_PASSWORD} \ # -var repo_password=$${REPO_PASSWORD} \
-var ssh_password=$${SSH_PASSWORD} \ # -var ssh_password=$${SSH_PASSWORD} \
-var vsphere_password=$${VSPHERE_PASSWORD} \ # -var vsphere_password=$${VSPHERE_PASSWORD} \
-var k8s_version=$K8S_VERSION \ # -var k8s_version=$K8S_VERSION \
./packer # ./packer
environment: # environment:
DOCKER_USERNAME: # DOCKER_USERNAME:
from_secret: docker_username # from_secret: docker_username
DOCKER_PASSWORD: # DOCKER_PASSWORD:
from_secret: docker_password # from_secret: docker_password
# PACKER_LOG: 1 # # PACKER_LOG: 1
REPO_USERNAME: # REPO_USERNAME:
from_secret: repo_username # from_secret: repo_username
REPO_PASSWORD: # REPO_PASSWORD:
from_secret: repo_password # from_secret: repo_password
SSH_PASSWORD: # SSH_PASSWORD:
from_secret: ssh_password # from_secret: ssh_password
VSPHERE_PASSWORD: # VSPHERE_PASSWORD:
from_secret: vsphere_password # from_secret: vsphere_password
volumes: # volumes:
- name: output # - name: output
path: /output # path: /output
- name: scratch # - name: scratch
path: /scratch # path: /scratch
- name: Remove temporary resources # - name: Remove temporary resources
depends_on: # depends_on:
- Kubernetes Bootstrap Appliance # - Kubernetes Bootstrap Appliance
- Kubernetes Upgrade Appliance # - Kubernetes Upgrade Appliance
image: bv11-cr01.bessems.eu/library/packer-extended # image: bv11-cr01.bessems.eu/library/packer-extended
commands: # commands:
- | # - |
pwsh -file scripts/Remove-Resources.ps1 \ # pwsh -file scripts/Remove-Resources.ps1 \
-VMName $DRONE_BUILD_NUMBER-${DRONE_COMMIT_SHA:0:10} \ # -VMName $DRONE_BUILD_NUMBER-${DRONE_COMMIT_SHA:0:10} \
-VSphereFQDN 'bv11-vc.bessems.lan' \ # -VSphereFQDN 'bv11-vc.bessems.lan' \
-VSphereUsername 'administrator@vsphere.local' \ # -VSphereUsername 'administrator@vsphere.local' \
-VSpherePassword $${VSPHERE_PASSWORD} # -VSpherePassword $${VSPHERE_PASSWORD}
environment: # environment:
VSPHERE_PASSWORD: # VSPHERE_PASSWORD:
from_secret: vsphere_password # from_secret: vsphere_password
volumes: # volumes:
- name: scratch # - name: scratch
path: /scratch # path: /scratch
when: # when:
status: # status:
- success # - success
- failure # - failure