Skip to content

Commit

Permalink
Update publish wiki file extension
Browse files Browse the repository at this point in the history
  • Loading branch information
byhbt committed Jan 5, 2022
1 parent 44f264d commit 3b0e194
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ create_mix_project:
# Y - in response to Do you want to generate the Github Action workflows: Deploy to Heroku?
# Y - in response to Do you want to generate the .github/.workflow/README file?
# 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.
# Y - in response to Do you want to generate the Github Action to deploy to AWS ECS?
# Y - in response to Do you want to generate the Github Action workflows: Deploy to Heroku?
# Y - in response to Do you want to generate the Github Action workflows: Deploy to AWS ECS?
# Y - in response to Would you like to add the Oban addon?
# Y - in response to Would you like to add the ExVCR addon?
common_addon_prompts = Y\nY\nY\nY\nY\nY\nY\nY\nY\n
Expand All @@ -38,7 +39,7 @@ live_addon_prompts = Y\n
# Y - in response to Do you want to generate the Github Action workflow: Test?
# Y - in response to Do you want to generate the .github/.workflow/README file?
# 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.
# N - in response to Do you want to generate the Github Action to deploy to AWS ECS?
# Y - in response to Do you want to generate the Github Action to deploy to AWS ECS?
# Y - in response to Would you like to add the Mimic addon?
mix_addon_prompts = Y\nY\nY\nY\nY\nY\nY\n

Expand Down
18 changes: 10 additions & 8 deletions lib/nimble_template/addons/github.ex
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,16 @@ defmodule NimbleTemplate.Addons.Github do
project
end

@impl true
def do_apply(%Project{} = project, opts) when opts.github_action_deploy_aws_ecs do
Generator.copy_file([
{:eex, ".github/workflows/deploy_to_aws_ecs.yml.eex",
".github/workflows/deploy_to_aws_ecs.yml"}
])

project
end

defp copy_wiki_files(
%Project{
web_project?: web_project?,
Expand Down Expand Up @@ -139,14 +149,6 @@ defmodule NimbleTemplate.Addons.Github do
Most of the documentation is located in the `.github/wiki` directory, which is published to the [project's Github wiki](https://github.com/[REPO]/wiki).
"""
)
project
end

def do_apply(%Project{} = project, opts) when opts.github_action_deploy_aws_ecs do
Generator.copy_file([
{:eex, ".github/workflows/deploy_to_aws_ecs.yml.eex",
".github/workflows/deploy_to_aws_ecs.yml"}
])

project
end
Expand Down
2 changes: 1 addition & 1 deletion lib/nimble_template/helpers/github.ex
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ defmodule NimbleTemplate.GithubHelper do
def generate_github_action_deploy_heroku?(),
do: Mix.shell().yes?("\nDo you want to generate the Github Action workflows: Deploy to Heroku?")

def generate_github_action_deploy_aws?(),
def generate_github_action_deploy_aws_ecs?(),
do: Mix.shell().yes?("\nDo you want to generate the Github Action to deploy to AWS ECS?")
end
5 changes: 4 additions & 1 deletion lib/nimble_template/variants/phoenix/template.ex
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ defmodule NimbleTemplate.Phoenix.Template do
if generate_github_wiki?(),
do: Addons.Github.apply(project, %{github_wiki: true})

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

if generate_github_action_deploy_aws_ecs?(),
do: Addons.Github.apply(project, %{github_action_deploy_aws_ecs: true})

project
Expand Down

0 comments on commit 3b0e194

Please sign in to comment.