From b37671899b5226223e13b829d509363bc124b1cd Mon Sep 17 00:00:00 2001 From: Wayne Starr Date: Wed, 25 Sep 2024 09:46:15 -0600 Subject: [PATCH] chore: update admin tasks for consistency (#202) ## 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> --- tasks.yaml | 6 ++++++ tasks/test.yaml | 13 ------------- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/tasks.yaml b/tasks.yaml index e5287b9f..102b4dfd 100644 --- a/tasks.yaml +++ b/tasks.yaml @@ -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 diff --git a/tasks/test.yaml b/tasks/test.yaml index 0589ea3a..211f2c45 100644 --- a/tasks/test.yaml +++ b/tasks/test.yaml @@ -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: