Manage Nexus Artifacts
After deploying CloudOps for Kubernetes, a Nexus server is created and used to cache artifacts from external Maven repositories and store Elastic Path artifacts. Jenkins jobs create these Elastic Path artifacts, and you must periodically clean up to maintain sufficient disk space in Nexus.
By default, the Nexus server comes with tasks and Jenkins jobs that clean up artifacts in the Elastic Path Snapshots and Elastic Path Releases Nexus repositories. These tasks can be found in the Administration section under Scheduled Tasks
in the Nexus web UI.
The Elastic Path Snapshots Repository
The following tasks in the Nexus server delete artifacts from the Elastic Path Snapshots repository:
Remove unused snapshots from EP Snapshots repo
Empty trash from EP Snapshots
These tasks run hourly and delete even a day old artifacts in the repository.
The Elastic Path Releases Repository
The following tasks in the Nexus server delete artifacts from the Elastic Path Releases repository:
Cleanup EP-Release Artifacts
Empty trash from EP Releases
These tasks are triggered to run through the cleanup-release-artifacts
Jenkins job, and delete all artifacts in the repository. The cleanup-release-artifacts
Jenkins job has a persistent, configurable schedule.
You can access the cleanup-release-artifacts
Jenkins job from the Nexus
view in Jenkins.
To prevent this job from deleting artifacts used during a maven build; the job fails if the following Jenkins jobs are in the Jenkins build queue or are already running:
build-deployment-package
run-cortex-system-tests
run-recursive-commerce-tests
run-select-commerce-tests
multi-purpose-commerce-tool
branch-validation-pipeline
commerce-test-and-deploy
cleanup-release-artifact
Jenkins job
Parameters for the cloudOpsForKubernetesRepoURL
The URL to your hosted copy of the cloudops-for-kubernetes
Git repository.
cloudOpsForKubernetesBranch
Use the branch of the cloudops-for-kubernetes
Git repository during the deployment.
The Self Managed Commerce Release Cleanup Schedule
The schedule for the cleanup-release-artifacts
Jenkins job is maintained through the modify-cleanup-release-artifacts-schedule
Jenkins job. This job allows the persistent configuration of the release cleanup jobs so that the cleanup operations can meet the Self Managed Commerce build frequency of your project. If your Jenkins instance restarts, your configured schedule is not overwritten by the default.
If you build many Self Managed Commerce deployment packages at a high frequency, you can adjust the Command Run On (CRON) string configured by the modify-cleanup-release-artifacts-schedule
Jenkins job so that the release cleanup operations run more frequently. If you do not build many Self Managed Commerce deployment packages, you can adjust the CRON string to reflect your desired frequency.
You can access the modify-cleanup-release-artifacts-schedule
Jenkins job from the Nexus
view in Jenkins.
After the configuration has been changed, the modify-cleanup-release-artifacts-schedule
Jenkins job will apply the CRON string to the cleanup-release-artifacts
Jenkins job by running the bootstrap.groovy
script that is stored in the file <cloud-ops-kubernetes>/jenkins/jobs/bootstrap/bootstrap.groovy
, where <cloud-ops-kubernetes>
is your CloudOps for Kubernetes Git repository.
modify-cleanup-release-artifacts-schedule
Jenkins job
Parameters for the cleanupReleaseArtifactsSchedule
This is the valid CRON string that you want the cleanup-release-artifacts
Jenkins job to run.
cloudOpsForKubernetesRepoURL
The URL to your hosted copy of the cloudops-for-kubernetes
Git repository.
cloudOpsForKubernetesBranch
Use the branch of the cloudops-for-kubernetes
Git repository during the deployment.
Reset Nexus Configuration
The initial Nexus configuration is stored in the file <cloud-ops-kubernetes>/bootstrap/terraform/config/nexus.xml.tmpl
, where <cloud-ops-kubernetes>
is your CloudOps for Kubernetes Git repository.
To reset the stored Nexus configuration, set TF_VAR_reset_nexus_config_file
in your docker-compose.override.yaml
file to true
and then run docker-compose up
on your operations workstation. If you do not set TF_VAR_reset_nexus_config_file
to true
then the configuration of Nexus will not be modified when running docker-compose up
.