Set up an environment
Give agents a setup script, the hosts they may reach, and the secrets they need for your repositories.
An environment tells an agent's computer how to get your repositories ready before work starts.
How do I let an agent set one up?
Under the message box on Agents, select Set up cloud environment once you choose a repository that has none. An agent writes the setup script, tries it, and saves it to the environment when it passes. While it works, Setting up and the repository's name link to that agent. Nothing is committed to the repository.
How do I create one myself?
- Open Cloud in the sidebar and select New environment.
- Give it a Name, choose its Scope, and choose its Repositories.
- Fill in what it needs:
- Setup script: a bash script that runs in each repository before work starts, such as installing dependencies.
- Allowed hosts: one host per line, such as
registry.npmjs.org. See What an agent's computer can reach. - Secrets: environment variables for setup and the agent, such as API keys. Paste a
.envfile into a name to add many.
- Select Skip and save, or Start agent to have a setup agent write the script. Start agent works with one repository chosen.
Secret values are encrypted and never shown again.
What are personal secrets?
In an organization environment, Your personal secrets are seen only by you, and only your runs and agents get them. They replace environment secrets with the same name.
Who can change an environment?
Its creator, or an owner or admin. Everyone else can only change their own personal secrets. To have an agent fix the script later, open the environment's menu on Cloud and select Set up with agent.