Skip to content

Commit

Permalink
Merge pull request #823 from cal-itp/no-rt-redirect
Browse files Browse the repository at this point in the history
remove rt from redirects so we can deploy it manually
  • Loading branch information
edasmalchi authored Aug 3, 2023
2 parents 85d4762 + 731f222 commit cb4d675
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 40 deletions.
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 %}

0 comments on commit cb4d675

Please sign in to comment.