Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove deprecated registry login and add env setup #443

Merged
merged 4 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions .github/actions/setup/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
name: "Setup Environment"
description: "UDS Environment Setup"
inputs:
gh_token:
ghToken:
description: 'GITHUB_TOKEN'
required: true
ib_user:
registry1Username:
description: 'IRON_BANK_ROBOT_USERNAME'
required: true
ib_password:
registry1Password:
description: 'IRON_BANK_ROBOT_PASSWORD'
required: true

Expand All @@ -31,3 +31,18 @@ runs:
shell: bash
# renovate: datasource=github-tags depName=defenseunicorns/uds-cli versioning=semver
run: brew install defenseunicorns/tap/uds@0.10.4

- 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: GHCR Login
if: ${{ inputs.ghToken != '' }}
env:
GH_TOKEN: ${{ inputs.ghToken }}
run: echo "${{ env.GH_TOKEN }}" | uds zarf tools registry login -u "dummy" --password-stdin ghcr.io
shell: bash
10 changes: 4 additions & 6 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,10 @@ jobs:

- name: Environment setup
uses: ./.github/actions/setup

- name: Login to GHCR
run: uds run registry-login --set REGISTRY=ghcr.io --set REGISTRY_USERNAME=dummy --set REGISTRY_PASSWORD=${{ secrets.GITHUB_TOKEN }} --set REGISTRY_RETRY_INTERVAL=90 --no-progress

- name: Login to registry1
run: uds run registry-login --set REGISTRY=registry1.dso.mil --set REGISTRY_USERNAME=${{ secrets.IRON_BANK_ROBOT_USERNAME }} --set REGISTRY_PASSWORD=${{ secrets.IRON_BANK_ROBOT_PASSWORD }} --set REGISTRY_RETRY_INTERVAL=90 --no-progress
with:
registry1Username: ${{ secrets.IRON_BANK_ROBOT_USERNAME }}
registry1Password: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }}
ghToken: ${{ secrets.GITHUB_TOKEN }}

- name: (Snapshot) Get snapshot version using git commit short sha and date
if: ${{ inputs.snapshot }}
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,10 @@ jobs:

- name: Environment setup
uses: ./.github/actions/setup

- name: Login to GHCR
run: uds run registry-login --set REGISTRY=ghcr.io --set REGISTRY_USERNAME=dummy --set REGISTRY_PASSWORD=${{ secrets.GITHUB_TOKEN }} --set REGISTRY_RETRY_INTERVAL=90 --no-progress

- name: Login to registry1
run: uds run registry-login --set REGISTRY=registry1.dso.mil --set REGISTRY_USERNAME=${{ secrets.IRON_BANK_ROBOT_USERNAME }} --set REGISTRY_PASSWORD=${{ secrets.IRON_BANK_ROBOT_PASSWORD }} --set REGISTRY_RETRY_INTERVAL=90 --no-progress
with:
registry1Username: ${{ secrets.IRON_BANK_ROBOT_USERNAME }}
registry1Password: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }}
ghToken: ${{ secrets.GITHUB_TOKEN }}

- name: Test a single source package
if: ${{ inputs.package != 'all' && inputs.test_type == 'install' }}
Expand Down
10 changes: 0 additions & 10 deletions tasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ includes:
- deploy: ./tasks/deploy.yaml
- test: ./tasks/test.yaml
- lint: ./tasks/lint.yaml
- common-setup: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.3.6/tasks/setup.yaml

tasks:

Expand Down Expand Up @@ -61,15 +60,6 @@ tasks:
actions:
- task: setup:k3d-test-cluster

- name: registry-login
actions:
- task: common-setup:registry-login
with:
registry: ${REGISTRY}
registryUsername: ${REGISTRY_USERNAME}
registryPassword: ${REGISTRY_PASSWORD}
registryRetryInterval: ${REGISTRY_RETRY_INTERVAL}

- name: create-single-package
actions:
- task: create:single-package
Expand Down