-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Case Wylie <[email protected]>
- Loading branch information
Showing
1 changed file
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
# Copyright 2024 Defense Unicorns | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: "Pepr Iron Bank Setup" | ||
description: "Pepr Iron Bank Environment Setup" | ||
inputs: | ||
registry1Username: | ||
description: 'IRON_BANK_ROBOT_USERNAME' | ||
required: true | ||
registry1Password: | ||
description: 'IRON_BANK_ROBOT_PASSWORD' | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Harden Runner | ||
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0 | ||
with: | ||
egress-policy: audit | ||
|
||
- name: Use Node.js 22 | ||
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0 | ||
with: | ||
node-version: 22 | ||
|
||
- name: Install k3d | ||
shell: bash | ||
run: curl -s https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash | ||
|
||
- name: Iron Bank Login | ||
if: ${{ inputs.registry1Username != '' }} | ||
env: | ||
REGISTRY_USERNAME: ${{ inputs.registry1Username }} | ||
REGISTRY_PASSWORD: ${{ inputs.registry1Password }} | ||
run: echo "${{ env.REGISTRY_PASSWORD }}" | uds zarf tools registry login -u "${{ env.REGISTRY_USERNAME }}" --password-stdin registry1.dso.mil | ||
shell: bash | ||
|
||
- name: Clone Pepr | ||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
with: | ||
repository: defenseunicorns/pepr | ||
path: pepr | ||
|
||
- name: Set Pepr Environment Variable | ||
shell: bash | ||
run: echo "PEPR=${GITHUB_WORKSPACE}/pepr" >> "$GITHUB_ENV" | ||
|
||
- name: Clone Iron Bank Repo & Transfer Dockerfiles | ||
shell: bash | ||
run: | | ||
git clone https://repo1.dso.mil/dsop/opensource/defenseunicorns/pepr/controller.git | ||
cd controller | ||
git checkout development | ||
mv Dockerfile $PEPR/Dockefile.ironbank.amd | ||
mv Dockerfile.arm $PEPR/Dockerfile.ironbank.arm | ||
- name: Install Pepr Dependencies | ||
shell: bash | ||
run: | | ||
cd "$PEPR" | ||
npm ci | ||
- name: Build Pepr Iron Bank Images | ||
shell: bash | ||
run: | | ||
cd "$PEPR" | ||
docker build -t pepr:amd -f Dockerfile.ironbank.amd . | ||
docker build -t pepr:arm -f Dockerfile.ironbank.arm . | ||
- name: Import Pepr Iron Bank Images into K3d cluster | ||
shell: bash | ||
run: | | ||
cd "$PEPR" | ||
npm run build | ||
mv pepr-0.0.0-development.tgz ${GITHUB_WORKSPACE}/pepr-0.0.0-development.tgz | ||
docker build -t pepr:amd -f Dockerfile.ironbank.amd . | ||
docker build -t pepr:arm -f Dockerfile.ironbank.arm . | ||
- name: Create K3d Cluster & Import Pepr Iron Bank Images | ||
shell: bash | ||
run: | | ||
k3d cluster create iron-bank-pepr-e2es | ||
k3d image import pepr:amd pepr:arm -c iron-bank-pepr-e2es | ||