Skip to content

Commit 9746989

Browse files
committed
Merge branch 'main' of github.com:devtron-labs/devtron into pre-cd-fix
2 parents 6ba7dd2 + d5ba44f commit 9746989

File tree

176 files changed

+8989
-2898
lines changed

Some content is hidden

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

176 files changed

+8989
-2898
lines changed

Dockerfile

Lines changed: 30 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,46 @@
11
FROM golang:1.21 AS build-env
22

3-
RUN echo $GOPATH
4-
RUN apt update
5-
RUN apt install git gcc musl-dev make -y
6-
RUN go install github.com/google/wire/cmd/wire@latest
3+
RUN echo $GOPATH && \
4+
apt update && \
5+
apt install git gcc musl-dev make -y && \
6+
go install github.com/google/wire/cmd/wire@latest
7+
78
WORKDIR /go/src/github.com/devtron-labs/devtron
9+
810
ADD . /go/src/github.com/devtron-labs/devtron/
11+
912
ADD ./vendor/github.com/Microsoft/ /go/src/github.com/devtron-labs/devtron/vendor/github.com/microsoft/
10-
RUN GOOS=linux make build-all
13+
14+
RUN GOOS=linux make build
1115

1216
# uncomment this post build arg
1317
FROM ubuntu:22.04@sha256:1b8d8ff4777f36f19bfe73ee4df61e3a0b789caeff29caa019539ec7c9a57f95 as devtron-all
1418

15-
RUN apt update
16-
RUN apt install ca-certificates git curl -y
17-
RUN apt clean autoclean
18-
RUN apt autoremove -y && rm -rf /var/lib/apt/lists/*
19-
COPY --from=build-env /go/src/github.com/devtron-labs/devtron/devtron .
20-
COPY --from=build-env /go/src/github.com/devtron-labs/devtron/auth_model.conf .
21-
#COPY --from=build-env /go/src/github.com/devtron-labs/devtron/vendor/github.com/argoproj/argo-cd/assets/ /go/src/github.com/devtron-labs/devtron/vendor/github.com/argoproj/argo-cd/assets
22-
COPY --from=build-env /go/src/github.com/devtron-labs/devtron/argocd-assets/ /go/src/github.com/devtron-labs/devtron/vendor/github.com/argoproj/argo-cd/assets
23-
COPY --from=build-env /go/src/github.com/devtron-labs/devtron/scripts/devtron-reference-helm-charts scripts/devtron-reference-helm-charts
24-
COPY --from=build-env /go/src/github.com/devtron-labs/devtron/scripts/sql scripts/sql
25-
COPY --from=build-env /go/src/github.com/devtron-labs/devtron/scripts/casbin scripts/casbin
26-
COPY --from=build-env /go/src/github.com/devtron-labs/devtron/scripts/argo-assets/APPLICATION_TEMPLATE.tmpl scripts/argo-assets/APPLICATION_TEMPLATE.tmpl
27-
28-
COPY ./git-ask-pass.sh /git-ask-pass.sh
29-
RUN chmod +x /git-ask-pass.sh
30-
31-
RUN useradd -ms /bin/bash devtron
32-
RUN chown -R devtron:devtron ./devtron
33-
RUN chown -R devtron:devtron ./git-ask-pass.sh
34-
RUN chown -R devtron:devtron ./auth_model.conf
35-
RUN chown -R devtron:devtron ./scripts
19+
RUN apt update && \
20+
apt install ca-certificates git curl -y && \
21+
apt clean autoclean && \
22+
apt autoremove -y && \
23+
rm -rf /var/lib/apt/lists/* && \
24+
useradd -ms /bin/bash devtron
3625

37-
USER devtron
26+
COPY --chown=devtron:devtron --from=build-env /go/src/github.com/devtron-labs/devtron/devtron .
27+
28+
COPY --chown=devtron:devtron --from=build-env /go/src/github.com/devtron-labs/devtron/auth_model.conf .
3829

39-
CMD ["./devtron"]
30+
COPY --chown=devtron:devtron --from=build-env /go/src/github.com/devtron-labs/devtron/argocd-assets/ /go/src/github.com/devtron-labs/devtron/vendor/github.com/argoproj/argo-cd/assets
4031

32+
COPY --chown=devtron:devtron --from=build-env /go/src/github.com/devtron-labs/devtron/scripts/devtron-reference-helm-charts scripts/devtron-reference-helm-charts
4133

42-
#FROM alpine:3.15.0 as devtron-ea
34+
COPY --chown=devtron:devtron --from=build-env /go/src/github.com/devtron-labs/devtron/scripts/sql scripts/sql
4335

44-
#RUN apk add --no-cache ca-certificates
45-
#COPY --from=build-env /go/src/github.com/devtron-labs/devtron/auth_model.conf .
46-
#COPY --from=build-env /go/src/github.com/devtron-labs/devtron/cmd/external-app/devtron-ea .
36+
COPY --chown=devtron:devtron --from=build-env /go/src/github.com/devtron-labs/devtron/scripts/casbin scripts/casbin
4737

48-
#COPY --from=build-env /go/src/github.com/devtron-labs/devtron/vendor/github.com/argoproj/argo-cd/assets/ /go/src/github.com/devtron-labs/devtron/vendor/github.com/argoproj/argo-cd/assets
49-
#COPY --from=build-env /go/src/github.com/devtron-labs/devtron/scripts/devtron-reference-helm-charts scripts/devtron-reference-helm-charts
50-
#COPY --from=build-env /go/src/github.com/devtron-labs/devtron/scripts/argo-assets/APPLICATION_TEMPLATE.JSON scripts/argo-assets/APPLICATION_TEMPLATE.JSON
38+
COPY --chown=devtron:devtron --from=build-env /go/src/github.com/devtron-labs/devtron/scripts/argo-assets/APPLICATION_TEMPLATE.tmpl scripts/argo-assets/APPLICATION_TEMPLATE.tmpl
39+
40+
COPY --chown=devtron:devtron ./git-ask-pass.sh /git-ask-pass.sh
41+
42+
RUN chmod +x /git-ask-pass.sh
43+
44+
USER devtron
5145

52-
#CMD ["./devtron-ea"]
46+
CMD ["./devtron"]

DockerfileEA

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,40 @@
11
FROM golang:1.21 AS build-env
22

3-
RUN echo $GOPATH
4-
RUN apt update
5-
RUN apt install git gcc musl-dev make -y
6-
RUN go install github.com/google/wire/cmd/wire@latest
3+
RUN echo $GOPATH && \
4+
apt update && \
5+
apt install git gcc musl-dev make -y && \
6+
go install github.com/google/wire/cmd/wire@latest
7+
78
WORKDIR /go/src/github.com/devtron-labs/devtron
9+
810
ADD . /go/src/github.com/devtron-labs/devtron/
11+
912
ADD ./vendor/github.com/Microsoft/ /go/src/github.com/devtron-labs/devtron/vendor/github.com/microsoft/
13+
1014
RUN GOOS=linux make build-all
1115

1216
FROM ubuntu:22.04@sha256:1b8d8ff4777f36f19bfe73ee4df61e3a0b789caeff29caa019539ec7c9a57f95 as devtron-ea
1317

14-
RUN apt update
15-
RUN apt install ca-certificates curl -y
16-
RUN apt clean autoclean
17-
RUN apt autoremove -y && rm -rf /var/lib/apt/lists/*
18-
COPY --from=build-env /go/src/github.com/devtron-labs/devtron/auth_model.conf .
19-
COPY --from=build-env /go/src/github.com/devtron-labs/devtron/cmd/external-app/devtron-ea .
18+
RUN apt update && \
19+
apt install ca-certificates curl -y && \
20+
apt clean autoclean && \
21+
apt autoremove -y && rm -rf /var/lib/apt/lists/* && \
22+
useradd -ms /bin/bash devtron
23+
24+
COPY --chown=devtron:devtron --from=build-env /go/src/github.com/devtron-labs/devtron/auth_model.conf .
25+
26+
COPY --chown=devtron:devtron --from=build-env /go/src/github.com/devtron-labs/devtron/cmd/external-app/devtron-ea .
2027

21-
#COPY --from=build-env /go/src/github.com/devtron-labs/devtron/vendor/github.com/argoproj/argo-cd/assets/ /go/src/github.com/devtron-labs/devtron/vendor/github.com/argoproj/argo-cd/assets
2228
COPY --from=build-env /go/src/github.com/devtron-labs/devtron/argocd-assets/ /go/src/github.com/devtron-labs/devtron/vendor/github.com/argoproj/argo-cd/assets
29+
2330
COPY --from=build-env /go/src/github.com/devtron-labs/devtron/scripts/devtron-reference-helm-charts scripts/devtron-reference-helm-charts
31+
2432
COPY --from=build-env /go/src/github.com/devtron-labs/devtron/scripts/sql scripts/sql
33+
2534
COPY --from=build-env /go/src/github.com/devtron-labs/devtron/scripts/casbin scripts/casbin
35+
2636
COPY --from=build-env /go/src/github.com/devtron-labs/devtron/scripts/argo-assets/APPLICATION_TEMPLATE.tmpl scripts/argo-assets/APPLICATION_TEMPLATE.tmpl
2737

28-
RUN useradd -ms /bin/bash devtron
29-
RUN chown -R devtron:devtron ./devtron-ea
30-
RUN chown -R devtron:devtron ./auth_model.conf
3138
RUN chown -R devtron:devtron ./scripts
3239

3340
USER devtron

Wire.go

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ import (
4343
"github.com/devtron-labs/devtron/api/externalLink"
4444
fluxApplication "github.com/devtron-labs/devtron/api/fluxApplication"
4545
client "github.com/devtron-labs/devtron/api/helm-app"
46-
"github.com/devtron-labs/devtron/api/infraConfig"
4746
"github.com/devtron-labs/devtron/api/k8s"
4847
"github.com/devtron-labs/devtron/api/module"
4948
"github.com/devtron-labs/devtron/api/resourceScan"
@@ -79,8 +78,10 @@ import (
7978
"github.com/devtron-labs/devtron/cel"
8079
"github.com/devtron-labs/devtron/client/argocdServer"
8180
"github.com/devtron-labs/devtron/client/argocdServer/application"
81+
"github.com/devtron-labs/devtron/client/argocdServer/bean"
8282
"github.com/devtron-labs/devtron/client/argocdServer/certificate"
8383
cluster2 "github.com/devtron-labs/devtron/client/argocdServer/cluster"
84+
acdConfig "github.com/devtron-labs/devtron/client/argocdServer/config"
8485
"github.com/devtron-labs/devtron/client/argocdServer/connection"
8586
"github.com/devtron-labs/devtron/client/argocdServer/repoCredsK8sClient"
8687
repocreds "github.com/devtron-labs/devtron/client/argocdServer/repocreds"
@@ -129,7 +130,8 @@ import (
129130
"github.com/devtron-labs/devtron/pkg/chart/gitOpsConfig"
130131
chartRepoRepository "github.com/devtron-labs/devtron/pkg/chartRepo/repository"
131132
"github.com/devtron-labs/devtron/pkg/commonService"
132-
"github.com/devtron-labs/devtron/pkg/configDiff"
133+
"github.com/devtron-labs/devtron/pkg/config"
134+
"github.com/devtron-labs/devtron/pkg/config/configDiff"
133135
delete2 "github.com/devtron-labs/devtron/pkg/delete"
134136
deployment2 "github.com/devtron-labs/devtron/pkg/deployment"
135137
"github.com/devtron-labs/devtron/pkg/deployment/common"
@@ -143,17 +145,14 @@ import (
143145
"github.com/devtron-labs/devtron/pkg/generateManifest"
144146
"github.com/devtron-labs/devtron/pkg/gitops"
145147
"github.com/devtron-labs/devtron/pkg/imageDigestPolicy"
146-
repository11 "github.com/devtron-labs/devtron/pkg/infraConfig/repository"
147-
infraConfigService "github.com/devtron-labs/devtron/pkg/infraConfig/service"
148-
"github.com/devtron-labs/devtron/pkg/infraConfig/units"
148+
"github.com/devtron-labs/devtron/pkg/infraConfig"
149149
"github.com/devtron-labs/devtron/pkg/kubernetesResourceAuditLogs"
150150
repository7 "github.com/devtron-labs/devtron/pkg/kubernetesResourceAuditLogs/repository"
151151
"github.com/devtron-labs/devtron/pkg/notifier"
152152
"github.com/devtron-labs/devtron/pkg/pipeline"
153153
"github.com/devtron-labs/devtron/pkg/pipeline/executors"
154154
history3 "github.com/devtron-labs/devtron/pkg/pipeline/history"
155155
repository3 "github.com/devtron-labs/devtron/pkg/pipeline/history/repository"
156-
"github.com/devtron-labs/devtron/pkg/pipeline/infraProviders"
157156
repository5 "github.com/devtron-labs/devtron/pkg/pipeline/repository"
158157
"github.com/devtron-labs/devtron/pkg/pipeline/types"
159158
"github.com/devtron-labs/devtron/pkg/plugin"
@@ -229,7 +228,7 @@ func InitializeApp() (*App, error) {
229228
connection.SettingsManager,
230229
// auth.GetConfigForDevtronApps,
231230

232-
connection.GetConfig,
231+
bean.GetConfig,
233232
wire.Bind(new(session2.ServiceClient), new(*middleware.LoginService)),
234233

235234
sse.NewSSE,
@@ -278,20 +277,6 @@ func InitializeApp() (*App, error) {
278277
wire.Bind(new(dashboardEvent.DashboardTelemetryRouter),
279278
new(*dashboardEvent.DashboardTelemetryRouterImpl)),
280279

281-
repository11.NewInfraProfileRepositoryImpl,
282-
wire.Bind(new(repository11.InfraConfigRepository), new(*repository11.InfraConfigRepositoryImpl)),
283-
284-
units.NewUnits,
285-
infraConfigService.NewInfraConfigServiceImpl,
286-
wire.Bind(new(infraConfigService.InfraConfigService), new(*infraConfigService.InfraConfigServiceImpl)),
287-
infraProviders.NewInfraProviderImpl,
288-
wire.Bind(new(infraProviders.InfraProvider), new(*infraProviders.InfraProviderImpl)),
289-
infraConfig.NewInfraConfigRestHandlerImpl,
290-
wire.Bind(new(infraConfig.InfraConfigRestHandler), new(*infraConfig.InfraConfigRestHandlerImpl)),
291-
292-
infraConfig.NewInfraProfileRouterImpl,
293-
wire.Bind(new(infraConfig.InfraConfigRouter), new(*infraConfig.InfraConfigRouterImpl)),
294-
295280
router.NewMuxRouter,
296281

297282
app2.NewAppRepositoryImpl,
@@ -526,6 +511,10 @@ func InitializeApp() (*App, error) {
526511
chartConfig.NewConfigMapRepositoryImpl,
527512
wire.Bind(new(chartConfig.ConfigMapRepository), new(*chartConfig.ConfigMapRepositoryImpl)),
528513

514+
config.WireSet,
515+
516+
infraConfig.WireSet,
517+
529518
notifier.NewSESNotificationServiceImpl,
530519
wire.Bind(new(notifier.SESNotificationService), new(*notifier.SESNotificationServiceImpl)),
531520

@@ -926,6 +915,7 @@ func InitializeApp() (*App, error) {
926915
wire.Bind(new(resourceQualifiers.QualifierMappingService), new(*resourceQualifiers.QualifierMappingServiceImpl)),
927916

928917
argocdServer.NewArgoClientWrapperServiceImpl,
918+
argocdServer.NewArgoClientWrapperServiceEAImpl,
929919
wire.Bind(new(argocdServer.ArgoClientWrapperService), new(*argocdServer.ArgoClientWrapperServiceImpl)),
930920

931921
pipeline.NewPluginInputVariableParserImpl,
@@ -937,7 +927,7 @@ func InitializeApp() (*App, error) {
937927
wire.Bind(new(imageDigestPolicy.ImageDigestPolicyService), new(*imageDigestPolicy.ImageDigestPolicyServiceImpl)),
938928

939929
certificate.NewServiceClientImpl,
940-
wire.Bind(new(certificate.Client), new(*certificate.ServiceClientImpl)),
930+
wire.Bind(new(certificate.ServiceClient), new(*certificate.ServiceClientImpl)),
941931

942932
appStoreRestHandler.FullModeWireSet,
943933

@@ -950,14 +940,17 @@ func InitializeApp() (*App, error) {
950940
common.NewDeploymentConfigServiceImpl,
951941
wire.Bind(new(common.DeploymentConfigService), new(*common.DeploymentConfigServiceImpl)),
952942

953-
repoCredsK8sClient.NewRepositorySecret,
954-
wire.Bind(new(repoCredsK8sClient.RepositoryCreds), new(*repoCredsK8sClient.RepositorySecretImpl)),
943+
repoCredsK8sClient.NewRepositoryCredsK8sClientImpl,
944+
wire.Bind(new(repoCredsK8sClient.RepositoryCredsK8sClient), new(*repoCredsK8sClient.RepositoryCredsK8sClientImpl)),
955945

956946
repocreds.NewServiceClientImpl,
957947
wire.Bind(new(repocreds.ServiceClient), new(*repocreds.ServiceClientImpl)),
958948

959949
dbMigration.NewDbMigrationServiceImpl,
960950
wire.Bind(new(dbMigration.DbMigration), new(*dbMigration.DbMigrationServiceImpl)),
951+
952+
acdConfig.NewArgoCDConfigGetter,
953+
wire.Bind(new(acdConfig.ArgoCDConfigGetter), new(*acdConfig.ArgoCDConfigGetterImpl)),
961954
)
962955
return &App{}, nil
963956
}

api/appStore/InstalledAppRestHandler.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ import (
3737
"time"
3838

3939
"github.com/devtron-labs/devtron/api/restHandler/common"
40-
"github.com/devtron-labs/devtron/client/argocdServer/application"
4140
"github.com/devtron-labs/devtron/client/cron"
4241
"github.com/devtron-labs/devtron/internal/constants"
4342
"github.com/devtron-labs/devtron/internal/middleware"
@@ -84,7 +83,6 @@ type InstalledAppRestHandlerImpl struct {
8483
chartGroupService chartGroup.ChartGroupService
8584
validator *validator.Validate
8685
clusterService cluster.ClusterService
87-
acdServiceClient application.ServiceClient
8886
appStoreDeploymentService service.AppStoreDeploymentService
8987
appStoreDeploymentDBService service.AppStoreDeploymentDBService
9088
helmAppClient client.HelmAppClient
@@ -100,7 +98,7 @@ func NewInstalledAppRestHandlerImpl(Logger *zap.SugaredLogger, userAuthService u
10098
installedAppService FullMode.InstalledAppDBExtendedService,
10199
installedAppResourceService resource.InstalledAppResourceService,
102100
chartGroupService chartGroup.ChartGroupService, validator *validator.Validate, clusterService cluster.ClusterService,
103-
acdServiceClient application.ServiceClient, appStoreDeploymentService service.AppStoreDeploymentService,
101+
appStoreDeploymentService service.AppStoreDeploymentService,
104102
appStoreDeploymentDBService service.AppStoreDeploymentDBService,
105103
helmAppClient client.HelmAppClient,
106104

@@ -120,7 +118,6 @@ func NewInstalledAppRestHandlerImpl(Logger *zap.SugaredLogger, userAuthService u
120118
chartGroupService: chartGroupService,
121119
validator: validator,
122120
clusterService: clusterService,
123-
acdServiceClient: acdServiceClient,
124121
appStoreDeploymentService: appStoreDeploymentService,
125122
appStoreDeploymentDBService: appStoreDeploymentDBService,
126123
helmAppClient: helmAppClient,

0 commit comments

Comments
 (0)