Skip to content

Commit

Permalink
add docs preview job
Browse files Browse the repository at this point in the history
  • Loading branch information
assignUser committed Aug 18, 2022
1 parent 0f75d60 commit d5f5c94
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 2 deletions.
3 changes: 2 additions & 1 deletion dev/archery/archery/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion dev/tasks/docker-tests/github.linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
56 changes: 56 additions & 0 deletions dev/tasks/docs/github.linux.yml
Original file line number Diff line number Diff line change
@@ -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 "[email protected]"
git add docs/pr/{{ pr_number }}
git commit -m "Add docs preview for PR {{ pr_number }}"
git push
9 changes: 9 additions & 0 deletions dev/tasks/tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit d5f5c94

Please sign in to comment.