summaryrefslogtreecommitdiff
path: root/tw/packages/ci.scm
blob: 3a2619acf0a125f4a2438d6ac207df9f58360af4 (about) (plain)
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
(define-module (tw packages ci)
  #:use-module (gnu packages base)
  #:use-module (gnu packages elf)
  #:use-module (guix build-system copy)
  #:use-module (guix download)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (guix utils))

(define-public (hashicorp-arch)
  (cond
   ((target-x86-64?) "amd64")
   ((target-x86-32?) "386")
   ((target-arm32?) "arm")
   ((target-aarch64?) "arm64")))

(define-public (hashicorp-download-url name version)
  (string-append "https://releases.hashicorp.com/" name "/" version "/"
                 name "_" version "_linux_" (hashicorp-arch) ".zip"))

(define-public hashicorp-packer-bin
  (package
    (name "hashicorp-packer")
    (version "1.8.6")
    (source
     (origin
       (method url-fetch/zipbomb)
       (uri (hashicorp-download-url "packer" version))
       (sha256 (base32 "1bl5nckj9gqzdmkfaxjbsi4mv78ka5liiv9nin8n5slaawg43l2p"))))
    (build-system copy-build-system)
    (arguments '(#:install-plan '(("packer" "bin/"))))
    (home-page "https://packer.io/")
    (synopsis "Build automated machine images")
    (description "Hashicorp Packer is a tool for creating identical machine
images for multiple platforms from a single source configuration.")
    (license license:mpl2.0)))

(define-public hashicorp-consul-bin
  (package
    (name "hashicorp-consul")
    (version "1.14.4")
    (source
     (origin
       (method url-fetch/zipbomb)
       (uri (hashicorp-download-url "consul" version))
       (sha256 (base32 "0ypxmnl68fg66rw06g5qldqgyrgkimgk56gspwv1bk797j2pryza"))))
    (build-system copy-build-system)
    (arguments '(#:install-plan '(("consul" "bin/"))))
    (home-page "https://consul.io/")
    (synopsis "Datacenter service mesh tool")
    (description "Consul is a distributed, highly available, and data center
aware solution to connect and configure applications across dynamic,
distributed infrastructure.")
    (license license:mpl2.0)))

(define-public hashicorp-vault-bin
  (package
    (name "hashicorp-vault")
    (version "1.12.3")
    (source
     (origin
       (method url-fetch/zipbomb)
       (uri (hashicorp-download-url "vault" version))
       (sha256 (base32 "1sxiqjq837mvl3r4awsxakyssf4jrcx45xzg0ys8fxp70snmp0pl"))))
    (build-system copy-build-system)
    (arguments '(#:install-plan '(("vault" "bin/"))))
    (home-page "https://vaultproject.io/")
    (synopsis "Secrets management, encryption as a service, and privileged
access management")
    (description "Vault is a tool for securely accessing secrets.  A secret is
anything that you want to tightly control access to, such as API keys,
passwords, certificates, and more.  Vault provides a unified interface to any
secret, while providing tight access control and recording a detailed audit
log.")
    (license license:mpl2.0)))

(define-public hashicorp-nomad-bin
  (package
    (name "hashicorp-nomad")
    (version "1.4.4")
    (source
     (origin
       (method url-fetch/zipbomb)
       (uri (hashicorp-download-url "nomad" version))
       (sha256 (base32 "0l73ffffs002jkjfzidj604wzpjf38qfsghyvml7mnn3sz0v9fv3"))))
    (build-system copy-build-system)
    (arguments
     `(#:install-plan '(("nomad" "bin/"))
       #:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'patch-interpreter
           ;; For some reason, the "nomad" binary has /lib64/ld-linux*.so
           ;; hardcoded, so fix that.
           (lambda* (#:key inputs #:allow-other-keys)
             (let ((patchelf
                    (string-append (assoc-ref inputs "patchelf")
                                   "/bin/patchelf"))
                   (ld-linux.so
                    (string-append
                     (assoc-ref inputs "glibc")
                     "/lib/ld-" ,(package-version glibc) ".so")))
               (invoke patchelf "--set-interpreter" ld-linux.so "nomad")))))))
    (inputs (list glibc))
    (native-inputs (list patchelf))
    (home-page "https://nomadproject.io/")
    (synopsis "A simple orchestrator to deploy and manage applications")
    (description "Nomad is an easy-to-use, flexible, and performant workload
orchestrator that can deploy a mix of microservice, batch, containerized, and
non-containerized applications.  Nomad is easy to operate and scale and has
native Consul and Vault integrations.")
    (license license:mpl2.0)))