Installing RubyGems in Cloud9 with devfile

0

Hi,

I'm trying to install cfn-nag in my devfile as part of a git pre-hook we need all developers to use. Installing it manually after the environment is up works perfectly with gem install cfn-nag but when I use the same command in the devfile it gets installed in the /home/mde home directory and doesn't work for a variety of errors.

schemaVersion: 2.0.0
metadata:
  name: aws-universal
  version: 1.0.1
  displayName: AWS Universal
  description: Stack with AWS Universal Tooling
  tags: ["aws", "al2"]
  projectType: "aws"
components:
  - name: aws-runtime
    container:
      image: public.ecr.aws/aws-mde/universal-image:latest
      mountSources: true
      volumeMounts:
        - name: docker-store
          path: /var/lib/docker
  - name: docker-store
    volume:
      size: 16G
events:
  postStart:
    - install-deps
    - install-cfn-nag
commands:
  - id: install-deps
    exec:
      commandLine: sudo yum install -y python3.11 python3.11-pip ruby-devel
      workingDir: $PROJECT_SOURCE
      component: aws-runtime
  - id: install-cfn-nag
    exec:
      commandLine: gem install cfn-nag
      workingDir: $PROJECT_SOURCE
      component: aws-runtime 
profile picture
asked 20 days ago60 views
No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions