Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
artifactory documentation and support scripts
- Loading branch information
Showing
4 changed files
with
147 additions
and
8 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
10 changes: 5 additions & 5 deletions
10
apps/artifactory/artifactory-operator/deploy/crds/team-type-locator.env
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
CONSOLE_NAME=prod | ||
TEAM_NAME=bcr | ||
REPO_TYPE=pypi | ||
REPO_LOCATOR=virtual | ||
REPO_DESCRIPTION="BCRegistry docker image hub repository" | ||
LIST_REPOS_VIRTUAL="pypi-remote,bcr-pypi-local" | ||
TEAM_NAME=fams3 | ||
REPO_TYPE=nuget | ||
REPO_LOCATOR=local | ||
REPO_DESCRIPTION="Nuget packages for the FAMS3 project" | ||
LIST_REPOS_VIRTUAL="" |
6 changes: 3 additions & 3 deletions
6
apps/artifactory/artifactory-sa-operator/deploy/crds/serviceaccount.env
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
CONSOLE_NAME=lab | ||
CR_NAME=caileytest5 | ||
DESCRIPTOR="this is a description of the service account's purpose" | ||
CONSOLE_NAME=prod | ||
CR_NAME=customresourcename | ||
DESCRIPTOR="this is a description of the service account's purpose" |
46 changes: 46 additions & 0 deletions
46
apps/artifactory/artifactory-sa-operator/serviceaccount-permissions.yaml
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,46 @@ | ||
- hosts: localhost | ||
connection: local | ||
gather_facts: no | ||
vars: | ||
artifactory_url: "https://artifactory.developer.gov.bc.ca" | ||
artifactory_group_endpoint: artifactory/api/security/groups | ||
artifactory_permission_endpoint: artifactory/api/v2/security/permissions | ||
service_account: "PASTE SERVICE ACCOUNT NAME HERE" | ||
repo_name: "PASTE PRIVATE REPOSITORY NAME HERE" | ||
admin_token: "PASTE ADMIN ACCOUNT TOKEN HERE" | ||
privileges: ["read","write","annotate","delete"] #please see DevHub for details on these privileges: https://developer.gov.bc.ca/Using-Artifactory | ||
|
||
|
||
- name: Create artifactory group | ||
uri: | ||
url: "{{ artifactory_url }}/{{ artifactory_group_endpoint }}/{{ service_account }}" | ||
method: PUT | ||
body_format: json | ||
headers: | ||
Authorization: "Bearer {{ admin_token }}" | ||
Content-type: "application/json" | ||
body: '{"name": "{{ service_account }}","description" : "group to grant {{ service_account }} access to {{ repo_name }}","autoJoin" : false,"adminPrivileges" : false}' | ||
force_basic_auth: yes | ||
status_code: 201 | ||
|
||
- name: Add permission for repository | ||
uri: | ||
url: "{{ artifactory_url }}/{{ artifactory_permission_endpoint }}/{{ service_account }}" | ||
method: PUT | ||
body_format: json | ||
headers: | ||
Content-type: "application/json" | ||
body: '{ | ||
"name": "{{ service_account }}", | ||
"repo":{ | ||
"include-patterns": ["**"], | ||
"exclude-patterns": [""], | ||
"repositories": ["{{ repo_name }}"], | ||
"actions": { | ||
"groups": { | ||
"{{ service_account }}" : {{ privileges }} | ||
} | ||
} | ||
} | ||
}' | ||
force_basic_auth: yes |