Setup Redis on AWS CodeBuild

186 Views Asked by At

I am setting a CI/CD using AWS CodeBuild. But I got a problem that can't start the redis system.

[Container] 2023/06/27 09:16:34 Running command sudo systemctl start redis6
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down

[Container] 2023/06/27 09:16:34 Command did not exit successfully sudo systemctl start redis6 exit status 1
[Container] 2023/06/27 09:16:34 Phase complete: INSTALL State: FAILED
[Container] 2023/06/27 09:16:34 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: sudo systemctl start redis6. Reason: exit status 

Here is my setup:

version: 0.2

phases:
    install:
        commands:
            - echo check AWS version...
            - cat /etc/image-id
            - sudo yum update -y
            - sudo dnf install -y redis6
            - sudo systemctl start redis6
            - sudo systemctl enable redis6
            - sudo systemctl is-enabled redis6
    pre_build:
        commands:
            - echo check node version...
            - node -v
            - echo set config...
            - npm config set registry http://registry.npmjs.org/
            - echo Install packages...
            - npm install
    build:
        commands:
            - echo Build started on `date`
             .......
    post_build:
        commands:
            - echo Build completed on `date`
            - echo Removing node modules folder...
            - rm -rf node_modules/
artifacts:
    files:
        - '**/*'
    base-directory: '.'
0

There are 0 best solutions below