A repository containing a number of packer build configurations to generate Jenkins agent templates for all the Jenkins controllers of the jenkins-infra project, such as ci.jenkins.io, infra.ci.jenkins.io, etc.
If you have:
Any question about this repository, please ask us on the IRC channel at #jenkins-infra or on https://community.jenkins.io
A problem, a feature request or an unwanted behavior with this code or its artifacts, please open an issue on the GitHub issue tracker of this repository.
A contribution to make, please fork the GitHub repository to your own account, create a named branch and open a Pull Request with your proposed change/fix
Each commit or pull request of this repository is built on https://infra.ci.jenkins.io, a non-public Jenkins controller.
Each build creates a set of artifacts (VM templates) for each cell of the build matrix (check the Jenkinsfile_k8s
manifest) that are considered ephemeral:
The artifacts created by local builds (if you have the cloud credentials), Pull requests or named branch (except main
)
generate ephemeral artifacts tagged as dev
with a lifespan of ~24h.
They should never be used on production instances, they can be used for smoke testing and are not expected to be persisted.
The artifacts created by builds on the main
branch are tagged as staging
with a lifespan of 7 days.
They can be used for validation on production instances but are not met to be persisted.
Releases are created by adding a tag on the repository, which:
prod
(for production usage, with a lifespan of 3 month unless still used)updatecli
or dependabot
configuration) if created successfully.In some cases, you might want to execute the build locally (opposed to opening a Pull Request and delegate the build to the CI/CD system).
PKR_VAR_*
to the target you want to build (hint: look at the Jenkinsfile or to the variable
blocks in the packer template HCL files)PKR_VAR_image_type
) credentials (e.g. API key, or clouds own CLI access such as az
command))With the requirements verified locally, execute the following command:
# Means: "Build the ubuntu-22.04 agent for Docker
export PKR_VAR_image_type=docker
export PKR_VAR_agent_os_type=ubuntu
export PKR_VAR_agent_os_version=22.04
packer validate ./
packer build -timestamp-ui -force -only="docker.ubuntu" ./
Retrieve the resource group name from the source to build in the template files (directive managed_image_resource_group_name
).
Create a new resource group on your account with this retrieved values
az group create -n myResourceGroup -l eastus
PKR_VAR_subscription_id
, PKR_VAR_client_id
and PKR_VAR_client_secret