Hi guys,
How I can cache(keeping) package installed by the ‘apt-get install’ and ‘pip install’ ? The build I am using the “Machine – docker(service)”
I have two jobs “notification” and “deploy” in my circle.yml.
Below as my circle.yml, my objective is only doing once ‘apt-get install’ or ‘pip install’ then packages can provide for all jobs used.
I don’t want each job are needed to do the same thing(I mean is installed the same packages.
“I must say that too few documents mention this, or are unclear SOPs for the CircleCI 2.0”
Thank you.
defaults: &defaults
working_directory: ~/ansible_develop
machine:
services:
- docker
version: 2
jobs:
notification:
<<: *defaults
steps:
- checkout
- run:
name: Install dependencies
command: |
pip install --upgrade pip
pip install ansible
sudo apt-get install pssh
- run:
name: Sent the deploy workflow starting email notification
command: sh $PWD/mail_sent.sh
deploy:
<<: *defaults
steps:
- checkout
- run:
name: Install dependencies
command: |
pip install --upgrade pip
pip install ansible
sudo apt-get install pssh
- run:
name: Sent the mail
command: sh $PWD/mail_sent.sh
workflows:
version: 2
CICD-workflows:
jobs:
- notification
- deploy