Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Nix symlink regression #358

Closed
wants to merge 11 commits into from
5 changes: 4 additions & 1 deletion .github/actions/setup/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: "Setup"
runs:
using: "composite"
steps:
- uses: cachix/install-nix-action@v22
- uses: cachix/install-nix-action@v26
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Cache .venv
Expand Down Expand Up @@ -51,3 +51,6 @@ runs:
if: runner.os == 'Linux'
run: nix-shell --command "pip install greenlet==3.0.3 --no-binary greenlet --force-reinstall"
shell: bash
- name: Setup tmate session
if: runner.os == 'macOS'
uses: mxschmitt/action-tmate@v3
2 changes: 1 addition & 1 deletion development/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ COPY --from=builder /app/collected collected
ENV PYTHONUNBUFFERED 1
ENV PATH="/app/.venv/bin:$PATH"
ENV ENVIRONMENT=production
RUN rm server/settings/__init__.py && echo 'export DJANGO_SETTINGS_MODULE=server.settings.$ENVIRONMENT' > /etc/profile
RUN rm -f server/settings/__init__.py && echo 'export DJANGO_SETTINGS_MODULE=server.settings.$ENVIRONMENT' > /etc/profile
ENTRYPOINT ["/bin/sh", "-lc"]
# SSH commands are weird with fly for now, so we use this dirty script at the root level.
RUN echo "source /etc/profile; cd /app; python manage.py migrate" > /migrate.sh && chmod +x /migrate.sh
Expand Down
2 changes: 1 addition & 1 deletion packages/create-django-app/scripts/create-django-app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ fi

cp -RT "$SCRIPT_PATH/../template" "$PROJECT_NAME"
chmod -R u+w "$PROJECT_NAME"
ln -s localhost.py "$PROJECT_NAME/server/settings/__init__.py"
# ln -s localhost.py "$PROJECT_NAME/server/settings/__init__.py"

cd "$PROJECT_NAME" || exit
mv gitignore.template .gitignore
Expand Down
7 changes: 7 additions & 0 deletions packages/reactivated/scripts/setup_environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ export PGDATABASE="database"
export PGHOST=$TMP_ENV
EXTERNAL_PID="$TMP_ENV/postmaster.pid"

settings_file="server/settings/__init__.py"

# Temporary fix with Nix issues.
if [ ! -f "$settings_file" ]; then
ln -s localhost.py "$settings_file"
fi

if [ ! -d "$VIRTUAL_ENV" ]; then
if [ -f "$EXTERNAL_PID" ]; then
kill -9 "$(cat "$EXTERNAL_PID")"
Expand Down
2 changes: 1 addition & 1 deletion website/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ COPY --from=builder /app/collected collected
ENV PYTHONUNBUFFERED 1
ENV PATH="/app/.venv/bin:$PATH"
ENV ENVIRONMENT=production
RUN rm server/settings/__init__.py && echo 'export DJANGO_SETTINGS_MODULE=server.settings.$ENVIRONMENT' > /etc/profile
RUN rm -f server/settings/__init__.py && echo 'export DJANGO_SETTINGS_MODULE=server.settings.$ENVIRONMENT' > /etc/profile
ENTRYPOINT ["/bin/sh", "-lc"]
# SSH commands are weird with fly for now, so we use this dirty script at the root level.
RUN echo "source /etc/profile; cd /app; python manage.py migrate" > /migrate.sh && chmod +x /migrate.sh
Expand Down
Loading