Unified Build Time
Unify build time for all runs in a single release Clean up Ansible and gitignores
This commit is contained in:
@@ -14,6 +14,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
distros: ${{ steps.distros.outputs.distros }}
|
||||
build: ${{ steps.time.outputs.time }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Discover boxes
|
||||
@@ -22,6 +23,11 @@ jobs:
|
||||
set -eo pipefail
|
||||
distros=$(ls distros/*.hcl{,.sh} | jq -cRs 'split("\n") | [ .[] | if length > 0 then . else empty end ]')
|
||||
echo "::set-output name=distros::${distros}"
|
||||
- name: Find timestamp for versioning
|
||||
id: time
|
||||
uses: nanzm/get-time-action@v1.1
|
||||
with:
|
||||
format: 'YYYY.MM.DD.HH'
|
||||
|
||||
build:
|
||||
name: Build box
|
||||
@@ -64,7 +70,7 @@ jobs:
|
||||
# Strip .sh if it is a dynamic one
|
||||
file="$(printf "${{ matrix.distro }}" | sed -E -e 's/^(.*).sh$/\1/')"
|
||||
# Add a retry in case something bogus like a network failure happens
|
||||
packer build -only="${{ matrix.builder }}" -var-file="${file}" -var "qemu_accelerator=tcg" ${{ github.event_name != 'release' && '-except=upload' || '' }} sources
|
||||
packer build -only="${{ matrix.builder }}" -var-file="${file}" -var "qemu_accelerator=tcg" -var "build=${{ needs.collect.outputs.build }}" ${{ github.event_name != 'release' && '-except=upload' || '' }} sources
|
||||
env:
|
||||
VAGRANT_CLOUD_TOKEN: ${{ secrets.VAGRANT_CLOUD_TOKEN }}
|
||||
PACKER_LOG: ${{ contains(matrix.needs_timeout, matrix.distro) && '0' || '0' }}
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ output_*
|
||||
*.box
|
||||
*.iso
|
||||
.vagrant
|
||||
serial-output
|
||||
serial-output*
|
||||
grub.cfg
|
||||
isolinux.cfg
|
||||
|
||||
|
||||
@@ -25,7 +25,8 @@
|
||||
enabled: true
|
||||
loop: "{{ virtualbox_services }}"
|
||||
|
||||
- when: virtualbox_from_iso
|
||||
- name: Run commands to install from ISO
|
||||
when: virtualbox_from_iso
|
||||
block:
|
||||
- name: Mount iso file
|
||||
become: true
|
||||
|
||||
@@ -34,7 +34,7 @@ build {
|
||||
name = "upload"
|
||||
access_token = var.vagrant_cloud_token
|
||||
box_tag = "boxen/${local.name}"
|
||||
version = local.build
|
||||
version = var.build
|
||||
version_description = local.description
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,14 +44,18 @@ variable "vagrant_cloud_token" {
|
||||
default = env("VAGRANT_CLOUD_TOKEN")
|
||||
}
|
||||
|
||||
variable "build" {
|
||||
type = string
|
||||
default = "0.1"
|
||||
}
|
||||
|
||||
locals {
|
||||
name = "${var.distro}-${var.version}-${var.arch}"
|
||||
build = formatdate("YYYYMMDDhh", timestamp())
|
||||
description = templatefile("../README.box.md", {
|
||||
distro = var.distro
|
||||
arch = var.arch
|
||||
version = var.version
|
||||
build = local.build
|
||||
build = var.build
|
||||
})
|
||||
|
||||
cpus = 2
|
||||
|
||||
Reference in New Issue
Block a user