Skip to content

Commit

Permalink
DOCS: create DEVELOPMENT.md docs (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v authored Jul 21, 2020
1 parent 5e619e9 commit 1d403e8
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 71 deletions.
17 changes: 13 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,17 @@ Once your changes are ready to submit for review:
We ask this of all contributors in order to assure our users of the origin and continuing existence of the code.
You only need to sign the CLA once.

2. Test your changes
2. Build and package your changes

Run the build and package goals to make sure that nothing is broken.
See [development](#development) for details.

3. Test your changes

Run the test suite to make sure that nothing is broken.
See [testing](#testing) for details.

3. Rebase your changes
4. Rebase your changes

Update your local repository with the most recent code from the main repo,
and rebase your branch on top of the latest master branch.
Expand All @@ -73,7 +78,7 @@ Once your changes are ready to submit for review:
This makes them easier to review.
As a final step before merging, we will either ask you to squash all commits yourself or we'll do it for you.

4. Submit a pull request
5. Submit a pull request

Push your local changes to your forked copy of the repository and [submit a pull request](https://help.github.com/articles/using-pull-requests).
In the pull request,
Expand All @@ -82,12 +87,16 @@ Once your changes are ready to submit for review:
Also mention the number of the issue where the discussion has taken place,
eg "Closes #123".

5. Be patient
6. Be patient

We might not be able to review your code as fast as we would like to,
but we'll do our best to dedicate it the attention it deserves.
Your effort is much appreciated!

### Development

See [development documentation](DEVELOPMENT.md).

### Testing

Coming soon [TBD]
Expand Down
72 changes: 72 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Local development

## Build/package

### Using the docker approach

If you don't want to install any of the dependencies you might need to compile and install the library then you can use the Dockerfile.

```bash
## To prepare the build docker container
PHP_VERSION=7.2 make -f .ci/Makefile prepare

## To compile the library
PHP_VERSION=7.2 make -f .ci/Makefile build

## To test the library
PHP_VERSION=7.2 make -f .ci/Makefile test

## To install the library
PHP_VERSION=7.2 make -f .ci/Makefile install

## To install with composer
PHP_VERSION=7.2 make -f .ci/Makefile composer

## Help goal will provide further details
make -f .ci/Makefile help
```

_NOTE_: `PHP_VERSION` can be set to a different PHP version.

To generate the packages then you can use the `packaging/Dockerfile`, see the below commands:

| :warning: :construction: **WARNING: The packaging stage is still in development!** |
| --- |

```bash
## To build the docker image that will be used later on for packaging the project
make -C packaging build

## To create the rpm package
make -C packaging rpm

## To create the deb package
make -C packaging deb

## To create all the packages that are supported
make -C packaging package

## To list the metadata info of the above generated packages
make -C packaging info

## To test the installation in debian
make -C packaging deb-install

## Help goal will provide further details
make -C packaging help
```

_NOTE_: current implementation requires to use `make -C packaging <target>` since the workspace
is mounted as a volume.

## Documentation

To build the documentation for this project you must first clone the [`elastic/docs` repository](https://github.com/elastic/docs/). Then run the following commands:

```bash
# Set the location of your repositories
export GIT_HOME="/<fullPathTYourRepos>"

# Build the PHP documentation
$GIT_HOME/docs/build_docs --doc $GIT_HOME/apm-agent-php/docs/index.asciidoc --chunk 1 --open
```
67 changes: 0 additions & 67 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,73 +24,6 @@ See the [documentation](docs) for setup and configuration details.

See [contributing documentation](CONTRIBUTING.md).

### Local development

If you don't want to install any of the dependencies you might need to compile and install the library then you can use the Dockerfile.

```bash
## To prepare the build docker container
PHP_VERSION=7.2 make -f .ci/Makefile prepare

## To compile the library
PHP_VERSION=7.2 make -f .ci/Makefile build

## To test the library
PHP_VERSION=7.2 make -f .ci/Makefile test

## To install the library
PHP_VERSION=7.2 make -f .ci/Makefile install

## To install with composer
PHP_VERSION=7.2 make -f .ci/Makefile composer

## Help goal will provide further details
make -f .ci/Makefile help
```

_NOTE_: `PHP_VERSION` can be set to a different PHP version.


To generate the packages then you can use the `packaging/Dockerfile`.

```bash
## To build the docker image that will be used later on for packaging the project
make -C packaging build

## To create the rpm package
make -C packaging rpm

## To create the deb package
make -C packaging deb

## To create all the packages that are supported
make -C packaging package

## To list the metadata info of the above generated packages
make -C packaging info

## To test the installation in debian
make -C packaging deb-install

## Help goal will provide further details
make -C packaging help
```

_NOTE_: current implementation requires to use `make -C packaging <target>` since the workspace
is mounted as a volume.

## Documentation

To build the documentation for this project you must first clone the [`elastic/docs` repository](https://github.com/elastic/docs/). Then run the following commands:

```bash
# Set the location of your repositories
export GIT_HOME="/<fullPathTYourRepos>"

# Build the PHP documentation
$GIT_HOME/docs/build_docs --doc $GIT_HOME/apm-agent-php/docs/index.asciidoc --chunk 1 --open
```

## License

Elastic APM PHP Agent is licensed under [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.html)

0 comments on commit 1d403e8

Please sign in to comment.