aboutsummaryrefslogtreecommitdiff
path: root/repo/packages/n/nomad/xmake.lua
blob: 20380e1a17233a53777f9c923273c95d1f02bf8c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
-- this package only provides the nomad binary, to be used for testing nomad provisioning

package("nomad")
    set_homepage("https://www.nomadproject.io/")
    set_description("Nomad is a workload orchestrator that deploys and manages containers and non-containerized applications.")

    if is_plat("windows") then
        add_urls("https://releases.hashicorp.com/nomad/$(version)/nomad_$(version)_windows_amd64.zip")
        add_versions("1.9.7", "419e417d33f94888e176f2cccf1a101a16fc283bf721021f2a11f1b74570db97")
    elseif is_plat("linux") then
        add_urls("https://releases.hashicorp.com/nomad/$(version)/nomad_$(version)_linux_amd64.zip")
        add_versions("1.9.7", "e9c7337893eceb549557ef9ad341b3ae64f5f43e29ff1fb167b70cfd16748d2d")
    elseif is_plat("macosx") then
        if is_arch("arm64") then
            add_urls("https://releases.hashicorp.com/nomad/$(version)/nomad_$(version)_darwin_arm64.zip")
            add_versions("1.9.7", "90f87dffb3669a842a8428899088f3a0ec5a0d204e5278dbb0c1ac16ab295935")
        else
            add_urls("https://releases.hashicorp.com/nomad/$(version)/nomad_$(version)_darwin_amd64.zip")
            add_versions("1.9.7", "8f5befe1e11ef5664c0c212053aa3fc3e095e52a86e90c1315d7580f19ad7997")
        end
    end

    on_install(function (package)
        if is_plat("windows") then
            os.cp("nomad.exe", package:installdir("bin"))
        else
            os.cp("nomad", package:installdir("bin"))
        end
    end)

    on_test(function (package)
        if package:is_cross() then
            return
        end
        if is_plat("windows") then
            os.run("%s version", package:installdir("bin", "nomad.exe"))
        elseif is_plat("linux") then
            os.run("%s version", package:installdir("bin", "nomad"))
        end
    end)