Skip to content

Commit

Permalink
v4.5.0 - support for JuliaHub main.jl in Deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian Salceanu committed Dec 8, 2021
1 parent df28836 commit c0c01e4
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Genie"
uuid = "c43c736e-a2d1-11e8-161f-af95117fbd1e"
authors = ["Adrian Salceanu <[email protected]>"]
version = "4.4.4"
version = "4.5.0"

[deps]
ArgParse = "c7e460c6-2fb9-53a9-8c5b-16f535851c63"
Expand Down
2 changes: 1 addition & 1 deletion src/Commands.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function execute(config::Genie.Configuration.Settings; server::Union{Sockets.TCP
Genie.config.websockets_port = haskey(ENV, "WSPORT") ? parse(Int, ENV["WSPORT"]) : parse(Int, parsed_args["w"])
Genie.config.server_host = parsed_args["l"]

if called_command(parsed_args, "s") || (haskey(ENV["STARTSERVER"]) && parse(Bool, ENV["STARTSERVER"]))
if called_command(parsed_args, "s") || (haskey(ENV, "STARTSERVER") && parse(Bool, ENV["STARTSERVER"]))
Genie.config.run_as_server = true
Base.invokelatest(Genie.up, Genie.config.server_port, Genie.config.server_host; server = server)

Expand Down
31 changes: 31 additions & 0 deletions src/Deploy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -206,4 +206,35 @@ end

end # end module Heroku


module JuliaHub

import Genie

function mainjl() :: Nothing
bin_folder_path = Genie.Generator.binfolderpath(pwd())
main_file_path = joinpath(bin_folder_path, "main.jl")

isfile(main_file_path) && error("File bin/main.jl already exists")

open(main_file_path, "w") do f
write(f, """
push!(LOAD_PATH, abspath(normpath(joinpath(@__DIR__, "../src/"))))
ENV["STARTSERVER"] = true
ENV["GENIE_ENV"] = "prod"
ENV["EARLYBIND"] = true
include("../bootstrap.jl")
""")
end

@info "File bin/main.jl created"

nothing
end

end # end module JuliaHub


end # end module Deploy

2 comments on commit c0c01e4

@essenciary
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/50184

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v4.5.0 -m "<description of version>" c0c01e41525c1baee8d90c4d716d7b520092127c
git push origin v4.5.0

Please sign in to comment.