Skip to content

Commit

Permalink
Merge pull request #1813 from habitat-sh/jah/CHEF-13373_ci-pipeline-m…
Browse files Browse the repository at this point in the history
…odifications

CHEF-13373: CI Pipeline modifications for multichannel support (builder)
  • Loading branch information
jasonheath authored Jul 19, 2024
2 parents 1846817 + 524a383 commit 0f3e756
Show file tree
Hide file tree
Showing 26 changed files with 148 additions and 1,087 deletions.
50 changes: 50 additions & 0 deletions .github/actions/hab-install-linux/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Habitat Install and Setup for Linux
description: Install Habitat via curl bash on linux hosts
inputs:
hab-auth-token:
description: The HAB_AUTH_TOKEN to be used
required: true
hab-origin:
description: The Habitat Origin to be used
required: true
curl-bash-url:
description: URL for the habitat curl bash script
required: true
default: 'https://raw.githubusercontent.com/habitat-sh/habitat/master/components/hab/install.sh'
habitat-version:
description: Which version of habitat to use
required: true
default: latest
habitat-target:
description: Which architecture to target
required: true
default: x86_64-linux
runs:
using: composite
steps:

- name: install hab binary
shell: bash
env:
URL: ${{ inputs.curl-bash-url }}
VERSION: ${{ inputs.habitat-version }}
TARGET: ${{ inputs.habitat-target }}
run: |
curl "$URL" | sudo bash -s -- -v "$VERSION" -t "$TARGET"
- name: accept hab license
shell: bash
run: |
hab license accept
sudo hab license accept
- name: download hab keys
shell: bash
env:
HAB_ORIGIN: ${{ inputs.hab-origin }}
HAB_AUTH_TOKEN: ${{ inputs.hab-auth-token }}
run: |
hab origin key download $HAB_ORIGIN
hab origin key download $HAB_ORIGIN --auth $HAB_AUTH_TOKEN --secret
sudo hab origin key download $HAB_ORIGIN
sudo hab origin key download $HAB_ORIGIN --auth $HAB_AUTH_TOKEN --secret
35 changes: 35 additions & 0 deletions .github/actions/hab-pkg-build-and-upload-linux/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Habitat Package Build, Install, and Upload
description: Builds a Habitat Package and uploads it
inputs:
hab-auth-token:
description: The HAB_AUTH_TOKEN to be usAd
required: true
bldr-component:
description: The Builder Component to build and package
required: true
runs:
using: composite
steps:

- name: hab pkg build
shell: bash
env:
BLDR_COMPONENT: ${{ inputs.bldr-component }}
run: |
hab pkg build $BLDR_COMPONENT
- name: hab pkg install
shell: bash
env:
HAB_AUTH_TOKEN: ${{ inputs.hab-auth-token }}
run: |
source results/last_build.env
sudo hab pkg install --auth $HAB_AUTH_TOKEN results/$pkg_artifact
- name: hab pkg upload
shell: bash
env:
HAB_AUTH_TOKEN: ${{ inputs.hab-auth-token }}
run: |
source results/last_build.env
hab pkg upload --auth $HAB_AUTH_TOKEN results/$pkg_artifact
63 changes: 63 additions & 0 deletions .github/workflows/hab-pkg-build-upload.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Publish Habitat Packages

on:
push:
branches:
- main

env:
BLDR_URL: 'https://bldr.habitat.sh/'
HAB_ORIGIN: 'habitat'
HAB_AUTH_TOKEN: ${{ secrets.HAB_AUTH_TOKEN }}
HABITAT_VERSION_SET: 'latest'

permissions:
contents: write

jobs:

changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
components: ${{ steps.filter.outputs.changes }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
builder-memcached:
- 'components/builder-memcached/**'
builder-minio:
- 'components/builder-minio/**'
builder-datastore:
- 'components/builder-datastore/**'
builder-api:
- 'components/builder-api/**'
builder-api-proxy:
- 'components/builder-api-proxy/**'
habitat-packaging:
needs: changes
if: ${{ needs.changes.outputs.components != '[]' && needs.changes.outputs.components != '' }}
name: ${{matrix.components}}
strategy:
fail-fast: false
matrix:
components: ${{ fromJSON(needs.changes.outputs.components) }}
runs-on: ubuntu-latest
steps:
- name: Checkout for ${{matrix.components}}
uses: actions/checkout@v4
- name: Install Habitat for ${{matrix.components}}
uses: ./.github/actions/hab-install-linux
with:
hab-auth-token: ${{ env.HAB_AUTH_TOKEN }}
hab-origin: ${{ env.HAB_ORIGIN }}
- name: Build and Upload Habitat Package for ${{matrix.components}}
uses: ./.github/actions/hab-pkg-build-and-upload-linux
with:
hab-auth-token: ${{ env.HAB_AUTH_TOKEN }}
bldr-component: components/${{matrix.components}}
2 changes: 0 additions & 2 deletions components/builder-web/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ assets/app.css.map
assets/app.js
assets/app.js.map
assets/habitat.conf.js
cypress/screenshots
cypress/videos
/habitat.conf.js
node_modules
npm-debug.log*
Expand Down
4 changes: 0 additions & 4 deletions components/builder-web/cypress.json

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

6 changes: 0 additions & 6 deletions components/builder-web/cypress/fixtures/search/none.json

This file was deleted.

Loading

0 comments on commit 0f3e756

Please sign in to comment.