Skip to content

Commit

Permalink
Delete serverless directory on backport PRs (#3916)
Browse files Browse the repository at this point in the history
* simplified action that produces conflicts

* Update delete-serverless-dir-on-backports.yml

* Update .github/workflows/delete-serverless-dir-on-backports.yml

* Update .github/workflows/delete-serverless-dir-on-backports.yml

* add to readme

(cherry picked from commit 4a57e39)

# Conflicts:
#	README.md
  • Loading branch information
bmorelli25 authored and mergify[bot] committed Jun 17, 2024
1 parent 19f4fdf commit ef6b022
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/delete-serverless-dir-on-backports.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Delete serverless directory in backports

on:
pull_request:
branches:
- '7.*'
- '8.*'

jobs:
check-and-delete-serverless:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Check for existence of docs/en/serverless directory
id: check_serverless
run: |
if [ -d "docs/en/serverless" ]; then
echo "SERVERLESS_EXISTS=true" >> $GITHUB_ENV
else
echo "SERVERLESS_EXISTS=false" >> $GITHUB_ENV
fi
- name: Delete docs/en/serverless directory if it exists
if: env.SERVERLESS_EXISTS == 'true'
run: |
rm -rf docs/en/serverless
git config pull.rebase true
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add .
git commit -m "Delete docs/en/serverless directory"
git pull origin ${{ github.head_ref }}
git push origin HEAD:${{ github.head_ref }}
62 changes: 62 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,68 @@ Within this repo, the `/docs/en/` directory is structured as follows:
| __shared__ | Contains the source files for shared Observability content.|
| __templates__ | Contains content templates.|

<<<<<<< HEAD
=======
## Contributing

If you find any bugs in our documentation, or want to request an enhancement, then you can open an issue using our template. We also welcome contributions in the form of PRs. Before you submit a PR, make sure that you have signed our [Contributor License Agreement](https://www.elastic.co/contributor-agreement/).

Contributing directly to the docs works differently across the doc sets in this repo.

### Observability Guide

The source files for the Observability Guide are written in [AsciiDoc](https://docs.asciidoctor.org/asciidoc/latest/) and are built using [elastic/docs](https://github.com/elastic/docs).

To build the docs locally:

1. Check out the `elastic/docs` repository, along with any repositories that contain source files.
2. Run the `build_docs` script, passing in the path to the `index.asciidoc` and resource paths to other repos that contain source files. For example, to build the Observability Guide and open it in the browser, run:
```
../docs/build_docs --doc ./docs/en/observability/index.asciidoc --chunk 3 --resource ../apm-server --resource ../ingest-docs/docs --open
```

The above command assumes that this repo, [elastic/docs](https://github.com/elastic/docs), [elastic/ingest-docs](https://github.com/elastic/ingest-docs), and [elastic/apm-server](https://github.com/elastic/apm-server) are checked out into the same parent directory.

If you prefer to use aliases, you can load the [elastic/docs/doc_build_aliases.sh file](https://github.com/elastic/docs/blob/master/doc_build_aliases.sh), which has the resources defined for you.

### Elastic Observability Serverless docs

The Elastic Observability Serverless docs use a custom syntax written in [MDX](https://mdxjs.com/). In many cases, you only need to know plain Markdown to contribute. We'll add a public component reference and additional contribution guidelines in future. Elasticians can refer to our [internal syntax reference](https://docs.elastic.dev/docsmobile/syntax).

### Integrations Developer Guide

The source files for the Integrations Developer Guide are written in [AsciiDoc](https://docs.asciidoctor.org/asciidoc/latest/) and are built using [elastic/docs](https://github.com/elastic/docs).

To build the docs locally:

1. Check out the `elastic/docs` repository, along with any repositories that contain source files.
2. Run the `build_docs` script, passing in the path to the `index.asciidoc` and resource paths to other repos that contain source files. For example, to build the Observability Guide and open it in the browser, run:
```
../docs/build_docs --doc ./docs/en/integrations/index.asciidoc --resource=../package-spec/versions --chunk 1 --open
```

The above command assumes that this repo, [elastic/docs](https://github.com/elastic/docs), and [elastic/package-spec](https://github.com/elastic/package-spec), are checked out into the same parent directory.

If you prefer to use aliases, you can load the [elastic/docs/doc_build_aliases.sh file](https://github.com/elastic/docs/blob/master/doc_build_aliases.sh), which has the resources defined for you.

## Backporting

Backporting works differently across the doc sets in this repo.

### Observability Guide

Pull requests should be tagged with the target version of the Elastic Stack along with any relevant backport labels. In general, we only backport documentation changes to [live stack versions](https://github.com/elastic/docs/blob/master/conf.yaml#L74). For manual backports, we recommend using the [backport tool](https://github.com/sqren/backport) to easily open backport PRs. If you need help, ping **[@obs-docs](https://github.com/orgs/elastic/teams/obs-docs)** and we'd be happy to handle the backport process for you.

### Elastic Observability Serverless docs

Serverless docs are not versioned, and should never be backported. All changes should be made to the `main` branch.
If you're backporting Serverless and Stateful content in the same PR, an automation will run that deletes the `docs/en/serverless` dir from your PR.

### Integrations Developer Guide

The Integrations Developer Guide is not versioned, and should never be backported. All changes should be made to the `main` branch.

>>>>>>> 4a57e394 (Delete serverless directory on backport PRs (#3916))
## Reviews

All documentation pull requests automatically add the **[@obs-docs](https://github.com/orgs/elastic/teams/obs-docs)** team as a reviewer.
Expand Down

0 comments on commit ef6b022

Please sign in to comment.