Skip to content

Commit

Permalink
Merge pull request #87 from redkubes/matthew/feat/otomi-viewer-rights
Browse files Browse the repository at this point in the history
feat: otomi viewer rights
  • Loading branch information
ferruhcihan authored Oct 12, 2023
2 parents dc5a44a + bb137f2 commit 1e4d00f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/tasks/gitea/gitea.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
Team,
} from '@redkubes/gitea-client-node'
import { doApiCall, waitTillAvailable } from '../../utils'
import { cleanEnv, GITEA_PASSWORD, GITEA_URL, OTOMI_VALUES } from '../../validators'
import { GITEA_PASSWORD, GITEA_URL, OTOMI_VALUES, cleanEnv } from '../../validators'
import { orgName, otomiValuesRepoName, teamNameViewer, username } from '../common'

const env = cleanEnv({
Expand All @@ -29,7 +29,7 @@ const readOnlyTeam: CreateTeamOption = {
...new CreateTeamOption(),
canCreateOrgRepo: false,
name: teamNameViewer,
includesAllRepositories: true,
includesAllRepositories: false,
permission: CreateTeamOption.PermissionEnum.Read,
units: ['repo.code'],
}
Expand Down Expand Up @@ -144,6 +144,14 @@ export default async function main(): Promise<void> {
// create main org repo: otomi/values
await upsertRepo(existingTeams, existingRepos, orgApi, repoApi, repoOption)

// add repo: otomi/values to the team: otomi-viewer
await doApiCall(
errors,
`Adding repo values to team otomi-viewer`,
() => repoApi.repoAddTeam(orgName, 'values', 'otomi-viewer'),
422,
)

if (!hasArgo) return

// then create initial gitops repo for teams
Expand Down

0 comments on commit 1e4d00f

Please sign in to comment.