Skip to content

Commit 5668b60

Browse files
Merge pull request #132 from devtron-labs/release-candidate-v0.28.0
sync: Release candidate v0.28.0
2 parents 0a3d5e8 + e7058d8 commit 5668b60

File tree

82 files changed

+1385
-283
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+1385
-283
lines changed

chart-sync/Dockerfile

+14-11
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
11
FROM golang:1.22 AS build-env
22

3-
RUN apt update
4-
RUN apt install git gcc musl-dev make -y
5-
RUN go install github.com/google/wire/cmd/wire@latest
3+
RUN apt update && \
4+
apt install git gcc musl-dev make -y && \
5+
go install github.com/google/wire/cmd/wire@latest
66

77
WORKDIR /go/src/github.com/devtron-labs/chart-sync
8+
89
ADD . /go/src/github.com/devtron-labs/chart-sync
10+
911
RUN GOOS=linux make
1012

1113
FROM ubuntu
12-
RUN apt update
13-
RUN apt install ca-certificates -y
14-
RUN apt clean autoclean
15-
RUN apt autoremove -y && rm -rf /var/lib/apt/lists/*
16-
COPY --from=build-env /go/src/github.com/devtron-labs/chart-sync/chart-sync .
17-
18-
RUN useradd -ms /bin/bash devtron
19-
RUN chown -R devtron:devtron ./chart-sync
14+
15+
RUN apt update && \
16+
apt install ca-certificates -y && \
17+
apt clean autoclean && \
18+
apt autoremove -y && rm -rf /var/lib/apt/lists/* && \
19+
useradd -ms /bin/bash devtron
20+
21+
COPY --chown=devtron:devtron --from=build-env /go/src/github.com/devtron-labs/chart-sync/chart-sync .
22+
2023
USER devtron
2124

2225
CMD ["./chart-sync"]

chart-sync/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.22.4
55
toolchain go1.22.6
66

77
replace (
8-
github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250122120743-f9dc0038c36a
8+
github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250127104410-85d6bfe0b45f
99
helm.sh/helm/v3 v3.14.3 => github.com/devtron-labs/helm/v3 v3.14.1-0.20240401080259-90238cf69e42
1010
)
1111

chart-sync/go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr
5454
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
5555
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
5656
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
57-
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250122120743-f9dc0038c36a h1:KKPEVBfa4sXptJc/0ZVWcxePI/JNtzQl0ugnwTePvgk=
58-
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250122120743-f9dc0038c36a/go.mod h1:1QJJLpgJSkb5Jm9xPeKAk+kXb0QgBOOOgJj0cgYhAVA=
57+
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250127104410-85d6bfe0b45f h1:4wUbt+83DmpZFqYS69CJxNtBpSuCb58UwqOrWsZG82s=
58+
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250127104410-85d6bfe0b45f/go.mod h1:1QJJLpgJSkb5Jm9xPeKAk+kXb0QgBOOOgJj0cgYhAVA=
5959
github.com/devtron-labs/helm/v3 v3.14.1-0.20240401080259-90238cf69e42 h1:pJmK44QaSztOiZe0iQHNf0sdy5KwkAeceydyhOG4RaY=
6060
github.com/devtron-labs/helm/v3 v3.14.1-0.20240401080259-90238cf69e42/go.mod h1:v6myVbyseSBJTzhmeE39UcPLNv6cQK6qss3dvgAySaE=
6161
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=

chart-sync/vendor/github.com/devtron-labs/common-lib/utils/CommonUtils.go

+26-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

chart-sync/vendor/github.com/devtron-labs/common-lib/utils/FileUtil.go

+38
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

chart-sync/vendor/github.com/devtron-labs/common-lib/utils/bean/bean.go

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

chart-sync/vendor/modules.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ github.com/containerd/platforms
9393
# github.com/davecgh/go-spew v1.1.1
9494
## explicit
9595
github.com/davecgh/go-spew/spew
96-
# github.com/devtron-labs/common-lib v0.0.0 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250122120743-f9dc0038c36a
96+
# github.com/devtron-labs/common-lib v0.0.0 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250127104410-85d6bfe0b45f
9797
## explicit; go 1.21
9898
github.com/devtron-labs/common-lib/fetchAllEnv
9999
github.com/devtron-labs/common-lib/git-manager/util
@@ -790,4 +790,4 @@ sigs.k8s.io/structured-merge-diff/v4/value
790790
# sigs.k8s.io/yaml v1.3.0
791791
## explicit; go 1.12
792792
sigs.k8s.io/yaml
793-
# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250122120743-f9dc0038c36a
793+
# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250127104410-85d6bfe0b45f

ci-runner/Dockerfile

+25-17
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,46 @@
1-
####--------------
21
FROM golang:1.21-alpine3.18 AS build-env
32

4-
RUN apk add --no-cache git gcc musl-dev
5-
RUN apk add --update make
3+
RUN apk add --no-cache git gcc musl-dev && \
4+
apk add --update make
65

76
WORKDIR /go/src/github.com/devtron-labs/cirunner
8-
ADD . /go/src/github.com/devtron-labs/cirunner/
7+
8+
# ADD . /go/src/github.com/devtron-labs/cirunner/
99
COPY . .
10+
1011
# Build the binary
1112
RUN CGO_ENABLED=0 GOOS=linux go build -buildvcs=false -a -installsuffix cgo -o /go/bin/cirunner
1213

1314
FROM docker:20.10.24-dind
1415
# All these steps will be cached
1516
#RUN apk add --no-cache ca-certificates
16-
RUN apk update && apk add --no-cache --virtual .build-deps && apk add bash && apk add make && apk add curl && apk add git && apk add zip && apk add jq
17-
RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime
18-
RUN apk -Uuv add groff less python3 py3-pip
19-
RUN pip3 install awscli
20-
RUN apk --purge -v del py-pip
21-
RUN rm /var/cache/apk/*
17+
18+
RUN apk update && apk add --no-cache --virtual .build-deps && apk add bash && apk add make && apk add curl && apk add git && apk add zip && apk add jq && \
19+
ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime && \
20+
apk -Uuv add groff less python3 py3-pip && \
21+
pip3 install awscli && \
22+
apk --purge -v del py-pip && \
23+
rm /var/cache/apk/*
24+
2225
COPY --from=docker/compose:latest /usr/local/bin/docker-compose /usr/bin/docker-compose
2326

24-
COPY ./buildpack.json /buildpack.json
25-
COPY ./git-ask-pass.sh /git-ask-pass.sh
26-
RUN chmod +x /git-ask-pass.sh
27+
COPY ./buildpack.json ./git-ask-pass.sh /
28+
# COPY ./git-ask-pass.sh /git-ask-pass.sh
2729

28-
RUN (curl -sSL "https://github.com/buildpacks/pack/releases/download/v0.27.0/pack-v0.27.0-linux.tgz" | tar -C /usr/local/bin/ --no-same-owner -xzv pack)
30+
RUN chmod +x /git-ask-pass.sh && \
31+
(curl -sSL "https://github.com/buildpacks/pack/releases/download/v0.27.0/pack-v0.27.0-linux.tgz" | tar -C /usr/local/bin/ --no-same-owner -xzv pack)
2932

3033
COPY --from=build-env /go/bin/cirunner .
34+
3135
COPY ./ssh-config /root/.ssh/config
32-
RUN chmod 644 /root/.ssh/config
33-
RUN mkdir -p /etc/docker
36+
37+
RUN chmod 644 /root/.ssh/config && \
38+
mkdir -p /etc/docker && \
39+
mkdir -p /root/.docker/buildx
40+
3441
COPY docker-daemon.json /etc/docker/daemon.json
35-
RUN mkdir -p /root/.docker/buildx
42+
43+
3644
COPY buildkitd.default.toml /root/.docker/buildx/buildkitd.default.toml
3745

3846
# passing PARENT_MODE as argument to cirunner as default behavior

ci-runner/Dockerfile-v27

+18-15
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
####--------------
21
FROM golang:1.21-alpine3.18 AS build-env
32

4-
RUN apk add --no-cache git gcc musl-dev
5-
RUN apk add --update make
3+
RUN apk add --no-cache git gcc musl-dev && \
4+
apk add --update make
65

76
WORKDIR /go/src/github.com/devtron-labs/cirunner
7+
88
ADD . /go/src/github.com/devtron-labs/cirunner/
9+
910
COPY . .
1011
# Build the binary
1112
RUN CGO_ENABLED=0 GOOS=linux go build -buildvcs=false -a -installsuffix cgo -o /go/bin/cirunner
@@ -14,24 +15,26 @@ RUN CGO_ENABLED=0 GOOS=linux go build -buildvcs=false -a -installsuffix cgo -o /
1415
FROM docker:27.3-dind
1516
# All these steps will be cached
1617
#RUN apk add --no-cache ca-certificates
17-
RUN apk update && apk add --no-cache --virtual .build-deps && apk add bash && apk add make && apk add curl && apk add git && apk add zip && apk add jq
18-
RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime
19-
RUN apk -Uuv add groff less python3 py3-pip pipx
20-
RUN pipx ensurepath && pipx install awscli
21-
RUN cp /root/.local/bin/aws* /usr/local/bin
22-
RUN apk --purge -v del py-pip
23-
RUN rm /var/cache/apk/*
18+
19+
RUN apk update && apk add --no-cache --virtual .build-deps && apk add bash && apk add make && apk add curl && apk add git && apk add zip && apk add jq && \
20+
ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime && \
21+
apk -Uuv add groff less python3 py3-pip pipx && \
22+
pipx ensurepath && pipx install awscli && \
23+
cp /root/.local/bin/aws* /usr/local/bin && \
24+
apk --purge -v del py-pip && \
25+
rm /var/cache/apk/*
26+
2427
COPY --from=docker/compose:1.29.2 /usr/local/bin/docker-compose /usr/bin/docker-compose
2528

26-
COPY ./buildpack.json /buildpack.json
27-
COPY ./git-ask-pass.sh /git-ask-pass.sh
28-
RUN chmod +x /git-ask-pass.sh
29+
COPY ./buildpack.json /git-ask-pass.sh /
2930

30-
RUN (curl -sSL "https://github.com/buildpacks/pack/releases/download/v0.27.0/pack-v0.27.0-linux.tgz" | tar -C /usr/local/bin/ --no-same-owner -xzv pack)
31+
# COPY ./git-ask-pass.sh /git-ask-pass.sh
32+
RUN chmod +x /git-ask-pass.sh && \
33+
(curl -sSL "https://github.com/buildpacks/pack/releases/download/v0.27.0/pack-v0.27.0-linux.tgz" | tar -C /usr/local/bin/ --no-same-owner -xzv pack)
3134

3235
COPY --from=build-env /go/bin/cirunner .
3336
COPY ./ssh-config /root/.ssh/config
3437
RUN chmod 644 /root/.ssh/config
3538

3639
# passing PARENT_MODE as argument to cirunner as default behavior
37-
ENTRYPOINT ["./cirunner", "PARENT_MODE"]
40+
ENTRYPOINT ["./cirunner", "PARENT_MODE"]

ci-runner/executor/StageExecutor.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func (impl *StageExecutorImpl) RunCiCdSteps(stepType helper.StepType, ciCdReques
7575

7676
if stageInfoLoggingRequired {
7777
log.Println(util.DEVTRON, "stage logging required")
78-
err = util.ExecuteWithStageInfoLog(step.Name, executeStep)
78+
err = util.ExecuteWithStageInfoLog(helper.GetPrePostStageDisplayName(step.Name, stepType), executeStep)
7979
} else {
8080
log.Println(util.DEVTRON, "stage logging not required")
8181
err = executeStep()
@@ -144,6 +144,9 @@ func (impl *StageExecutorImpl) RunCiCdStep(stepType helper.StepType, ciCdRequest
144144
var vars []*commonBean.VariableObject
145145
if stepType == helper.STEP_TYPE_REF_PLUGIN {
146146
vars, err = deduceVariables(step.InputVars, scriptEnvVariables, nil, nil, stageVariable)
147+
} else if stepType == helper.STEP_TYPE_SCANNING {
148+
// only global variables are supported here in image scanning step
149+
vars, err = deduceVariables(step.InputVars, scriptEnvVariables, nil, nil, nil)
147150
} else {
148151
log.Printf("running step : %s\n", step.Name)
149152
if stepType == helper.STEP_TYPE_PRE {

ci-runner/executor/adaptor/ImageScanAdaptor.go

+13
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
package adaptor
1818

1919
import (
20+
bean2 "github.com/devtron-labs/ci-runner/executor/stage/bean"
21+
util2 "github.com/devtron-labs/ci-runner/executor/util"
2022
"github.com/devtron-labs/ci-runner/helper"
2123
"github.com/devtron-labs/common-lib/constants"
2224
"github.com/devtron-labs/common-lib/imageScan/bean"
@@ -42,3 +44,14 @@ func GetImageScanEvent(dest, digest string, commonWorkflowRequest *helper.Common
4244
ImageScanRetryDelay: commonWorkflowRequest.ImageScanRetryDelay,
4345
}
4446
}
47+
func GetImageScannerExecutorBean(ciCdRequest *helper.CiCdTriggerEvent, scriptEnvs *util2.ScriptEnvVariables, refStageMap map[int][]*helper.StepObject, metrics *helper.CIMetrics, artifactUploaded bool, dest string, digest string) *bean2.ImageScanningExecutorBean {
48+
return &bean2.ImageScanningExecutorBean{
49+
CiCdRequest: ciCdRequest,
50+
ScriptEnvs: scriptEnvs,
51+
RefStageMap: refStageMap,
52+
Metrics: metrics,
53+
ArtifactUploaded: artifactUploaded,
54+
Dest: dest,
55+
Digest: digest,
56+
}
57+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package helper
2+
3+
import util2 "github.com/devtron-labs/ci-runner/executor/util"
4+
5+
func SetKeyValueInGlobalSystemEnv(scriptEnvs *util2.ScriptEnvVariables, key, value string) {
6+
scriptEnvs.SystemEnv[key] = value
7+
}

ci-runner/executor/stage/bean/bean.go

+19
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,28 @@
1616

1717
package bean
1818

19+
import (
20+
util2 "github.com/devtron-labs/ci-runner/executor/util"
21+
"github.com/devtron-labs/ci-runner/helper"
22+
)
23+
1924
const (
2025
ExternalCiArtifact = "externalCiArtifact"
2126
ImageDigest = "imageDigest"
2227
UseAppDockerConfig = "useAppDockerConfig"
2328
CiProjectDetails = "ciProjectDetails"
2429
)
30+
const (
31+
DigestGlobalEnvKey = "DIGEST"
32+
ScanToolIdGlobalEnvKey = "SCAN_TOOL_ID"
33+
)
34+
35+
type ImageScanningExecutorBean struct {
36+
CiCdRequest *helper.CiCdTriggerEvent
37+
ScriptEnvs *util2.ScriptEnvVariables
38+
RefStageMap map[int][]*helper.StepObject
39+
Metrics *helper.CIMetrics
40+
ArtifactUploaded bool
41+
Dest string
42+
Digest string
43+
}

0 commit comments

Comments
 (0)