PromucFlow_constructor/deploy/docker/fs/opt/appsmith/run-with-env.sh
Subhrashis Das 11a5a963d2
feat: add git route aspect for branch handling (#41097)
## Description
> [!TIP]  
> _Add a TL;DR when the description is longer than 500 words or
extremely technical (helps the content, marketing, and DevRel team)._
>
> _Please also include relevant motivation and context. List any
dependencies that are required for this change. Add links to Notion,
Figma or any other documents that might be relevant to the PR._


Fixes #`Issue Number`  
_or_  
Fixes `Issue URL`
> [!WARNING]  
> _If no issue exists, please create an issue first, and check with the
maintainers if the issue is valid._

## Automation

/ok-to-test tags="@tag.All"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/16343398654>
> Commit: f8257de8135f4243309143396eca2a81bdb6f2a3
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=16343398654&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.All`
> Spec:
> <hr>Thu, 17 Jul 2025 12:14:40 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Introduced a new annotation to streamline and secure Git-related
operations in application APIs.
* Added a robust workflow for handling Git operations with enhanced
concurrency control and error handling.
* Enabled in-memory Git storage mode for improved performance in certain
environments.
* Added support for executing Git operations via shell scripts,
including branch merging and repository management.

* **Improvements**
* Enhanced configuration flexibility for Git storage and Redis
integration.
* Improved error reporting with new, descriptive Git-related error
messages.
* Broadened environment file ignore patterns for better environment
management.

* **Bug Fixes**
  * Improved handling of private key formats for Git authentication.

* **Documentation**
* Added detailed documentation and flow diagrams for new Git operation
workflows.

* **Chores**
* Updated build and test configurations to align with new Git storage
paths.
* Deprecated and bypassed certain Redis operations when using in-memory
Git storage.

* **Tests**
* Removed several outdated or redundant test cases related to
auto-commit and Git serialization.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-07-21 14:11:34 +05:30

46 lines
1.5 KiB
Bash
Executable File

#!/bin/bash
ENV_PATH="/appsmith-stacks/configuration/docker.env"
PRE_DEFINED_ENV_PATH="$TMP/pre-define.env"
tlog 'Load environment configuration'
set -o allexport
. "$ENV_PATH"
. "$PRE_DEFINED_ENV_PATH"
set +o allexport
if [[ -z "${APPSMITH_MAIL_ENABLED}" ]]; then
unset APPSMITH_MAIL_ENABLED # If this field is empty is might cause application crash
fi
if [[ -z "${APPSMITH_OAUTH2_GITHUB_CLIENT_ID}" ]] || [[ -z "${APPSMITH_OAUTH2_GITHUB_CLIENT_SECRET}" ]]; then
unset APPSMITH_OAUTH2_GITHUB_CLIENT_ID # If this field is empty is might cause application crash
unset APPSMITH_OAUTH2_GITHUB_CLIENT_SECRET
fi
if [[ -z "${APPSMITH_OAUTH2_GOOGLE_CLIENT_ID}" ]] || [[ -z "${APPSMITH_OAUTH2_GOOGLE_CLIENT_SECRET}" ]]; then
unset APPSMITH_OAUTH2_GOOGLE_CLIENT_ID # If this field is empty is might cause application crash
unset APPSMITH_OAUTH2_GOOGLE_CLIENT_SECRET
fi
if [[ -z "${APPSMITH_RECAPTCHA_SITE_KEY}" ]] || [[ -z "${APPSMITH_RECAPTCHA_SECRET_KEY}" ]] || [[ -z "${APPSMITH_RECAPTCHA_ENABLED}" ]]; then
unset APPSMITH_RECAPTCHA_SITE_KEY # If this field is empty is might cause application crash
unset APPSMITH_RECAPTCHA_SECRET_KEY
unset APPSMITH_RECAPTCHA_ENABLED
fi
if [[ -z "${APPSMITH_GIT_ROOT:-}" ]]; then
export APPSMITH_GIT_ROOT=/appsmith-stacks/git-storage
fi
mkdir -pv "$APPSMITH_GIT_ROOT"
echo "APPSMITH_GIT_ROOT: ${APPSMITH_GIT_ROOT}" >&2
# Check if APPSMITH_DB_URL is set
if [[ -z "${APPSMITH_DB_URL}" ]]; then
# If APPSMITH_DB_URL is not set, fall back to APPSMITH_MONGODB_URI
export APPSMITH_DB_URL="${APPSMITH_MONGODB_URI}"
fi
exec "$@"