diff --git a/Project.toml b/Project.toml index 335cd1e..47a415a 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "PSRContinuousDeployment" uuid = "f0087d4c-ff99-426e-93c9-09c1a88911f9" -version = "0.9.2" +version = "0.10.0" [deps] AWS = "fbe9abb3-538b-5e4e-ba9e-bc94f4f92ebc" diff --git a/src/PSRContinuousDeployment.jl b/src/PSRContinuousDeployment.jl index 459b135..9abce0f 100644 --- a/src/PSRContinuousDeployment.jl +++ b/src/PSRContinuousDeployment.jl @@ -49,7 +49,6 @@ include("testrunner.jl") include("deploy/psrmodels.jl") include("deploy/psrmodules.jl") -include("deploy/psrcloud.jl") include("deploy/distribution.jl") end diff --git a/src/configuration.jl b/src/configuration.jl index f08d9e9..bda86a1 100644 --- a/src/configuration.jl +++ b/src/configuration.jl @@ -1,6 +1,6 @@ struct Configuration target::String - version::String + version::VersionNumber package_path::String compile_path::String build_path::String @@ -31,7 +31,7 @@ struct Configuration return new( target, - version, + VersionNumber(version), package_path, compile_path, build_path, diff --git a/src/deploy/psrcloud.jl b/src/deploy/psrcloud.jl deleted file mode 100644 index f7161e0..0000000 --- a/src/deploy/psrcloud.jl +++ /dev/null @@ -1,63 +0,0 @@ -# function deploy_to_psrcloud( -# configuration::Configuration, -# psrcloud_user::AbstractString, -# psrcloud_password::AbstractString; -# url::AbstractString = raw"https://psrcloud-deploy.psr-inc.com/CamadaGerenciadoraServicoWeb/DespachanteWS.asmx", -# cluster::AbstractString = raw"PSR-US_OHIO", -# ) - -# target = configuration.target -# version = configuration.version -# package_path = configuration.package_path -# compile_path = configuration.compile_path -# build_path = configuration.build_path - -# publish_path = joinpath(compile_path, "publish") - -# cd(publish_path) do -# run(`git add --all`) -# run(`git commit -m "$version ($sha1)"`) -# run(`git pull`) -# run(`git push origin --all`) -# return nothing -# end - -# cd deploy -# Remove-Item -Recurse -Force -ErrorAction Ignore -Path publish.xml -# Remove-Item -Recurse -Force -ErrorAction Ignore -Path upload -# Remove-Item -Recurse -Force -ErrorAction Ignore -Path psrio-distribution -# git clone --branch develop https://bitbucket.org/psr/psrio-distribution.git -# Rename-Item psrio-distribution\linux bin -# Copy-Item psrio_core.sh -Destination psrio-distribution\bin -# Invoke-Expression "& `".\7zip\7z.exe`" a -tzip .\upload\psrio.zip .\psrio-distribution\bin" -# echo '' > publish.xml -# echo '' >> publish.xml -# echo 'https://psrcloud-deploy.psr-inc.com/CamadaGerenciadoraServicoWeb/DespachanteWS.asmx' >> publish.xml -# echo 'rsampaio' >> publish.xml -# echo '${{ secrets.CLOUD_RSAMPAIO }}' >> publish.xml -# echo '3' >> publish.xml -# echo 'PSRIO' >> publish.xml -# echo 'cadastrarVersao' >> publish.xml -# echo 'PSR-US_OHIO' >> publish.xml -# echo '${{ github.event.inputs.version }}' >> publish.xml -# echo 'true' >> publish.xml -# echo 'true' >> publish.xml -# echo '0' >> publish.xml -# echo '503' >> publish.xml -# echo (''+$((Get-Item .).FullName)+'\upload') >> publish.xml -# echo 'SDDP,PSRCore,CompilePSRModel,OPTGEN,NETPLAN,SDDP-NETPLAN,NONE' >> publish.xml -# echo '' >> publish.xml -# echo 'Default' >> publish.xml -# echo '' >> publish.xml -# echo ',,,' >> publish.xml -# echo ',,,' >> publish.xml -# echo 'PSRIO' >> publish.xml -# echo '' >> publish.xml -# echo '' >> publish.xml -# C:\PSR\FakeConsole\v5.0-rc.3\FakeConsole.exe publish.xml | Tee-Object -file psrcloud_publish.log -# Remove-Item -Recurse -Force -ErrorAction Ignore -Path publish.xml -# Remove-Item -Recurse -Force -ErrorAction Ignore -Path upload -# Remove-Item -Recurse -Force -ErrorAction Ignore -Path psrio-distribution -# cd .. - -# end diff --git a/src/deploy/psrmodels.jl b/src/deploy/psrmodels.jl index 8a9e7ca..ee48364 100644 --- a/src/deploy/psrmodels.jl +++ b/src/deploy/psrmodels.jl @@ -6,7 +6,13 @@ function get_key(contents::Dict) return contents["Key"] end -function generate_unique_key(; bucket::AbstractString, version::AbstractString, target::AbstractString, setup_zip::AbstractString, overwrite::Bool = false) +function generate_unique_key(; + bucket::AbstractString, + version::VersionNumber, + target::AbstractString, + setup_zip::AbstractString, + overwrite::Bool = false, +) objects = S3.list_objects_v2(bucket, Dict("prefix" => target)) if haskey(objects, "Contents") for contents in objects["Contents"] diff --git a/src/github.jl b/src/github.jl index a71fc08..c773a5b 100644 --- a/src/github.jl +++ b/src/github.jl @@ -30,7 +30,7 @@ function is_release_tag_available(configuration::Configuration, github_key::Abst ] target = configuration.target - version = configuration.version + version = VersionNumber(configuration.version.major, configuration.version.minor, configuration.version.patch) try HTTP.get("https://api.github.com/repos/psrenergy/$target.jl/releases/tags/v$version", headers) diff --git a/src/setup.jl b/src/setup.jl index 5851a66..9d5d9e5 100644 --- a/src/setup.jl +++ b/src/setup.jl @@ -16,7 +16,7 @@ function create_setup( url = "http://www.psr-inc.com" # Build id from target and version - rng = Random.MersenneTwister(hash(target * version)) + rng = Random.MersenneTwister(hash("$target$version")) id = UUIDs.uuid4(rng) |> string |> uppercase if !isdir(setup_path) diff --git a/src/util.jl b/src/util.jl index 20a321a..c78312b 100644 --- a/src/util.jl +++ b/src/util.jl @@ -24,7 +24,7 @@ function write_version_jl( path::AbstractString, sha1::AbstractString, date::AbstractString, - pkg_version::AbstractString, + pkg_version::VersionNumber, pkg_build_date::AbstractString, ) open(joinpath(path, "version.jl"), "w") do io diff --git a/test/Example.jl/Project.toml b/test/Example.jl/Project.toml index 3d930e3..124c94a 100644 --- a/test/Example.jl/Project.toml +++ b/test/Example.jl/Project.toml @@ -1,6 +1,6 @@ name = "Example" uuid = "28d347f4-7536-4c5e-b41f-4013aab74eac" -version = "0.1.0" +version = "0.2.0" [deps]