Skip to content

Commit

Permalink
wip 1719941354
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Heath <jason.heath@progress.com>
  • Loading branch information
Jason Heath committed Jul 2, 2024
1 parent 74ccc6f commit 2596d84
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 83 deletions.
13 changes: 10 additions & 3 deletions .github/actions/hab-install-linux/action.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Habitat Install for Linux
name: Habitat Install and Setup for Linux
description: Install Habitat via curl bash on linux hosts
inputs:
curl-bash-url:
description: URL of the habitat curl bash script
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:
Expand All @@ -16,7 +16,7 @@ inputs:
runs:
using: composite
steps:
- name: hab curl bash install
- name: install hab binary
shell: bash
env:
URL: ${{ inputs.curl-bash-url }}
Expand All @@ -27,11 +27,18 @@ runs:
curl "$URL" | sudo bash -s -- -v "$VERSION" -t "$TARGET"
echo --- installed hab
- name: accept hab license
shell: bash
run: |
echo --- hab license accept
hab license accept
sudo hab license accept
echo --- accepted hab license for user and superuser
# TODO: make HAB_ORIGIN and HAB_AUTH_TOKEN proper inputs instead of envvars?
- name: download hab keys
shell: bash
run: |
echo --- hab origin key download
hab origin key download $HAB_ORIGIN
hab origin key download --auth $HAB_AUTH_TOKEN --secret $HAB_ORIGIN
Expand Down
39 changes: 26 additions & 13 deletions .github/actions/hab-pkg-build-and-upload-linux/action.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Habitat Package Build and Upload
name: Habitat Package Build, Install, and Upload
description: Builds a Habitat Package and uploads it
inputs:
hab-auth-token:
Expand All @@ -23,30 +23,43 @@ runs:
HAB_ORIGIN: ${{ inputs.hab-origin}}
BLDR_COMPONENT: ${{ inputs.bldr-component }}
HAB_STUDIO_SECRET_GITHUB_TOKEN: ${{ inputs.gh-token }}
# JAH: is HAB_STUDIO_SECRET_GITHUB_TOKEN needed?
run: |
export HAB_STUDIO_SECRET_GITHUB_TOKEN
echo ---- hab pkg build $BLDR_COMPONENT
hab pkg build $BLDR_COMPONENT
echo ---- built succesfully
- name: hab pkg install
shell: bash
env:
HAB_AUTH_TOKEN: ${{ inputs.hab-auth-token }}
run: |
source results/last_build.env
echo ---- sudo hab pkg install --auth elided-HAB_AUTH_TOKEN results/$pkg_artifact
sudo hab pkg install --auth $HAB_AUTH_TOKEN results/$pkg_artifact
echo ---- installed succesfully
# echo ---- BEGIN hab pkg path EXPERIMENTS
# echo ---- hab pkg path $pkg_origin/$pkg_name
# hab pkg path $pkg_origin/$pkg_name
# echo ---- hab pkg path $pkg_origin/$pkg_name/$pkg_version
# hab pkg path $pkg_origin/$pkg_name/$pkg_version
# echo ---- hab pkg path $pkg_origin/$pkg_name/$pkg_version/$pkg_release
# hab pkg path $pkg_origin/$pkg_name/$pkg_version/$pkg_release
# echo ---- hab pkg path $pkg_artifact
# hab pkg path $pkg_artifact
# echo ---- END hab pkg path EXPERIMENTS
# - name: hab pkg path
# run: |
# source results/last_build.env

# echo ---- BEGIN hab pkg path EXPERIMENTS
# echo ---- hab pkg path $pkg_origin/$pkg_name
# hab pkg path $pkg_origin/$pkg_name
# echo ---- hab pkg path $pkg_origin/$pkg_name/$pkg_version
# hab pkg path $pkg_origin/$pkg_name/$pkg_version
# echo ---- hab pkg path $pkg_origin/$pkg_name/$pkg_version/$pkg_release
# hab pkg path $pkg_origin/$pkg_name/$pkg_version/$pkg_release
# echo ---- hab pkg path $pkg_artifact
# hab pkg path $pkg_artifact
# echo ---- END hab pkg path EXPERIMENTS

- name: hab pkg upload
env:
HAB_AUTH_TOKEN: ${{ inputs.hab-auth-token }}
run: |
source results/last_build.env
echo ---- hab pkg upload --auth elided-HAB_AUTH_TOKEN results/$pkg_artifact
hab pkg upload --auth $HAB_AUTH_TOKEN results/$pkg_artifact
echo ---- uploaded succesfully
134 changes: 67 additions & 67 deletions .github/workflows/hab-pkg-build-upload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,31 @@ permissions:

jobs:

# # In their component root, these particular components
# # - have a plan.sh file
# # - don't have a habitat plan directory
# # - don't have a habitat-dev plan directory
# # - don't have architecture specific plan directories
# plan-file-packages:
# name: ${{matrix.components}} (plan file)
# strategy:
# fail-fast: false
# matrix:
# os: [ubuntu-latest]
# channel: [unstable]
# components: [builder-memcached, builder-datastore]
# runs-on: ${{matrix.os}}
# steps:
# - name: Checkout for ${{matrix.components}}
# uses: actions/checkout@v4
# - name: Install Habitat for ${{matrix.components}}
# uses: ./.github/actions/hab-install-linux
# - 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 }}
# hab-origin: ${{ env.HAB_ORIGIN }}
# bldr-component: components/${{matrix.components}}
# In their component root, these particular components
# - have a plan.sh file
# - don't have a habitat plan directory
# - don't have a habitat-dev plan directory
# - don't have architecture specific plan directories
plan-file-packages:
name: ${{matrix.components}} (plan file)
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
channel: [unstable]
components: [builder-memcached, builder-datastore]
runs-on: ${{matrix.os}}
steps:
- name: Checkout for ${{matrix.components}}
uses: actions/checkout@v4
- name: Install Habitat for ${{matrix.components}}
uses: ./.github/actions/hab-install-linux
- 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 }}
hab-origin: ${{ env.HAB_ORIGIN }}
bldr-component: components/${{matrix.components}}

# # In their component root, these particular components
# # - don't have a plan.sh file
Expand Down Expand Up @@ -129,51 +129,51 @@ jobs:
# app-version: ${{ needs.pre-build.outputs.app_version }}
# build-date-time: ${{ needs.pre-build.outputs.date }}

# In their component root, these particular components
# - don't have a plan.sh file
# - have a habitat plan directory
# - have a habitat-dev plan directory
# - don't have architecture specific plan directories
habitat-dev-dir-packages:
name: ${{matrix.components}} (habitat and habitat-dev dirs)
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
channel: [unstable]
components: [builder-jobsrv]
# components: [builder-api, builder-api-proxy, builder-jobsrv, builder-worker]
runs-on: ${{matrix.os}}
steps:
# # In their component root, these particular components
# # - don't have a plan.sh file
# # - have a habitat plan directory
# # - have a habitat-dev plan directory
# # - don't have architecture specific plan directories
# habitat-dev-dir-packages:
# name: ${{matrix.components}} (habitat and habitat-dev dirs)
# strategy:
# fail-fast: false
# matrix:
# os: [ubuntu-latest]
# channel: [unstable]
# components: [builder-jobsrv]
# # components: [builder-api, builder-api-proxy, builder-jobsrv, builder-worker]
# runs-on: ${{matrix.os}}
# steps:

- name: Checkout
uses: actions/checkout@v4
# - name: Checkout
# uses: actions/checkout@v4

- name: Install Habitat
uses: ./.github/actions/hab-install-linux
# - name: Install Habitat
# uses: ./.github/actions/hab-install-linux

- name: ${{matrix.components}} habitat directory package
uses: ./.github/actions/hab-pkg-build-and-upload-linux
with:
hab-auth-token: ${{ env.HAB_AUTH_TOKEN }}
hab-origin: ${{ env.HAB_ORIGIN }}
bldr-component: components/${{matrix.components}}/habitat

- name: hab pkg path experiments
shell: bash
run: |
echo ---- BEGIN hab pkg path EXPERIMENTS
echo ---- hab pkg path $pkg_origin/$pkg_name
source results/last_build.env
hab pkg path $pkg_origin/$pkg_name
echo ---- END hab pkg path EXPERIMENTS
- name: ${{matrix.components}} habitat-dev directory package
uses: ./.github/actions/hab-pkg-build-and-upload-linux
with:
hab-auth-token: ${{ env.HAB_AUTH_TOKEN }}
hab-origin: ${{ env.HAB_ORIGIN }}
bldr-component: components/${{matrix.components}}/habitat-dev
# - name: ${{matrix.components}} habitat directory package
# uses: ./.github/actions/hab-pkg-build-and-upload-linux
# with:
# hab-auth-token: ${{ env.HAB_AUTH_TOKEN }}
# hab-origin: ${{ env.HAB_ORIGIN }}
# bldr-component: components/${{matrix.components}}/habitat

# # - name: hab pkg path experiments
# # shell: bash
# # run: |
# # echo ---- BEGIN hab pkg path EXPERIMENTS
# # echo ---- hab pkg path $pkg_origin/$pkg_name
# # source results/last_build.env
# # hab pkg path $pkg_origin/$pkg_name
# # echo ---- END hab pkg path EXPERIMENTS

# - name: ${{matrix.components}} habitat-dev directory package
# uses: ./.github/actions/hab-pkg-build-and-upload-linux
# with:
# hab-auth-token: ${{ env.HAB_AUTH_TOKEN }}
# hab-origin: ${{ env.HAB_ORIGIN }}
# bldr-component: components/${{matrix.components}}/habitat-dev

# JAH: trigger appropriately
# JAH: Set the hab_auth_token more appropriately
Expand Down

0 comments on commit 2596d84

Please sign in to comment.