summaryrefslogtreecommitdiff
path: root/zuul.d/playbooks/pre.yaml
blob: 1ea967c3cdfd6da82fa053494f6193a1e8c061bf (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
#***************************************************************************
#                                  _   _ ____  _
#  Project                     ___| | | |  _ \| |
#                             / __| | | | |_) | |
#                            | (__| |_| |  _ <| |___
#                             \___|\___/|_| \_\_____|
#
# Copyright (C) 2021 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at https://curl.se/docs/copyright.html.
#
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
# copies of the Software, and permit persons to whom the Software is
# furnished to do so, under the terms of the COPYING file.
#
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
# KIND, either express or implied.
#
# SPDX-License-Identifier: curl
#
###########################################################################
---
- hosts: all
  tasks:

  - name: Install latest stable release of go
    when: gimme_stable|default(false)
    block:
      - name: Find latest stable version
        register: go_stable
        uri:
          url: https://golang.org/VERSION?m=text
          return_content: true
      - name: Install Go
        include_role:
          name: ensure-go
        vars:
          go_version: "{{ go_stable.content | regex_replace('^go', '') }}"

      - name: Symlink /usr/local/go/bin/go to /usr/bin/go
        become: true
        file:
          src: /usr/local/go/bin/go
          dest: /usr/bin/go
          state: link

  - name: Install common dependencies
    become: true
    apt:
      update_cache: true
      pkg:
      - autoconf
      - automake
      - cmake
      - valgrind
      - libev-dev
      - libc-ares-dev
      - libssl-dev
      - libtool
      - g++
      - g++-8
      - stunnel4
      - libidn2-dev
      - gnutls-bin
      - python-impacket
      - ninja-build
      - libgsasl7-dev
      - libnghttp2-dev

  - name: Install job-specific packages
    when: curl_apt_packages is defined
    become: true
    apt:
      pkg: "{{ curl_apt_packages }}"

  - name: Symlink /usr/bin/scan-build-10 to /usr/bin/scan-build
    when:
      - curl_apt_packages is defined
      - '"clang-tools-10" in curl_apt_packages'
    become: true
    file:
      src: /usr/bin/scan-build-10
      dest: /usr/bin/scan-build
      state: link

  - name: Run before script
    shell: "./scripts/zuul/before_script.sh"
    args:
      chdir: "{{ zuul.project.src_dir }}"
    environment: "{{ curl_env }}"
...