Skip to content

Commit

Permalink
update docs and add contribution guideline
Browse files Browse the repository at this point in the history
  • Loading branch information
sagautam5 committed Apr 28, 2024
1 parent b418a6b commit 9ce23f9
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 14 deletions.
19 changes: 15 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,31 @@ Before filing an issue:
Before submitting a pull request:
- Fetch the phpunit testing dependency by executing following command on root of the project.
```sh
composer update
```- Check the pull requests tab to ensure that the bug doesn't have a fix in progress.
composer install
```
- Check the pull requests tab to ensure that the bug doesn't have a fix in progress.

- Create and test the feature/issue and make sure it doesn't affect codebase by running full tests by executing following console command for two different environment variables.

Set APP_LANG to np and en respectively and run following command for each value of language.
```sh
vendor/bin/phpunit
vendor/bin/phpunit
```
- Make sure contribution align with phpstan standards. You can run following command to ensure this.
```sh
vendor/bin/phpunit analyse --level=9
```
<!-- - Make sure unit tests are passed on pipeline after your updates. -->
- Check the codebase to ensure that your feature doesn't already exist.
- Check the pull requests to ensure that another person hasn't already submitted the feature or fix.
<!-- - Send pull request to dev branch only. -->

## Docker Option

We have recently added workflow to setup this package with Docker Desktop. You can find guidelines in the following document.

- [Local setup with Docker](https://github.com/sagautam5/local-states-nepal/tree/master/docs/docker/setup.md)

## Requirements

If the project maintainer has any additional requirements, you will find them listed here.
Expand All @@ -61,4 +72,4 @@ If the project maintainer has any additional requirements, you will find them li

- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](https://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting.

**Happy coding**!
**Happy coding** !
20 changes: 10 additions & 10 deletions docs/docker/setup.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
## Local setup with docker
## Local setup with Docker

In order to make contribution and bug reporting easier, we have recently dockerized this package so that contributors can setup, run tests and view demo locally in just few steps.
You can clone this repository in your computer. Assuming you have docker desktop configured in your computer, you just have to run following command.
In order to make contribution and bug reporting easier, we have recently Dockerized this package so that contributors can setup, run tests and view demo locally in just a few steps.
You can clone this repository on your computer. Assuming you have docker desktop configured in your computer, you just have to run the following command:


If docker desktop is not installed in your computer, You can setup docker desktop from official docs [Docker Desktop](https://docs.docker.com/desktop/)
If Docker Desktop is not installed on your computer, you can setup Docker Desktop from th official docs [Docker Desktop](https://docs.docker.com/desktop/)


docker compose up -d


On successful execution of above command, you will have a docker container `localstates` and `nginx` configuration too. You can access demo by visiting following url
On successful execution of the above command, you will have a Docker container `localstates` and `nginx` configuration too. You can access demo by visiting the following url

[localstates.test](http://localstates.test)

With following command, we can enter to our container.
With the following command, we can enter our container.

docker compose exec localstates bash

Expand All @@ -29,11 +29,11 @@ vendor/bin/phpstan analyse --level=9
We have uploaded docker images for various version of the php. If you find bug related to specific version of the php, then you can report the bug or contribute on bug
fixing by using respective docker image in your setup.

In the docker file, you can update following line with specific docker image.
In the `Dockerfile`, you can update the following line with an specific Docker image.

FROM sagautam5/localstates_8.3:v1.0

As you can see, Above image is for php 8.3. We have the following docker images for respective php versions.
As you can see,the above image is for PHP 8.3. We have the following Docker images for the respective PHP versions.

- [sagautam5/localstates_7.1:v1.0](https://hub.docker.com/r/sagautam5/localstates_7.1)
- [sagautam5/localstates_7.2:v1.0](https://hub.docker.com/r/sagautam5/localstates_7.2)
Expand All @@ -44,8 +44,8 @@ As you can see, Above image is for php 8.3. We have the following docker images
- [sagautam5/localstates_8.2:v1.0](https://hub.docker.com/r/sagautam5/localstates_8.2)
- [sagautam5/localstates_8.3:v1.0](https://hub.docker.com/r/sagautam5/localstates_8.3)

After updating docker file, you have recreate the container with following command.
After updating `Dockerfile`, you have to recreate the container with the following command:

docker compose up -d --force-recreate

Now, it's ready with specific version of php
Now, it's ready with an specific version of PHP

0 comments on commit 9ce23f9

Please sign in to comment.