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

remove rt from redirects so we can deploy it manually #823

Merged
merged 2 commits into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions portfolio/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
index
5 changes: 0 additions & 5 deletions portfolio/index/_redirects

This file was deleted.

33 changes: 0 additions & 33 deletions portfolio/index/index.html

This file was deleted.

7 changes: 6 additions & 1 deletion portfolio/portfolio.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,9 @@ def index(
site_output_dir = PORTFOLIO_DIR / Path(name)
sites.append(Site(output_dir=site_output_dir, name=name, **yaml.safe_load(f)))

rendered_index_dir = "./portfolio/index"
shutil.rmtree(rendered_index_dir, ignore_errors=True)
os.makedirs(f"{rendered_index_dir}/rt/")
for template in ["index.html", "_redirects"]:
fname = f"./portfolio/index/{template}"
with open(fname, "w") as f:
Expand All @@ -329,8 +332,10 @@ def index(
args.append("--prod")

if deploy:
typer.secho(f"deploying with args {args}", fg=typer.colors.GREEN)
typer.secho(f"deploying with args {' '.join(args)}", fg=typer.colors.GREEN)
subprocess.run(args).check_returncode()
else:
typer.secho(f"skipping deploy (may run manually): {' '.join(args)}", fg=typer.colors.YELLOW)


@app.command()
Expand Down
4 changes: 3 additions & 1 deletion portfolio/templates/_redirects
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{% for site in sites -%}
/{{ site.name }}/* https://{{ site.name }}--cal-itp-data-analyses.netlify.app//:splat 200
{% if site.name != 'rt' -%}
/{{ site.name }}/* https://{{ site.name }}--cal-itp-data-analyses.netlify.app//:splat 200
{%- endif %}
{% endfor %}
Loading