diff --git a/actions/sonar/1.0/Dockerfile b/actions/sonar/1.0/Dockerfile index afae63e7..7f1e0fe1 100644 --- a/actions/sonar/1.0/Dockerfile +++ b/actions/sonar/1.0/Dockerfile @@ -1,4 +1,4 @@ -FROM --platform=$TARGETPLATFORM registry.erda.cloud/erda/terminus-golang:1.16.7 AS builder +FROM --platform=$TARGETPLATFORM registry.erda.cloud/erda-x/golang:1.22 AS builder COPY . /go/src/github.com/erda-project/erda-actions WORKDIR /go/src/github.com/erda-project/erda-actions @@ -7,9 +7,9 @@ ARG ARCH RUN GOPROXY=https://goproxy.io,direct GOOS=linux GOARCH=$ARCH go build -o /assets/run actions/sonar/1.0/internal/*.go -FROM --platform=$TARGETPLATFORM registry.erda.cloud/erda/terminus-centos:base AS action +FROM --platform=$TARGETPLATFORM m.daocloud.io/docker.io/debian:bookworm AS action -RUN yum install -y wget unzip +RUN apt-get update && apt install -y wget unzip curl ca-certificates RUN mkdir /opt/sonarqube && cd /opt/sonarqube && \ wget https://terminus-dice.oss-cn-hangzhou.aliyuncs.com/sonarqube/scanner/sonar-scanner-cli-4.4.0.2170-linux.zip && \ @@ -17,10 +17,7 @@ RUN mkdir /opt/sonarqube && cd /opt/sonarqube && \ # nodejs # https://docs.sonarqube.org/latest/analysis/languages/javascript/ -ENV NODE_VERSION 12.13.1 -RUN \ - curl --silent --location https://rpm.nodesource.com/setup_12.x | bash - && \ - yum install -y nodejs-$NODE_VERSION +RUN curl -sL https://deb.nodesource.com/setup_lts.x | bash - && apt update && apt install -y nodejs && rm -fr /var/lib/apt/lists/* # typescript RUN npm install -g typescript ENV NODE_PATH "/usr/lib/node_modules/" diff --git a/actions/sonar/1.0/dice.yml b/actions/sonar/1.0/dice.yml index 06eb1daa..c9d07edd 100644 --- a/actions/sonar/1.0/dice.yml +++ b/actions/sonar/1.0/dice.yml @@ -1,7 +1,7 @@ ### job 配置项 jobs: sonar: - image: registry.erda.cloud/erda-actions/sonar-action:1.0-20221130114723-92c5240 + image: registry.erda.cloud/erda-actions/sonar-action:1.0-20251021150008-e1c4c8c resources: cpu: 1 mem: 2048 diff --git a/actions/sonar/1.0/internal/conf.go b/actions/sonar/1.0/internal/conf.go index c01a861f..1f4b9980 100644 --- a/actions/sonar/1.0/internal/conf.go +++ b/actions/sonar/1.0/internal/conf.go @@ -16,11 +16,12 @@ const ( LanguageGo Language = "go" LanguageJava Language = "java" LanguageJS Language = "js" + LanguagePy Language = "python" ) func (l Language) Supported() bool { switch l { - case LanguageGo, LanguageJava, LanguageJS: + case LanguageGo, LanguageJava, LanguageJS, LanguagePy: return true default: return false diff --git a/go.mod b/go.mod index df797f16..94d64b32 100644 --- a/go.mod +++ b/go.mod @@ -24,6 +24,7 @@ require ( github.com/parnurzeal/gorequest v0.2.16 github.com/pkg/errors v0.9.1 github.com/pkg/sftp v1.13.1 + github.com/pyroscope-io/pyroscope v0.37.2 github.com/robertkrimen/terst v0.0.0-20140908162406-4b1c60b7cc23 github.com/sabhiram/go-gitignore v0.0.0-20201211210132-54b8a0bf510f github.com/shogo82148/androidbinary v1.0.2 @@ -150,7 +151,6 @@ require ( github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.55.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect - github.com/pyroscope-io/pyroscope v0.37.2 // indirect github.com/rancher/remotedialer v0.3.2 // indirect github.com/rancher/wrangler v0.8.11 // indirect github.com/recallsong/go-utils v1.1.2-0.20210826100715-fce05eefa294 // indirect