Open
Description
My goal is to use Ruby 3.1.2 (since my RoR app uses 3.1.2), so I specify an image inside the pipeline manifest file like this
...
build:
image: aws/codebuild/amazonlinux2-x86_64-standard:4.0
...
When I start build it fails with the following error:
...
Running command pipeline=$(cat $CODEBUILD_SRC_DIR/copilot/pipelines/liquandum/manifest.yml \| ruby -ryaml -rjson -e 'puts JSON.pretty_generate(YAML.load(ARGF))')
--
/root/.rbenv/versions/3.1.2/lib/ruby/3.1.0/psych/class_loader.rb:99:in `find': Tried to load unspecified class: Date (Psych::DisallowedClass)
...
which is caused by parsing manifest file inside the buildspec.yml
. It is a ruby script.
The following fixes it:
- pipeline=$(cat $CODEBUILD_SRC_DIR/copilot/pipelines/liquandum/manifest.yml | ruby -ryaml -rjson -e 'require "date"; puts JSON.pretty_generate(YAML.load(ARGF, permitted_classes:[Date]))')
We simply need to require "date"
and pass the class Date
inside the permitted_classes
array.
Activity