Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions actions/sonar/1.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--platform=$TARGETPLATFORM can remove.


COPY . /go/src/github.com/erda-project/erda-actions
WORKDIR /go/src/github.com/erda-project/erda-actions
Expand All @@ -7,20 +7,17 @@ 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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use erda-x base image, plz.


RUN yum install -y wget unzip
RUN apt-get update && apt install -y wget unzip curl ca-certificates

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already contains in erda-x base image.


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 && \
unzip -q sonar-scanner-cli-4.4.0.2170-linux.zip

# 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/"
Expand Down
2 changes: 1 addition & 1 deletion actions/sonar/1.0/dice.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 2 additions & 1 deletion actions/sonar/1.0/internal/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down