Skip to content

Commit

Permalink
Inline all the versions into the default branch (#194)
Browse files Browse the repository at this point in the history
This takes all the version-specific branches and inline them into the
default branch, as they are.

This also prepares a placeholder for the upcoming v1.7 version which has
beta versions since a few days ago.

Several things are now paths-triggered:

* The build system will only trigger if the related paths have been
  changed.
* Renovate will trigger specific version updates based on the paths too.
* Versions <1.2.x are not updated/built anymore (it's already the case
  from before).

The build system is also now based on buildx, to prepare for the ARM
builds coming soon.
  • Loading branch information
multani authored Nov 6, 2023
1 parent ba07bce commit 4a2040e
Show file tree
Hide file tree
Showing 38 changed files with 1,815 additions and 132 deletions.
37 changes: 27 additions & 10 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@

"baseBranches": [
"master",
"branch-1.2.x",
"branch-1.3.x",
"branch-1.4.x",
"branch-1.5.x",
],

"regexManagers": [
Expand All @@ -19,31 +15,52 @@
},
],

// These versions are not updated anymore.
"ignorePaths": [
"v0.9.x/**",
"v0.10.x/**",
"v0.11.x/**",
"v0.12.x/**",
"v1.0.x/**",
"v1.1.x/**",
],

"packageRules": [
{
"matchBaseBranches": ["master"],
"matchFileNames": ["latest/**"],
"matchPackageNames": ["hashicorp/nomad"],
"ignoreUnstable": false,
"groupName": "nomad-latest",
},
{
"matchBaseBranches": ["branch-1.2.x"],
"matchFileNames": ["v1.2.x/**"],
"matchPackageNames": ["hashicorp/nomad"],
"allowedVersions": "<=1.2"
"allowedVersions": "<=1.2",
"groupName": "nomad-1.2.x",
},
{
"matchBaseBranches": ["branch-1.3.x"],
"matchFileNames": ["v1.3.x/**"],
"matchPackageNames": ["hashicorp/nomad"],
"allowedVersions": "<=1.3",
"groupName": "nomad-1.3.x",
},
{
"matchBaseBranches": ["branch-1.4.x"],
"matchFileNames": ["v1.4.x/**"],
"matchPackageNames": ["hashicorp/nomad"],
"allowedVersions": "<=1.4",
"groupName": "nomad-1.4.x",
},
{
"matchBaseBranches": ["branch-1.5.x"],
"matchFileNames": ["v1.5.x/**"],
"matchPackageNames": ["hashicorp/nomad"],
"allowedVersions": "<=1.5",
"groupName": "nomad-1.5.x",
},
{
"matchFileNames": ["v1.6.x/**"],
"matchPackageNames": ["hashicorp/nomad"],
"allowedVersions": "<=1.6",
"groupName": "nomad-1.6.x",
},
],
}
30 changes: 0 additions & 30 deletions .github/workflows/build.yml

This file was deleted.

91 changes: 0 additions & 91 deletions .github/workflows/deploy.yml

This file was deleted.

22 changes: 22 additions & 0 deletions .github/workflows/latest-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "Latest: build"

on:
push:
branches:
- master
paths:
- latest/**

pull_request:
branches:
- master
paths:
- latest/**

jobs:
test:
name: Test
uses: ./.github/workflows/template-build.yml
with:
platforms: linux/amd64
directory: latest
56 changes: 56 additions & 0 deletions .github/workflows/template-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# This builds the Docker image from the specified directory on all the
# platforms and do a basic sanity check to verify that Nomad runs.
name: Build

on:
workflow_call:
inputs:
directory:
description: Directory where the Dockerfile is
required: true
type: string

platforms:
description: The platforms to build on
required: true
type: string

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Metadata
id: meta
working-directory: ${{ inputs.directory }}
run: |
echo "dockerfile=${{ inputs.directory }}/Dockerfile" >> "$GITHUB_OUTPUT"
- name: Lint the Dockerfile
uses: hadolint/[email protected]
with:
dockerfile: ${{ steps.meta.outputs.dockerfile }}

- name: Set up QEMU
id: docker-setup
uses: docker/setup-qemu-action@v3
with:
platforms: ${{ inputs.platforms }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build
uses: docker/build-push-action@v5
with:
context: ${{ inputs.directory }}
file: ${{ steps.meta.outputs.dockerfile }}
load: true # load the image built locally for later use
platforms: ${{ inputs.platforms }}
push: false
tags: local/nomad:test

- name: Test
run: make test DOCKER_TAG=local/nomad:test
22 changes: 22 additions & 0 deletions .github/workflows/v1.2.x-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "v1.3.x: build"

on:
push:
branches:
- master
paths:
- v1.3.x/**

pull_request:
branches:
- master
paths:
- v1.3.x/**

jobs:
test:
name: Test
uses: ./.github/workflows/template-build.yml
with:
platforms: linux/amd64
directory: v1.3.x
22 changes: 22 additions & 0 deletions .github/workflows/v1.3.x-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "v1.3.x: build"

on:
push:
branches:
- master
paths:
- v1.3.x/**

pull_request:
branches:
- master
paths:
- v1.3.x/**

jobs:
test:
name: Test
uses: ./.github/workflows/template-build.yml
with:
platforms: linux/amd64
directory: v1.3.x
22 changes: 22 additions & 0 deletions .github/workflows/v1.4.x-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "v1.4.x: build"

on:
push:
branches:
- master
paths:
- v1.4.x/**

pull_request:
branches:
- master
paths:
- v1.4.x/**

jobs:
test:
name: Test
uses: ./.github/workflows/template-build.yml
with:
platforms: linux/amd64
directory: v1.4.x
22 changes: 22 additions & 0 deletions .github/workflows/v1.5.x-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "v1.5.x: build"

on:
push:
branches:
- master
paths:
- v1.5.x/**

pull_request:
branches:
- master
paths:
- v1.5.x/**

jobs:
test:
name: Test
uses: ./.github/workflows/template-build.yml
with:
platforms: linux/amd64
directory: v1.5.x
22 changes: 22 additions & 0 deletions .github/workflows/v1.6.x-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "v1.6.x: build"

on:
push:
branches:
- master
paths:
- v1.6.x/**

pull_request:
branches:
- master
paths:
- v1.6.x/**

jobs:
test:
name: Test
uses: ./.github/workflows/template-build.yml
with:
platforms: linux/amd64
directory: v1.6.x
Loading

0 comments on commit 4a2040e

Please sign in to comment.