]> git.proxmox.com Git - ceph.git/blob - ceph/src/arrow/dev/tasks/macros.jinja
import quincy 17.2.0
[ceph.git] / ceph / src / arrow / dev / tasks / macros.jinja
1 # Licensed to the Apache Software Foundation (ASF) under one
2 # or more contributor license agreements. See the NOTICE file
3 # distributed with this work for additional information
4 # regarding copyright ownership. The ASF licenses this file
5 # to you under the Apache License, Version 2.0 (the
6 # "License"); you may not use this file except in compliance
7 # with the License. You may obtain a copy of the License at
8 #
9 # http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing,
12 # software distributed under the License is distributed on an
13 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 # KIND, either express or implied. See the License for the
15 # specific language governing permissions and limitations
16 # under the License.
17
18 {%- macro github_header() -%}
19 # NOTE: must set "Crossbow" as name to have the badge links working in the
20 # github comment reports!
21 name: Crossbow
22 on:
23 push:
24 branches:
25 - "*-github-*"
26 {% endmacro %}
27
28 {%- macro github_checkout_arrow() -%}
29 - name: Checkout Arrow
30 run: |
31 git clone --no-checkout {{ arrow.remote }} arrow
32 git -C arrow config core.symlinks true
33 git -C arrow fetch -t {{ arrow.remote }} {{ arrow.branch }}
34 git -C arrow checkout FETCH_HEAD
35 git -C arrow submodule update --init --recursive
36 - name: Fetch Submodules and Tags
37 shell: bash
38 run: cd arrow && ci/scripts/util_checkout.sh
39 {% endmacro %}
40
41 {%- macro github_login_dockerhub() -%}
42 - name: Login to Dockerhub
43 uses: docker/login-action@v1
44 with:
45 username: {{ '${{ secrets.DOCKERHUB_USER }}' }}
46 password: {{ '${{ secrets.DOCKERHUB_TOKEN }}' }}
47 {% endmacro %}
48
49 {%- macro github_login_ghcr() -%}
50 - name: Login to GitHub Container Registry
51 shell: bash
52 run: docker login ghcr.io -u {{ '${{ github.repository_owner }}' }} -p {{ '${{ secrets.CROSSBOW_GHCR_TOKEN }}' }}
53 {% endmacro %}
54
55 {%- macro github_install_archery() -%}
56 - name: Set up Python
57 uses: actions/setup-python@v2
58 with:
59 python-version: 3.8
60 - name: Install Archery
61 shell: bash
62 run: pip install -e arrow/dev/archery[all]
63 {% endmacro %}
64
65 {%- macro github_upload_releases(pattern) -%}
66 - name: Set up Python
67 uses: actions/setup-python@v2
68 with:
69 python-version: 3.8
70 - name: Setup Crossbow
71 shell: bash
72 run: pip install -e arrow/dev/archery[crossbow-upload]
73 - name: Upload artifacts
74 shell: bash
75 run: |
76 archery crossbow \
77 --queue-path $(pwd) \
78 --queue-remote {{ queue_remote_url }} \
79 upload-artifacts \
80 --sha {{ task.branch }} \
81 --tag {{ task.tag }} \
82 {% if pattern is string %}
83 "{{ pattern }}"
84 {% elif pattern is iterable %}
85 {% for p in pattern %}
86 "{{ p }}" {{ "\\" if not loop.last else "" }}
87 {% endfor %}
88 {% endif %}
89 env:
90 CROSSBOW_GITHUB_TOKEN: {{ '${{ secrets.CROSSBOW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}' }}
91 {% endmacro %}
92
93 {%- macro github_upload_gemfury(pattern) -%}
94 {%- if arrow.branch == 'master' -%}
95 - name: Upload package to Gemfury
96 shell: bash
97 run: |
98 path=$(ls {{ pattern }})
99 curl -F "package=@${path}" https://${CROSSBOW_GEMFURY_TOKEN}@push.fury.io/${CROSSBOW_GEMFURY_ORG}/
100 env:
101 CROSSBOW_GEMFURY_TOKEN: {{ '${{ secrets.CROSSBOW_GEMFURY_TOKEN }}' }}
102 CROSSBOW_GEMFURY_ORG: {{ '${{ secrets.CROSSBOW_GEMFURY_ORG }}' }}
103 {% endif %}
104 {% endmacro %}
105
106 {%- macro azure_checkout_arrow() -%}
107 - script: |
108 git clone --no-checkout {{ arrow.remote }} arrow
109 git -C arrow fetch -t {{ arrow.remote }} {{ arrow.branch }}
110 git -C arrow checkout FETCH_HEAD
111 git -C arrow submodule update --init --recursive
112 displayName: Clone arrow
113 {% endmacro %}
114
115 {%- macro azure_upload_releases(pattern) -%}
116 - task: UsePythonVersion@0
117 inputs:
118 versionSpec: '3.8'
119 - script: pip install -e arrow/dev/archery[crossbow-upload]
120 displayName: Install Crossbow
121 - bash: |
122 archery crossbow \
123 --queue-path $(pwd) \
124 --queue-remote {{ queue_remote_url }} \
125 upload-artifacts \
126 --sha {{ task.branch }} \
127 --tag {{ task.tag }} \
128 {% if pattern is string %}
129 "{{ pattern }}"
130 {% elif pattern is iterable %}
131 {% for p in pattern %}
132 "{{ p }}" {{ "\\" if not loop.last else "" }}
133 {% endfor %}
134 {% endif %}
135 env:
136 CROSSBOW_GITHUB_TOKEN: $(CROSSBOW_GITHUB_TOKEN)
137 displayName: Upload packages as a GitHub release
138 {% endmacro %}
139
140 {%- macro azure_upload_anaconda(pattern) -%}
141 {%- if arrow.branch == 'master' -%}
142 - task: CondaEnvironment@1
143 inputs:
144 packageSpecs: 'anaconda-client'
145 installOptions: '-c conda-forge'
146 updateConda: no
147 - script: |
148 conda install -y anaconda-client
149 anaconda -t $(CROSSBOW_ANACONDA_TOKEN) upload --force {{ pattern }}
150 displayName: Upload packages to Anaconda
151 {% endif %}
152 {% endmacro %}
153
154 {%- macro travis_checkout_arrow() -%}
155 - git clone --no-checkout {{ arrow.remote }} arrow
156 - git -C arrow fetch -t {{ arrow.remote }} {{ arrow.branch }}
157 - git -C arrow checkout FETCH_HEAD
158 - git -C arrow submodule update --init --recursive
159 {% endmacro %}
160
161 {%- macro travis_install_archery() -%}
162 - sudo -H pip3 install --upgrade pip
163 - sudo -H pip3 install docker-compose
164 - sudo -H pip3 install -e arrow/dev/archery[docker]
165 {% endmacro %}
166
167 {%- macro travis_docker_login() -%}
168 - echo "${DOCKERHUB_TOKEN}" | docker login --username "${DOCKERHUB_USER}" --password-stdin
169 {% endmacro %}
170
171 {%- macro travis_upload_releases(pattern) -%}
172 - sudo -H pip3 install pygit2==1.0
173 - sudo -H pip3 install -e arrow/dev/archery[crossbow-upload]
174 - |
175 archery crossbow \
176 --queue-path $(pwd) \
177 --queue-remote {{ queue_remote_url }} \
178 upload-artifacts \
179 --sha {{ task.branch }} \
180 --tag {{ task.tag }} \
181 {% if pattern is string %}
182 "{{ pattern }}"
183 {% elif pattern is iterable %}
184 {% for p in pattern %}
185 "{{ p }}" {{ "\\" if not loop.last else "" }}
186 {% endfor %}
187 {% endif %}
188 {% endmacro %}
189
190 {%- macro travis_upload_gemfury(pattern) -%}
191 {%- if arrow.branch == 'master' -%}
192 - |
193 WHEEL_PATH=$(echo arrow/python/repaired_wheels/*.whl)
194 curl \
195 -F "package=@${WHEEL_PATH}" \
196 "https://${CROSSBOW_GEMFURY_TOKEN}@push.fury.io/${CROSSBOW_GEMFURY_ORG}/"
197 {% endif %}
198 {% endmacro %}