Skip to content

Commit bbb5c73

Browse files
authored
Merge pull request #2770 from devtron-labs/feat/flux-deployment
feat: add flux in deployment types
2 parents 79eece1 + 123ba6c commit bbb5c73

Some content is hidden

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

49 files changed

+701
-485
lines changed

.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,5 @@ FEATURE_ASK_DEVTRON_EXPERT=false
7373
FEATURE_MANAGE_TRAFFIC_ENABLE=false
7474
FEATURE_REDFISH_NODE_ENABLE=false
7575
FEATURE_INFRA_PROVISION_INFO_BLOCK_HIDE=false
76+
FEATURE_FLUX_DEPLOYMENTS_ENABLE=false
77+
FEATURE_LINK_EXTERNAL_FLUX_ENABLE=false

Dockerfile

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,35 +15,25 @@ RUN yarn install --immutable --network-timeout 600000
1515

1616
COPY . .
1717

18-
RUN echo `git rev-parse --short HEAD` > health.html && \
18+
RUN echo `git rev-parse --short=9 HEAD` > health.html && \
1919
echo "" >> .env && \
20-
echo "SENTRY_RELEASE_VERSION=dashboard@$(git rev-parse --short HEAD)" >> .env && \
21-
yarn build
20+
echo "SENTRY_RELEASE_VERSION=dashboard@$(git rev-parse --short=9 HEAD)" >> .env
2221

23-
FROM fholzer/nginx-brotli:v1.26.2
22+
RUN yarn build
2423

25-
# Install bash
26-
RUN apk add --no-cache bash shadow
27-
28-
RUN useradd -m -s /bin/bash devtron
24+
FROM nginx:stable
2925

26+
RUN useradd -ms /bin/bash devtron
3027
COPY --from=builder /app/dist/ /usr/share/nginx/html
3128
COPY ./nginx.conf /etc/nginx/nginx.conf
3229
COPY ./nginx-default.conf /etc/nginx/conf.d/default.conf
33-
3430
WORKDIR /usr/share/nginx/html
31+
COPY --from=builder /app/./env.sh .
32+
COPY --from=builder /app/.env .
33+
COPY --from=builder /app/health.html .
3534

36-
37-
COPY --from=builder /app/env.sh .
38-
COPY --from=builder /app/.env .
39-
COPY --from=builder /app/health.html .
40-
35+
# Make our shell script executable
4136
RUN chown -R devtron:devtron /usr/share/nginx/html && \
42-
chmod +x env.sh
43-
37+
chmod +x env.sh
4438
USER devtron
45-
46-
# Override the default ENTRYPOINT to allow shell scripting as fholzer/nginx-brotli has by-default entrypoint of nginx
47-
ENTRYPOINT ["/bin/bash", "-c"]
48-
49-
CMD ["./env.sh && nginx -g 'daemon off;'"]
39+
CMD ["/bin/bash", "-c", "/usr/share/nginx/html/env.sh && nginx -g \"daemon off;\""]

config.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,7 @@
5050
| FEATURE_USER_DEFINED_GITOPS_REPO_ENABLE | false | If enabled user can pass the manual gitops repo |
5151
| SENTRY_RELEASE_VERSION | | Sentry release Version |
5252
| LOGIN_PAGE_IMAGE | | Login page image url |
53+
| FEATURE_FLUX_DEPLOYMENTS_ENABLE | false | Enables flux cd deployment type for devtron apps and devtron charts |
54+
| FEATURE_LINK_EXTERNAL_FLUX_ENABLE | false | Enables external flux cd migration |
5355

5456
# DASHBOARD CONFIG SECRET

nginx.conf

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ http {
2020
#tcp_nopush on;
2121
keepalive_timeout 65;
2222

23-
# gzip compression
2423
gzip on;
2524
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml;
2625
gzip_vary on;
@@ -29,10 +28,9 @@ http {
2928
gzip_comp_level 6;
3029
gzip_static on;
3130

32-
# btrotli compression
33-
brotli on;
31+
brotli off;
3432
brotli_comp_level 6;
35-
brotli_static on;
33+
brotli_static on; # enabling this will ensure to serve pre-compressed file only
3634
brotli_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml;
3735

3836
include /etc/nginx/conf.d/*.conf;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"homepage": "/dashboard",
66
"dependencies": {
7-
"@devtron-labs/devtron-fe-common-lib": "1.16.0-pre-3",
7+
"@devtron-labs/devtron-fe-common-lib": "1.16.0-pre-5",
88
"@esbuild-plugins/node-globals-polyfill": "0.2.3",
99
"@rjsf/core": "^5.13.3",
1010
"@rjsf/utils": "^5.13.3",

src/Pages/App/Configurations/WorkflowEditor/CDPipelineDeploymentAppType/CDPipelineDeploymentAppType.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ export const CDPipelineDeploymentAppType = ({
3434
isGitOpsRepoNotConfigured={isGitOpsRepoNotConfigured}
3535
gitOpsRepoConfigInfoBar={gitOpsRepoConfigInfoBar}
3636
areGitopsCredentialsConfigured={!isGitOpsInstalledButNotConfigured}
37+
// Want to show this when gitops module is installed, does not matter if it is configured or not
38+
showGitOpsOption={!noGitOpsModuleInstalledAndConfigured || isGitOpsInstalledButNotConfigured}
3739
/>
3840
</div>
3941
)

src/Pages/App/Configurations/WorkflowEditor/CreateCICDPipeline/CreateCICDPipeline.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export const CreateCICDPipeline = ({
113113
}
114114
}
115115

116-
if (deploymentAppType === DeploymentAppTypes.GITOPS && isGitOpsInstalledButNotConfigured) {
116+
if (deploymentAppType === DeploymentAppTypes.ARGO && isGitOpsInstalledButNotConfigured) {
117117
ToastManager.showToast({
118118
variant: ToastVariantType.error,
119119
title: 'GitOps credentials not configured',

src/Pages/App/Configurations/WorkflowEditor/utils.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const checkForGitOpsRepoNotConfigured = ({
4949
}
5050

5151
const isGitOpsRepoNotConfiguredAndOptionsVisible =
52-
deploymentAppType === DeploymentAppTypes.GITOPS &&
52+
deploymentAppType === DeploymentAppTypes.ARGO &&
5353
isGitOpsRepoNotConfigured &&
5454
!window._env_.HIDE_GITOPS_OR_HELM_OPTION
5555

src/components/CIPipelineN/VariableDataTable/validations.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -155,14 +155,6 @@ export const validateInputOutputVariableCell = ({
155155
}
156156
}
157157

158-
// test for max length if variable is string
159-
if (key === 'val' && format === VariableTypeFormat.STRING && variableValue && !!value && value.length > 255) {
160-
return {
161-
errorMessages: [VARIABLE_DATA_TABLE_CELL_ERROR_MSGS.MAX_LENGTH_255],
162-
isValid: false,
163-
}
164-
}
165-
166158
return { errorMessages: [], isValid: true }
167159
}
168160

src/components/app/details/appDetails/AppDetails.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ const Details: React.FC<DetailsType> = ({
262262
useState<DeploymentStatusDetailsBreakdownDataType>({
263263
...(isVirtualEnvRef.current && processVirtualEnvironmentDeploymentData
264264
? processVirtualEnvironmentDeploymentData()
265-
: processDeploymentStatusDetailsData()),
265+
: processDeploymentStatusDetailsData(appDetails?.deploymentAppType)),
266266
deploymentStatus: DEFAULT_STATUS,
267267
})
268268
const isConfigDriftEnabled: boolean = window._env_.FEATURE_CONFIG_DRIFT_ENABLE && !!ConfigDriftModal
@@ -287,7 +287,7 @@ const Details: React.FC<DetailsType> = ({
287287
const processedDeploymentStatusDetailsData =
288288
isVirtualEnvRef.current && processVirtualEnvironmentDeploymentData
289289
? processVirtualEnvironmentDeploymentData(deploymentStatusDetailRes)
290-
: processDeploymentStatusDetailsData(deploymentStatusDetailRes)
290+
: processDeploymentStatusDetailsData(appDetails?.deploymentAppType, deploymentStatusDetailRes)
291291

292292
clearDeploymentStatusTimer()
293293

@@ -433,7 +433,10 @@ const Details: React.FC<DetailsType> = ({
433433
const processedDeploymentStatusData =
434434
isVirtualEnvRef.current && processVirtualEnvironmentDeploymentData
435435
? processVirtualEnvironmentDeploymentData(deploymentStatusDetailRes.result)
436-
: processDeploymentStatusDetailsData(deploymentStatusDetailRes.result)
436+
: processDeploymentStatusDetailsData(
437+
appDetails?.deploymentAppType,
438+
deploymentStatusDetailRes.result,
439+
)
437440

438441
setDeploymentStatusDetailsBreakdownData(processedDeploymentStatusData)
439442
} else {

0 commit comments

Comments
 (0)