Skip to content

Commit

Permalink
Cache vagrant boxes (#11671)
Browse files Browse the repository at this point in the history
  • Loading branch information
ant31 authored Oct 31, 2024
1 parent 20df445 commit e293a88
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
12 changes: 10 additions & 2 deletions .gitlab-ci/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@
tags: [ffci-vm-med]
only: [/^pr-.*$/]
except: ['triggers']
image: quay.io/kubespray/vm-kubespray-ci:v6
image: quay.io/kubespray/vm-kubespray-ci:v13
services: []
stage: deploy-part1
needs: []
# - ci-not-authorized
variables:
VAGRANT_DEFAULT_PROVIDER: "libvirt"
VAGRANT_HOME: "$CI_PROJECT_DIR/.vagrant.d"
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
before_script:
- mkdir -p $VAGRANT_HOME
- groups
- python3 -m venv citest
- source citest/bin/activate
Expand All @@ -29,10 +32,15 @@
when: always
paths:
- molecule_logs/
cache:
key: $CI_JOB_NAME_SLUG
paths:
- .vagrant.d/boxes
- .cache/pip
policy: pull-push # TODO: change to "pull" when not on main

# CI template for periodic CI jobs
# Enabled when PERIODIC_CI_ENABLED var is set

.molecule_periodic:
only:
variables:
Expand Down
10 changes: 9 additions & 1 deletion .gitlab-ci/vagrant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
KUBESPRAY_VAGRANT_CONFIG: tests/files/${CI_JOB_NAME}.rb
DOCKER_NAME: vagrant
VAGRANT_ANSIBLE_TAGS: facts
VAGRANT_HOME: "$CI_PROJECT_DIR/.vagrant.d"
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
tags: [ffci-vm-large]
# only: [/^pr-.*$/]
# except: ['triggers']
image: quay.io/kubespray/vm-kubespray-ci:v6
image: quay.io/kubespray/vm-kubespray-ci:v13
services: []
before_script:
- echo $USER
Expand All @@ -27,6 +29,12 @@
- ./tests/scripts/vagrant_clean.sh
script:
- ./tests/scripts/testcases_run.sh
cache:
key: $CI_JOB_NAME_SLUG
paths:
- .vagrant.d/boxes
- .cache/pip
policy: pull-push # TODO: change to "pull" when not on main

vagrant_ubuntu20-calico-dual-stack:
stage: deploy-extended
Expand Down

0 comments on commit e293a88

Please sign in to comment.