Git repositories in IAG
A repository in IAG is a reference to a Git repository that contains your scripts, automations, or other files. IAG pulls the repository when you run a service to ensure your scripts are always up to date.
Public and private repositories
IAG supports both public and private Git repositories:
- Public repositories: No authentication required. IAG can clone these repositories without credentials.
- Private repositories: Require authentication using either SSH keys or HTTP basic authentication (username and password/token).
For information about setting up authentication, see:
Create a repository
Use the iagctl create repository command to create a repository reference.
For more information, see the create repository command reference.
Create a public repository
Syntax:
Example:
Create a private repository with SSH authentication
Syntax:
Parameters:
<repository-name>: A unique name for the repository reference--url: The SSH Git URL (starts with git@)--private-key-name: The name of the secret that contains your SSH private key
Example:
For detailed setup instructions, see Use SSH keys to clone Git repositories.
Create a private repository with HTTP basic authentication
Syntax:
Parameters:
<repository-name>: A unique name for the repository reference--url: The HTTPS Git URL--username: Your Git username--password-name: The name of the secret that contains your password or token
Example:
For detailed setup instructions, see Configure access to private repositories.
Reference a specific branch or commit
By default, IAG clones the default branch of your repository. You can specify a different branch, tag, or commit using the --reference parameter.
Syntax:
Examples:
Create a repository that references the develop branch:
Create a repository that references a specific tag:
Add tags and descriptions to repositories
You can add tags and descriptions to help organize and identify repositories.
Example:
Repository structure best practices
When you organize scripts in a Git repository for use with IAG, consider these practices:
- Use clear directory structures: Organize scripts by type, function, or environment (for example,
scripts/backup/,scripts/deployment/) - Keep related files together: Place scripts and their dependencies in the same directory
- Use consistent naming: Name directories and files descriptively
- Document your structure: Include a README file that explains the repository organization
Example repository structure:
When you create a service, you specify the --working-dir parameter to tell IAG which directory contains your script.
Manage repositories
List all repositories:
View details of a specific repository:
Delete a repository:
Before you delete a repository, verify that no services reference it. If services use the repository, they will fail when you delete it.