From 8159ed2822ad1a1cef324ae88f87badc5c060b13 Mon Sep 17 00:00:00 2001 From: Ryosuke Tomita <> Date: Sun, 17 Dec 2023 12:06:28 +0900 Subject: [PATCH] yum --- .../react-app-pipeline/buildspec.yml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/copilot/pipelines/react-app-pipeline/buildspec.yml b/copilot/pipelines/react-app-pipeline/buildspec.yml index 63dc300..3ff28d6 100644 --- a/copilot/pipelines/react-app-pipeline/buildspec.yml +++ b/copilot/pipelines/react-app-pipeline/buildspec.yml @@ -9,14 +9,21 @@ phases: - wget -q https://ecs-cli-v2-release.s3.amazonaws.com/copilot-linux-v1.32.0 -O copilot-linux - chmod +x ./copilot-linux # Download trivy. https://aquasecurity.github.io/trivy/v0.48/getting-started/installation/ - - apt-get update - - apt-get install -y wget apt-transport-https gnupg lsb-release - - wget -qO - https://aquasecurity.github.io/trivy-repo/deb/public.key | gpg --dearmor | tee /usr/share/keyrings/trivy.gpg > /dev/null - - echo "deb [signed-by=/usr/share/keyrings/trivy.gpg] https://aquasecurity.github.io/trivy-repo/deb $(lsb_release -sc) main" | tee -a /etc/apt/sources.list.d/trivy.list - - apt-get update - - apt-get install -y trivy + - echo "install trivy" + - RELEASE_VERSION=$(grep -Po '(?<=VERSION_ID=")[0-9]' /etc/os-release) + - cat << EOF | sudo tee -a /etc/yum.repos.d/trivy.repo + [trivy] + name=Trivy repository + baseurl=https://aquasecurity.github.io/trivy-repo/rpm/releases/$RELEASE_VERSION/\$basearch/ + gpgcheck=1 + enabled=1 + gpgkey=https://aquasecurity.github.io/trivy-repo/rpm/public.key + EOF + - yum -y update + - yum -y install trivy - chmod +x trivy + build: commands: - echo "Run your tests"