Skip to content

Commit

Permalink
v0.25.5 - websockets and docker fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian committed Feb 4, 2020
1 parent 368b7a9 commit b98e99c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 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 = "0.25.4"
version = "0.25.5"

[deps]
ArgParse = "c7e460c6-2fb9-53a9-8c5b-16f535851c63"
Expand Down
3 changes: 0 additions & 3 deletions files/new_app/app/layouts/app.jl.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,5 @@
<%
@yield
%>
<% if Genie.config.websockets_server %>
<script src="/js/app/channels.js"></script>
<% end %>
</body>
</html>
2 changes: 1 addition & 1 deletion src/Configuration.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Core genie configuration / settings functionality.
"""
module Configuration

const GENIE_VERSION = v"0.25.4"
const GENIE_VERSION = v"0.25.5"

import Logging
import Genie
Expand Down
11 changes: 8 additions & 3 deletions src/Deploy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@ Generates a `Dockerfile` optimised for containerizing Genie apps.
- `force::Bool`: if the file already exists, when `force` is `true`, it will be overwritten
"""
function dockerfile(path::String = "."; filename::String = "Dockerfile", user::String = "genie", env::String = "dev",
host = "0.0.0.0", port::Int = 8000, dockerport::Int = 80, force::Bool = false)
host = "0.0.0.0", port::Int = 8000, dockerport::Int = 80, force::Bool = false,
websockets_port::Int = 8001, websockets_dockerport::Int = 8001)
filename = normpath(joinpath(path, filename))
isfile(filename) && force && rm(filename)
isfile(filename) && error("File $(filename) already exists. Use the `force = true` option to overwrite the existing file.")

open(filename, "w") do io
write(io, FileTemplates.dockerfile(user = user, env = env, filename = filename, host = host,
port = port, dockerport = dockerport))
port = port, dockerport = dockerport,
websockets_port = websockets_port, websockets_dockerport = websockets_dockerport))
end

"Docker file successfully written at $(abspath(filename))" |> println
Expand Down Expand Up @@ -68,12 +70,15 @@ Runs the Docker container named `containername`, binding `hostport` and `contain
- `it::Bool`: runs interactively
"""
function run(; containername::String = "genieapp", hostport::Int = 80, containerport::Int = 8000, appdir::String = "/home/genie/app",
mountapp::Bool = false, image::String = "genie", command::String = "bin/server", rm::Bool = true, it::Bool = true)
mountapp::Bool = false, image::String = "genie", command::String = "bin/server", rm::Bool = true, it::Bool = true,
websockets_hostport::Int = 8001, websockets_containerport::Int = 8001)
options = []
it && push!(options, "-it")
rm && push!(options, "--rm")
push!(options, "-p")
push!(options, "$hostport:$containerport")
push!(options, "-p")
push!(options, "$websockets_hostport:$websockets_containerport")
push!(options, "--name")
push!(options, "$containername")
if mountapp
Expand Down
7 changes: 6 additions & 1 deletion src/FileTemplates.jl
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ end


function dockerfile(; user::String = "genie", supervisor::Bool = false, nginx::Bool = false, env::String = "dev",
filename::String = "Dockerfile", port::Int = 8000, dockerport::Int = 80, host::String = "0.0.0.0")
filename::String = "Dockerfile", port::Int = 8000, dockerport::Int = 80, host::String = "0.0.0.0",
websockets_port::Int = 8001, websockets_dockerport::Int = 8001)
appdir = "/home/$user/app"

"""
Expand Down Expand Up @@ -116,6 +117,10 @@ function dockerfile(; user::String = "genie", supervisor::Bool = false, nginx::B
EXPOSE $port
EXPOSE $dockerport
# websockets ports
EXPOSE $websockets_port
EXPOSE $websockets_dockerport
ENV JULIA_DEPOT_PATH "/home/$user/.julia"
ENV GENIE_ENV "$env"
ENV HOST "$host"
Expand Down

2 comments on commit b98e99c

@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/8877

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 Julia TagBot is installed, or can be done manually through the github interface, or via:

git tag -a v0.25.5 -m "<description of version>" b98e99c9578a84da58298f42f55ecf51e850bd3e
git push origin v0.25.5

Please sign in to comment.