diff --git a/dev/archery/archery/bot.py b/dev/archery/archery/bot.py index fb300f554c03d..020c299e0c7ad 100644 --- a/dev/archery/archery/bot.py +++ b/dev/archery/archery/bot.py @@ -259,7 +259,8 @@ def submit(obj, tasks, groups, params, arrow_version): # parse additional job parameters params = dict([p.split("=") for p in params]) - + params['pr_number'] = pull_request.number + # instantiate the job object job = Job.from_config(config=config, target=target, tasks=tasks, groups=groups, params=params) diff --git a/dev/tasks/docker-tests/github.linux.yml b/dev/tasks/docker-tests/github.linux.yml index c74731cec01d0..f7fd6a0be6eff 100644 --- a/dev/tasks/docker-tests/github.linux.yml +++ b/dev/tasks/docker-tests/github.linux.yml @@ -26,7 +26,7 @@ jobs: runs-on: ubuntu-latest {{ macros.github_set_env(env) }} steps: - {{ macros.github_checkout_arrow(fetch_depth=fetch_depth if fetch_depth is defined else 1)|indent }} + {{ macros.github_checkout_arrow(fetch_depth=fetch_depth|default(1))|indent }} {{ macros.github_install_archery()|indent }} - name: Execute Docker Build diff --git a/dev/tasks/docs/github.linux.yml b/dev/tasks/docs/github.linux.yml new file mode 100644 index 0000000000000..b48ac0b0b3eec --- /dev/null +++ b/dev/tasks/docs/github.linux.yml @@ -0,0 +1,56 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +{% import 'macros.jinja' as macros with context %} + +{{ macros.github_header() }} + +jobs: + test: + name: Docs Preview + runs-on: ubuntu-latest +{{ macros.github_set_env(env) }} + steps: + {{ macros.github_checkout_arrow(fetch_depth=fetch_depth|default(1))|indent }} + {{ macros.github_install_archery()|indent }} + + - name: Execute Docker Build + shell: bash + run: | + archery docker run \ + -e SETUPTOOLS_SCM_PRETEND_VERSION="{{ arrow.no_rc_version }}" \ + {{ flags|default("") }} \ + {{ image }} \ + {{ command|default("") }} + - name: Checkout Crossbow + uses: actions/checkout@v3 + with: + ref: {{ default_branch|default("master") }} + path: crossbow + fetch-depth: 1 + - name: Move docs + run: | + sudo chown -R ${USER}: build + mv --force build crossbow/docs/pr/{{ pr_number }} + - name: Push changes + run: | + cd crossbow + git config --local user.name "Github Actions" + git config --local user.email "github-actions@users.noreply.github.com" + git add docs/pr/{{ pr_number }} + git commit -m "Add docs preview for PR {{ pr_number }}" + git push \ No newline at end of file diff --git a/dev/tasks/tasks.yml b/dev/tasks/tasks.yml index a07c4d878ce79..356dce7025675 100644 --- a/dev/tasks/tasks.yml +++ b/dev/tasks/tasks.yml @@ -1607,3 +1607,12 @@ tasks: type: minimal_build run: {{ kind }} {% endfor %} + +############################## Utility tasks ############################ + preview-docs: + ci: github + template: docs/github.linux.yml + params: + artifacts: "build/docs.tar.gz" + flags: "-v $PWD/build/:/build/" + image: ubuntu-docs \ No newline at end of file