I would like to dynamically set some parameters of the job aws-ecr/build-and-push-images.
For this purpose, I use the matrix feature:
orbs:
aws-ecr: circleci/aws-ecr@7.2.0
docker: circleci/docker@1.7.0
version: 2.1
workflows:
build_docker_images:
jobs:
- aws-ecr/build-and-push-image:
dockerfile: build/Dockerfile
executor: docker/docker
matrix:
parameters:
package:
- frontend
- backend
name: << matrix.package>>_build_docker_image>
path: packages/<< matrix.package >>
remote-docker-layer-caching: true
repo: test-eks-<< matrix.package >>
setup-remote-docker: true
tag: $CIRCLE_SHA1
It’s what has been suggested in this topic.
Sadly, when this configuration is run, I got the following error:
#!/bin/sh -eo pipefail
# Error calling workflow: 'build_docker_images'
# Error calling job: 'aws-ecr/build-and-push-image'
# Unexpected argument(s): package
#
# -------
# Warning: This configuration was auto-generated to show you the message above.
# Don't rerun this job. Rerunning will have no effect.
false
Exited with code exit status 1
CircleCI received exit code 1
I don’t get why. Any idea where I’m wrong?