Hi,
I wanted to “dry” my configuration code a bit by using new features that come with version 2.1.
However, an essential part seems to be broken now.
Here is my config.yml:
version: 2.1
commands:
build_and_push_docker:
parameters:
image_name:
type: string
steps:
- checkout
# omitted the rest for easier reading
jobs:
build:
docker:
- image: circleci/golang
environment:
O: company_name
R: devops-docker-images
steps:
- checkout
- run:
name: Determine which directories have changed
command: |
git diff --no-commit-id --name-only -r `git log -n 2 --oneline --pretty=format:"%h" | tail -n1` | cut -d/ -f1 | sort -u > projects
printf "Modified directories:\n"
cat projects
while read project; do
if grep -Fxq $project projects.txt; then
printf "\nTriggerring build for dir: "$project
curl -s -u $CIRCLE_API_PROJECT_TOKEN: -d "build_parameters[CIRCLE_JOB]=${project}" "https://circleci.com/api/v1.1/project/github/${O}/${R}/tree/${CIRCLE_BRANCH}"
fi
done <projects
serverless-deployer:
docker:
- image: docker:18.06.1-ce-git
steps:
- build_and_push_docker:
image_name: "serverless-deployer"
static-files-deployer:
docker:
- image: docker:18.06.1-ce-git
steps:
- build_and_push_docker:
image_name: "static-files-deployer"
workflows:
version: 2.1
build-test-and-deploy:
jobs:
- build
The pipeline starts of with the “build” job that determines which of the included projects inside the monorepo should be be build. It then triggers the job via an API call.
The job then starts to run with the correct parameters. However, I get this errors message I did not get with version 2.0.
build-agent version 0.1.1073-1f69f340 (2018-11-20T18:07:03+0000) Configuration errors: 2 errors occurred: * Configuration version 2.1 requires the "Enable Build Processing" project setting. Enable Build Processing under Project Settings -> Advanced Settings. In order to retrigger build processing, you must push a new commit.
* Cannot find a job named `serverless-deployer` to run in the `jobs:` section of your configuration file. If you expected a workflow to run, check your config contains a top-level key called 'workflows:'
I cannot seem to sind the serverless-deployer
job anymore.
The difference to version 2.0 is that I am now using “commands” instead of code replication.
I have also enabled Build Processing as advised.