Skip to content

Commit

Permalink
chore: update admin tasks for consistency (#202)
Browse files Browse the repository at this point in the history
## Description

Make the admin tasks consistent with GLR

## Related Issue

Fixes #N/A

## Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [X] Other (security config, docs update, etc)

## Checklist before merging

- [X] Test, docs, adr added or updated as needed
- [X] [Contributor Guide
Steps](https://github.com/defenseunicorns/uds-package-gitlab/blob/main/CONTRIBUTING.md#developer-workflow)
followed

Co-authored-by: zamaz <71521611+zachariahmiller@users.noreply.github.com>
  • Loading branch information
Racer159 and zachariahmiller authored Sep 25, 2024
1 parent 9ea4622 commit b376718
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
6 changes: 6 additions & 0 deletions tasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ tasks:
- task: create-gl-test-bundle
- task: deploy:test-bundle

- name: doug-admin
description: Promote Doug to admin (requires running setup:create-doug-user and logging into gitlab ui first)
actions:
- cmd: |
./uds zarf tools kubectl exec -n gitlab deployment/gitlab-toolbox -- gitlab-rails runner -e production "user = User.find_by(username: 'doug'); user.admin = true; user.save!"
# CI will execute the following (via uds-common/.github/actions/test) so they need to be here with these names

- name: test-package
Expand Down
13 changes: 0 additions & 13 deletions tasks/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,6 @@ tasks:
- cmd: rm -rf "${PROJECT_NAME}"
dir: tests/data

- name: create-doug-admin
description: Create "doug" account as admin (must be run *before* first login)
actions:
- cmd: |
./uds zarf tools kubectl exec -n gitlab deployment/gitlab-toolbox -- gitlab-rails runner -e production '\
user = User.new(username: "doug", name: "Doug Unicorn", email: "doug@uds.dev", password: "0123456789!", password_confirmation: "0123456789!"); \
user.assign_personal_namespace!; \
user.skip_confirmation!; \
user.admin = true; \
user.save!; \
puts user.username; puts user.id; \
'
- name: create-doug-pat
description: Create personal access token (PAT) for "doug" account
actions:
Expand Down

0 comments on commit b376718

Please sign in to comment.