Merge pull request #10765 from appwrite/feat-sdk-release-runtime-config

Set configs for SDK release at runtime
This commit is contained in:
Luke B. Silver 2025-11-07 08:57:43 +00:00 committed by GitHub
commit 4a96d89ee6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 22 additions and 19 deletions

View file

@ -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

View file

@ -0,0 +1,7 @@
services:
appwrite:
# volumes:
# - ~/.ssh:/root/.ssh
environment:
- GH_TOKEN=
- GIT_EMAIL=

View file

@ -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

View file

@ -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'];