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
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
distros: ${{ steps.distros.outputs.distros }}
|
distros: ${{ steps.distros.outputs.distros }}
|
||||||
|
build: ${{ steps.time.outputs.time }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Discover boxes
|
- name: Discover boxes
|
||||||
@@ -22,6 +23,11 @@ jobs:
|
|||||||
set -eo pipefail
|
set -eo pipefail
|
||||||
distros=$(ls distros/*.hcl{,.sh} | jq -cRs 'split("\n") | [ .[] | if length > 0 then . else empty end ]')
|
distros=$(ls distros/*.hcl{,.sh} | jq -cRs 'split("\n") | [ .[] | if length > 0 then . else empty end ]')
|
||||||
echo "::set-output name=distros::${distros}"
|
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:
|
build:
|
||||||
name: Build box
|
name: Build box
|
||||||
@@ -64,7 +70,7 @@ jobs:
|
|||||||
# Strip .sh if it is a dynamic one
|
# Strip .sh if it is a dynamic one
|
||||||
file="$(printf "${{ matrix.distro }}" | sed -E -e 's/^(.*).sh$/\1/')"
|
file="$(printf "${{ matrix.distro }}" | sed -E -e 's/^(.*).sh$/\1/')"
|
||||||
# Add a retry in case something bogus like a network failure happens
|
# 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:
|
env:
|
||||||
VAGRANT_CLOUD_TOKEN: ${{ secrets.VAGRANT_CLOUD_TOKEN }}
|
VAGRANT_CLOUD_TOKEN: ${{ secrets.VAGRANT_CLOUD_TOKEN }}
|
||||||
PACKER_LOG: ${{ contains(matrix.needs_timeout, matrix.distro) && '0' || '0' }}
|
PACKER_LOG: ${{ contains(matrix.needs_timeout, matrix.distro) && '0' || '0' }}
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@ output_*
|
|||||||
*.box
|
*.box
|
||||||
*.iso
|
*.iso
|
||||||
.vagrant
|
.vagrant
|
||||||
serial-output
|
serial-output*
|
||||||
grub.cfg
|
grub.cfg
|
||||||
isolinux.cfg
|
isolinux.cfg
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,8 @@
|
|||||||
enabled: true
|
enabled: true
|
||||||
loop: "{{ virtualbox_services }}"
|
loop: "{{ virtualbox_services }}"
|
||||||
|
|
||||||
- when: virtualbox_from_iso
|
- name: Run commands to install from ISO
|
||||||
|
when: virtualbox_from_iso
|
||||||
block:
|
block:
|
||||||
- name: Mount iso file
|
- name: Mount iso file
|
||||||
become: true
|
become: true
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ build {
|
|||||||
name = "upload"
|
name = "upload"
|
||||||
access_token = var.vagrant_cloud_token
|
access_token = var.vagrant_cloud_token
|
||||||
box_tag = "boxen/${local.name}"
|
box_tag = "boxen/${local.name}"
|
||||||
version = local.build
|
version = var.build
|
||||||
version_description = local.description
|
version_description = local.description
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,14 +44,18 @@ variable "vagrant_cloud_token" {
|
|||||||
default = env("VAGRANT_CLOUD_TOKEN")
|
default = env("VAGRANT_CLOUD_TOKEN")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "build" {
|
||||||
|
type = string
|
||||||
|
default = "0.1"
|
||||||
|
}
|
||||||
|
|
||||||
locals {
|
locals {
|
||||||
name = "${var.distro}-${var.version}-${var.arch}"
|
name = "${var.distro}-${var.version}-${var.arch}"
|
||||||
build = formatdate("YYYYMMDDhh", timestamp())
|
|
||||||
description = templatefile("../README.box.md", {
|
description = templatefile("../README.box.md", {
|
||||||
distro = var.distro
|
distro = var.distro
|
||||||
arch = var.arch
|
arch = var.arch
|
||||||
version = var.version
|
version = var.version
|
||||||
build = local.build
|
build = var.build
|
||||||
})
|
})
|
||||||
|
|
||||||
cpus = 2
|
cpus = 2
|
||||||
|
|||||||
Reference in New Issue
Block a user