diff --git a/.github/actions/setup/action.yaml b/.github/actions/setup/action.yaml index 134b34ac..15f8477a 100644 --- a/.github/actions/setup/action.yaml +++ b/.github/actions/setup/action.yaml @@ -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 @@ -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 diff --git a/development/Dockerfile b/development/Dockerfile index 724cf19f..0142afe7 100644 --- a/development/Dockerfile +++ b/development/Dockerfile @@ -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 diff --git a/packages/create-django-app/scripts/create-django-app.sh b/packages/create-django-app/scripts/create-django-app.sh index b8dea535..4f863246 100755 --- a/packages/create-django-app/scripts/create-django-app.sh +++ b/packages/create-django-app/scripts/create-django-app.sh @@ -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 diff --git a/packages/reactivated/scripts/setup_environment.sh b/packages/reactivated/scripts/setup_environment.sh index d9d3828d..e54db098 100755 --- a/packages/reactivated/scripts/setup_environment.sh +++ b/packages/reactivated/scripts/setup_environment.sh @@ -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")" diff --git a/website/Dockerfile b/website/Dockerfile index ebfffecd..ead1e5a4 100644 --- a/website/Dockerfile +++ b/website/Dockerfile @@ -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