Skip to content

Commit

Permalink
docs: print extra information when deploying (#46030)
Browse files Browse the repository at this point in the history
  • Loading branch information
mortenpi committed Jul 14, 2022
1 parent 67cee4b commit b3b229e
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions doc/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,10 @@ struct BuildBotConfig <: Documenter.DeployConfig end
Documenter.authentication_method(::BuildBotConfig) = Documenter.HTTPS
Documenter.authenticated_repo_url(::BuildBotConfig) = "https://github.com/JuliaLang/docs.julialang.org.git"
function Documenter.deploy_folder(::BuildBotConfig; devurl, repo, branch, kwargs...)
haskey(ENV, "DOCUMENTER_KEY") || return Documenter.DeployDecision(; all_ok=false)
if !haskey(ENV, "DOCUMENTER_KEY")
@info "Unable to deploy the documentation: DOCUMENTER_KEY missing"
return Documenter.DeployDecision(; all_ok=false)
end
if Base.GIT_VERSION_INFO.tagged_commit
# Strip extra pre-release info (1.5.0-rc2.0 -> 1.5.0-rc2)
ver = VersionNumber(VERSION.major, VERSION.minor, VERSION.patch,
Expand All @@ -349,6 +352,11 @@ function Documenter.deploy_folder(::BuildBotConfig; devurl, repo, branch, kwargs
elseif Base.GIT_VERSION_INFO.branch == "master"
return Documenter.DeployDecision(; all_ok=true, repo, branch, subfolder=devurl)
end
@info """
Unable to deploy the documentation: invalid GIT_VERSION_INFO
GIT_VERSION_INFO.tagged_commit: $(Base.GIT_VERSION_INFO.tagged_commit)
GIT_VERSION_INFO.branch: $(Base.GIT_VERSION_INFO.branch)
"""
return Documenter.DeployDecision(; all_ok=false)
end

Expand Down Expand Up @@ -376,12 +384,16 @@ function Documenter.Writers.HTMLWriter.expand_versions(dir::String, v::Versions)
return Documenter.Writers.HTMLWriter.expand_versions(dir, v.versions)
end

deploydocs(
repo = "github.com/JuliaLang/docs.julialang.org.git",
deploy_config = BuildBotConfig(),
target = joinpath(buildroot, "doc", "_build", "html", "en"),
dirname = "en",
devurl = devurl,
versions = Versions(["v#.#", devurl => devurl]),
archive = get(ENV, "DOCUMENTER_ARCHIVE", nothing),
)
if "deploy" in ARGS
deploydocs(
repo = "github.com/JuliaLang/docs.julialang.org.git",
deploy_config = BuildBotConfig(),
target = joinpath(buildroot, "doc", "_build", "html", "en"),
dirname = "en",
devurl = devurl,
versions = Versions(["v#.#", devurl => devurl]),
archive = get(ENV, "DOCUMENTER_ARCHIVE", nothing),
)
else
@info "Skipping deployment ('deploy' not passed)"
end

0 comments on commit b3b229e

Please sign in to comment.