Skip to content

Commit

Permalink
Merge pull request #1195 from JuliaDocs/fe/hehe
Browse files Browse the repository at this point in the history
Actually display log message
  • Loading branch information
fredrikekre authored Nov 26, 2019
2 parents a36215c + cece395 commit ba10efd
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "Documenter"
uuid = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
version = "0.24.1"
version = "0.24.2"

[deps]
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
Expand Down
11 changes: 9 additions & 2 deletions src/deployconfig.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,14 @@ arguments from [`deploydocs`](@ref).
compatibility with future Documenter releases which may pass additional
keyword arguments.
"""
deploy_folder(::DeployConfig; kwargs...) = nothing
deploy_folder(::Nothing; kwargs...) = nothing # when auto-detection fails
function deploy_folder(cfg::DeployConfig; kwargs...)
@warn "Documenter.deploy_folder(::$(typeof(cfg)); kwargs...) not implemented. Skipping deployment."
return nothing
end
function deploy_folder(::Nothing; kwargs...)
@warn "Documenter could not auto-detect the building environment Skipping deployment."
return nothing
end

@enum AuthenticationMethod SSH HTTPS

Expand Down Expand Up @@ -290,6 +296,7 @@ function deploy_folder(cfg::GitHubActions; repo, devbranch, push_preview, devurl
println(io, "- $(marker(auth_ok)) ENV[\"DOCUMENTER_KEY\"] or ENV[\"GITHUB_TOKEN\"] exists")
end
print(io, "Deploying: $(marker(all_ok))")
@info String(take!(io))
return all_ok ? subfolder : nothing
end

Expand Down
13 changes: 13 additions & 0 deletions test/deployconfig.jl
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,19 @@ end end
end
end end

struct CustomConfig <: Documenter.DeployConfig end
Documenter.deploy_folder(::CustomConfig; kwargs...) = "v1.2.3"
struct BrokenConfig <: Documenter.DeployConfig end

@testset "Custom configuration" begin; with_logger(NullLogger()) do
cfg = CustomConfig()
@test Documenter.deploy_folder(cfg; repo="github.com/JuliaDocs/Documenter.jl.git",
devbranch="master", devurl="dev", push_preview=true) == "v1.2.3"
cfg = BrokenConfig()
@test (@test_logs (:warn, r"Documenter\.deploy_folder\(::BrokenConfig; kwargs\.\.\.\) not implemented") Documenter.deploy_folder(cfg)) === nothing
@test (@test_logs (:warn, r"Documenter could not auto-detect") Documenter.deploy_folder(nothing)) === nothing
end end

@testset "Autodetection of deploy system" begin
withenv("TRAVIS_REPO_SLUG" => "JuliaDocs/Documenter.jl",
"GITHUB_REPOSITORY" => nothing,
Expand Down

2 comments on commit ba10efd

@fredrikekre
Copy link
Member Author

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/5885

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.24.2 -m "<description of version>" ba10efd5d6f7f7d9e3aab91bfb90f69d37b87f3f
git push origin v0.24.2

Please sign in to comment.