Skip to content

Commit 1189805

Browse files
committed
Update steps to generate AWS ECS
1 parent 70235a4 commit 1189805

File tree

4 files changed

+19
-20
lines changed

4 files changed

+19
-20
lines changed

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ create_mix_project:
1313
# Y - in response to Will you host this project on Github?
1414
# Y - in response to Do you want to generate the .github/ISSUE_TEMPLATE and .github/PULL_REQUEST_TEMPLATE?
1515
# Y - in response to Do you want to generate the Github Action workflows: Test?
16-
# Y - in response to Do you want to generate the Github Action workflows: Deploy to Heroku?
1716
# Y - in response to Do you want to generate the .github/.workflow/README file?
1817
# Y - in response to Do you want to publish a Github Wiki for this project? You'd need to manually create the first Github Wiki Page and set the GH_TOKEN and GH_EMAIL secret for this to properly function.
1918
# Y - in response to Do you want to generate the Github Action workflows: Deploy to Heroku?

lib/nimble_template/addons/github.ex

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,17 @@ defmodule NimbleTemplate.Addons.Github do
5959
%{
6060
github_workflows_readme: true,
6161
with_test_workflow?: with_test_workflow?,
62-
with_deploy_to_heroku_workflow?: with_deploy_to_heroku_workflow?
62+
with_deploy_to_heroku_workflow?: with_deploy_to_heroku_workflow?,
63+
with_deploy_to_aws_ecs_workflow?: with_deploy_to_aws_ecs_workflow?
6364
}
6465
) do
6566
Generator.copy_file(
6667
[
6768
{:eex, ".github/workflows/README.md.eex", ".github/workflows/README.md"}
6869
],
6970
with_test_workflow?: with_test_workflow?,
70-
with_deploy_to_heroku_workflow?: with_deploy_to_heroku_workflow?
71+
with_deploy_to_heroku_workflow?: with_deploy_to_heroku_workflow?,
72+
with_deploy_to_aws_ecs_workflow?: with_deploy_to_aws_ecs_workflow?
7173
)
7274

7375
project
@@ -83,20 +85,20 @@ defmodule NimbleTemplate.Addons.Github do
8385
end
8486

8587
@impl true
86-
def do_apply(%Project{} = project, %{github_wiki: true}) do
87-
project
88-
|> copy_wiki_files()
89-
|> append_wiki_into_readme()
88+
def do_apply(%Project{mix_project?: false} = project, %{github_action_deploy_aws_ecs: true}) do
89+
Generator.copy_file([
90+
{:eex, ".github/workflows/deploy_to_aws_ecs.yml.eex",
91+
".github/workflows/deploy_to_aws_ecs.yml"}
92+
])
9093

9194
project
9295
end
9396

9497
@impl true
95-
def do_apply(%Project{} = project, opts) when opts.github_action_deploy_aws_ecs do
96-
Generator.copy_file([
97-
{:eex, ".github/workflows/deploy_to_aws_ecs.yml.eex",
98-
".github/workflows/deploy_to_aws_ecs.yml"}
99-
])
98+
def do_apply(%Project{} = project, %{github_wiki: true}) do
99+
project
100+
|> copy_wiki_files()
101+
|> append_wiki_into_readme()
100102

101103
project
102104
end

lib/nimble_template/helpers/github.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ defmodule NimbleTemplate.GithubHelper do
2626
do: Mix.shell().yes?("\nDo you want to generate the Github Action workflows: Deploy to Heroku?")
2727

2828
def generate_github_action_deploy_aws_ecs?(),
29-
do: Mix.shell().yes?("\nDo you want to generate the Github Action to deploy to AWS ECS?")
29+
do: Mix.shell().yes?("\nDo you want to generate the Github Action workflows: Deploy to AWS ECS?")
3030
end

lib/nimble_template/templates/variants/phoenix/template.ex

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,15 @@ defmodule NimbleTemplate.Templates.Phoenix.Template do
5353
do: Addons.Github.apply(project, %{github_action_test: true})
5454

5555
generate_github_action_deploy_heroku? = generate_github_action_deploy_heroku?()
56-
generate_github_action_deploy_aws_ecs? = generate_github_action_deploy_heroku?()
5756

5857
if generate_github_action_deploy_heroku?,
5958
do: Addons.Github.apply(project, %{github_action_deploy_heroku: true})
6059

60+
generate_github_action_deploy_aws_ecs? = generate_github_action_deploy_aws_ecs?()
61+
62+
if generate_github_action_deploy_aws_ecs?,
63+
do: Addons.Github.apply(project, %{github_action_deploy_aws_ecs: true})
64+
6165
if generate_github_workflows_readme?(),
6266
do:
6367
Addons.Github.apply(project, %{
@@ -70,12 +74,6 @@ defmodule NimbleTemplate.Templates.Phoenix.Template do
7074
if generate_github_wiki?(),
7175
do: Addons.Github.apply(project, %{github_wiki: true})
7276

73-
if generate_github_action_deploy_heroku?,
74-
do: Addons.Github.apply(project, %{github_action_deploy_heroku: true})
75-
76-
if generate_github_action_deploy_aws_ecs?,
77-
do: Addons.Github.apply(project, %{github_action_deploy_aws_ecs: true})
78-
7977
project
8078
end
8179

0 commit comments

Comments
 (0)