Merge circle config into a single big command
This commit is contained in:
@@ -9,8 +9,9 @@ jobs:
|
||||
- checkout
|
||||
|
||||
- run:
|
||||
name: Check if Packer files were modified
|
||||
name: Choose which test suite to run based on which files were modified
|
||||
command: |
|
||||
## Checking commits for changes to Packer files
|
||||
## This handles the cases where there are multiple commits
|
||||
if echo "$CIRCLE_COMPARE_URL" | grep '\.\.'; then
|
||||
if [ "$(git diff-tree --no-commit-id --name-only -r $(git rev-parse origin/HEAD) $(echo $CIRCLE_COMPARE_URL | cut -d '.' -f 5) | grep -c ^Packer/)" -gt 0 ]; then
|
||||
@@ -27,11 +28,7 @@ jobs:
|
||||
export PACKER_MODIFIED=0
|
||||
fi
|
||||
fi
|
||||
echo "PACKER_MODIFIED=$PACKER_MODIFIED"
|
||||
|
||||
- run:
|
||||
name: Check if Vagrant files were modified
|
||||
command: |
|
||||
## Checking commits for changes to Vagrant files
|
||||
if echo "$CIRCLE_COMPARE_URL" | grep '\.\.'; then
|
||||
if [ "$(git diff-tree --no-commit-id --name-only -r $(git rev-parse origin/HEAD) $(echo $CIRCLE_COMPARE_URL | cut -d '.' -f 5) | grep -c ^Vagrant/)" -gt 0 ]; then
|
||||
export VAGRANT_MODIFIED=1
|
||||
@@ -47,13 +44,8 @@ jobs:
|
||||
fi
|
||||
fi
|
||||
echo "VAGRANT_MODIFIED=$VAGRANT_MODIFIED"
|
||||
|
||||
|
||||
- run:
|
||||
name: Choose which build gets run
|
||||
command: |
|
||||
echo "VAGRANT_MODIFIED=$VAGRANT_MODIFIED"
|
||||
echo "PACKER_MODIFIED=$PACKER_MODIFIED"
|
||||
## Choosing which test suite to run based on the files that were changed
|
||||
if [[ "$PACKER_MODIFIED" -eq 1 ]] && [[ "$VAGRANT_MODIFIED" -eq 1 ]]; then
|
||||
echo "Running the test suite for Packer and Vagrant changes"
|
||||
chmod +x ci/circle_workflows/packer_and_vagrant_changes.sh
|
||||
|
||||
Reference in New Issue
Block a user