diff --git a/Dockerfile b/Dockerfile index 2a3e176838..3d03ce112c 100755 --- a/Dockerfile +++ b/Dockerfile @@ -98,6 +98,7 @@ RUN mkdir -p /etc/letsencrypt/live/ && chmod -Rf 755 /etc/letsencrypt/live/ # Enable Extensions RUN if [ "$DEBUG" = "true" ]; then cp /usr/src/code/dev/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini; fi RUN if [ "$DEBUG" = "true" ]; then mkdir -p /tmp/xdebug; fi +RUN if [ "$DEBUG" = "true" ]; then apk add --update --no-cache openssh-client github-cli; fi RUN if [ "$DEBUG" = "false" ]; then rm -rf /usr/src/code/dev; fi RUN if [ "$DEBUG" = "false" ]; then rm -f /usr/local/lib/php/extensions/no-debug-non-zts-20230831/xdebug.so; fi diff --git a/docker-compose.override.yml b/docker-compose.override.yml new file mode 100644 index 0000000000..52c5058ab9 --- /dev/null +++ b/docker-compose.override.yml @@ -0,0 +1,7 @@ +services: + appwrite: + # volumes: + # - ~/.ssh:/root/.ssh + environment: + - GH_TOKEN= + - GIT_EMAIL= diff --git a/docs/tutorials/release-sdks.md b/docs/tutorials/release-sdks.md index 99c0fa4fd3..0e03beca71 100644 --- a/docs/tutorials/release-sdks.md +++ b/docs/tutorials/release-sdks.md @@ -26,34 +26,27 @@ Before releasing SDKs, you need to: To enable SDK releases via GitHub, you need to mount SSH keys and configure GitHub authentication in your Docker environment. -#### Update Dockerfile +#### Update docker-compose.override.yml -Add the following configuration to your `Dockerfile`: - -```dockerfile -ARG GH_TOKEN -ENV GH_TOKEN=your_github_token_here -RUN git config --global user.email "your-email@example.com" -RUN apk add --update --no-cache openssh-client github-cli -``` - -Replace: -- `your_github_token_here` with your GitHub personal access token (with appropriate permissions) -- `your-email@example.com` with your Git email address - -#### Update docker-compose.yml - -Add the SSH key volume mount to the `appwrite` service in `docker-compose.yml`: +Update `docker-compose.override.yml` to mount SSH keys and set environment variables for the `appwrite` service: ```yaml services: appwrite: volumes: - ~/.ssh:/root/.ssh - # ... other volumes + environment: + - GH_TOKEN=your_github_token_here + - GIT_EMAIL=your-email@example.com ``` -This mounts your SSH keys from the host machine, allowing the container to authenticate with GitHub. +Uncomment the volumes section. + +Replace: +- `your_github_token_here` with your GitHub personal access token (with appropriate permissions) +- `your-email@example.com` with your Git email address + +This mounts your SSH keys from the host machine and sets the GitHub token and email as environment variables, allowing the container to authenticate with GitHub. The git configuration is handled automatically at runtime. ### Updating Specs diff --git a/src/Appwrite/Platform/Tasks/SDKs.php b/src/Appwrite/Platform/Tasks/SDKs.php index f587e0f946..cf4f107e8e 100644 --- a/src/Appwrite/Platform/Tasks/SDKs.php +++ b/src/Appwrite/Platform/Tasks/SDKs.php @@ -259,6 +259,8 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND } if ($createRelease) { + Console::execute('git config --global user.email "$GIT_EMAIL"', stdin: '', stdout: '', stderr: ''); + $releaseVersion = $language['version']; $repoName = $language['gitUserName'] . '/' . $language['gitRepoName'];