# Repositories

The Provisioning ‣ Code ‣ Repositories section contains the repositories integrated with HPE Morpheus Enterprise allowing users to browse repository folders and files, view file contents from any branch, trigger a refresh, and create tasks, scripts and templates directly from the repos. This section also handles Import/Export functionality which allows users to backup HPE Morpheus Enterprise items (Tasks, Library Items, etc.) as code in a repository which can also be imported into another appliance, if desired.

- Browse integrated repositories
- View repo files
- Switch branches
- Trigger repo refreshes
- Filter by Integration, Organization or Text search
- Create Custom Views
- Create Tasks from repo files
- Create Spec Templates from repo files

## Role Permissions

Access and capabilities for the **Repositories** section is determined by the following role permissions:

Role: Feature Access: `Infrastructure: Groups`
:   - None: Cannot access Provisioning: Code section
    - Read or Full: Can access Provisioning: Code section

Role: Feature Access: `Administration: Users`
:   - None: Can view repo list but cannot browse repo folder and file names, select branch, refresh repositories or access/view file contents
    - Read or Full: Can view repo list, browse repo folder and file names, select branch, refresh repositories. Cannot access/view file contents without Read or Full level permission on `Provisioning: Code Repositories`

Role: Feature Access: `Provisioning: Code Repositories`
:   - None: Cannot access Provisioning: Code Repositories
    - List Files: Can browse repo folder and file names, select branch, refresh Repositories. Cannot access/view file contents
    - Read or Full: Can browse repo folder and file names, select branch, refresh Repositories and access/view file contents

Role: Feature Access: `Provisioning: Tasks`
:   - None: Cannot create Tasks from repo files in repository browser
    - Read or Full: Can create Tasks from repo files in repository browser

Role: Feature Access: `Provisioning: Library`
:   - None: Cannot create Spec Templates from files in repository browser
    - Read or Full: Can create Spec Templates from files in repository browser

## List Repositories

### Procedure

1. Select the `Provisioning` link in the navigation bar
2. Select the `Code` link in the sub-navigation bar
3. Users with sufficient permissions will see a list view of all integrated code repositories
4. Use the Search, Integrations or Organizations filter to filter listed repositories

### Results

TIP

Select the gear icon ⚙ in the top right of the repos list view to create and save custom list views.

## Refresh Repository

### Procedure

1. Select the `Provisioning` link in the navigation bar
2. Select the `Code` link in the sub-navigation bar
3. Select name of target repository
4. Select ACTIONS ▿ > `Refresh`

## Browse Repositories

### Procedure

1. Select the `Provisioning` link in the navigation bar
2. Select the `Code` link in the sub-navigation bar
3. Select name of target repository
4. Users with sufficient permissions can browse repo folder and file names, select branches, and refresh repositories. Users can access/view file contents with Read or Full level permission on `Provisioning: Code Repositories`
5. Select target folder icon to drill into the folder

## View Repository File

### Procedure

1. Select the `Provisioning` link in the navigation bar
2. Select the `Code` link in the sub-navigation bar
3. Select name of target repository
4. Select ℹ icon to right of target file name

### Results

NOTE

Users can access/view file contents only with Read or Full level permission on `Provisioning: Code Repositories`. File contents displayed is from last repo sync. Refresh repo to ensure current version for recent commits.

## Create Task from Repository File

### Procedure

1. Select the `Provisioning` link in the navigation bar
2. Select the `Code` link in the sub-navigation bar
3. Select name of target repository
4. Select gear icon to right of compatible target file name
5. Select target task type from available actions
6. Complete the NEW TASK wizard to create a new Task. The TYPE, SOURCE, REPOSITORY and FILE PATH fields will be automatically configured

### Results

NOTE

Shell and Powershell Tasks types can be created from the code repo browser in v8.0.7. Ensure file compatibility with target Task type.

NOTE

Users can create tasks from Repositories only with Read or Full level permission on `Library: Tasks`.

## Create Spec Template from Repository File

### Procedure

1. Select the `Provisioning` link in the navigation bar
2. Select the `Code` link in the sub-navigation bar
3. Select name of target repository
4. Select gear icon to right of target file name
5. Select target spec template type from available actions
6. Complete the NEW SPEC TEMPLATE wizard to create a new Spec Template. The TYPE, SOURCE, REPOSITORY and FILE PATH fields will be automatically configured

### Results

NOTE

Terraform spec template types can be created from the code repo browser in v8.0.7. Other spec template types can be created from repo files by changing the TYPE field in the NEW SPEC TEMPLATE wizard.

NOTE

Users can create tasks from Repositories only with Read or Full level permission on `Library: Templates`.
