Skip to content

Commit

Permalink
updated setup.py and updated readme.md file
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashif4354 committed Jul 28, 2024
1 parent 203a551 commit aa5ad49
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 14 deletions.
56 changes: 43 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,61 @@
You need to have a mongodb database preferrably on cloud. You can use mongodb atlas for the same, MongoDB have a serverless db cluster which is very cheap (0.1$ / 1M reads). they also have a good free tier. After configuring, get the connection url and save it.
# DGUPDATER

You need to get two connection string from mongo db, one with write access and one with read access.
the one with write access will be used by the developer to write data to the database and the one with read access will be used by the client to read data from the database. both the connection string should have access to the same cluser and databases.
## Requirements for using dgupdater

* You need to have a mongodb database preferrably on cloud. You can use mongodb atlas for the same, MongoDB has a serverless db cluster which is very cheap (0.1$ / 1M reads). they also have a good free tier.
After configuring, get the connection string and save it.

# Initialization
You have open a terminal and navigate into th directory which you want to initialize for auto updation. Then run the following command:
* You need to create two database users in the database, one with only read access and one with only write access.
The user with write access will be used by the developer to write data to the database and the user with read access will be used by the client to read data from the database.

* When initializing the application will ask two connection strings, one with write access and one with read access.
So replace the username and password in the connection string with the username and password of the user with write and read access respectively.

<!-- You need to get two connection string from mongo db, one with write access and one with read access.
the one with write access will be used by the developer to write data to the database and the one with read access will be used by the client to read data from the database. both the connection string should have access to the same cluser and databases. -->


## Initialization
You have open a terminal and navigate into the directory which you want to initialize for auto updation. Then run the following command:

```bash
dgupdater init
```

This will ask you for the application name, application version, mongodb connection string with read access, mongodb connection string with write access. After providing the required information, it will create a file named 'dgupdaterconf.json' in the current directory. This file will be used to store the configuration of the application.
* This will ask you for the application name, application version, mongodb connection string with read access, mongodb connection string with write access. After providing the required information, it will create a file named 'dgupdaterconf.json' in the current directory. This file will be used to store the configuration of the application.

The mongodbconnection string with write access will be stored in a different place

It will be stored in the following location:
* The mongodbconnection string with write access will be stored in a different place as follows
```bash
Windows: C:\Users\<username>\AppData\local\DarkGlance\dgupdater\dgupdaterconf.json
Windows: C:/Users/<username>/AppData/local/DarkGlance/dgupdater/dgupdaterconf.json
Linux: /home/<username>/.config/DarkGlance/dgupdater/dgupdaterconf.json
Mac: Users/<username>/Library/Application Support/DarkGlance/dgupdater/dgupdaterconf.json
```

Then it will check if the application is already registered in the database or not. If it is not registered, it will register the application in the database. or it will ask to overwrite the application details.
* Then it will check if the application is already registered in the database or not. If it is not registered, it will register the application in the database. or it will ask to overwrite the application details.

It will also create a file named .dgupdaterignore in the current directory.
* It will also create a file named .dgupdaterignore in the current directory.
this file works just like the .gitignore file. you can add the files and directories which you want to ignore while updating the application.

If you want tp change the mongodb connection string, you can do it by running 'dgupdater init' again and providing the new connection string.
* If you want to change the mongodb connection string, you can do it by running 'dgupdater init' again and providing the new connection string.

* After initializing the application, you can continue building the application and when you are ready to update the application, you can commit the changes.

## Commiting the changes

* After making the changes in the application, you can commit the changes by running the following command:

```bash
dgupdater commit
```

* This will ask for the new versio number of the application.
* After providing the version number, it will ask confirmation to commit the changes. If you confirm, it will commit the changes.

* In this process the following things will happen:

1. The files and directories mentioned in the .dgupdaterignore file will be ignored.
2. It will create a folder named 'dgupdater_release' in the directory
3. It will create another folder named 'chunks' in the dgupdater_release folder.
4. It will then create a new dgupdaterconf.json file in the dgupdater_release folder with the updated data.
5. It will then divide the files into smaller chunks and save them in the chunks folder.
6. The commiting process is complete.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

setup(
name="dgupdater",
version="0.2.5",
version="0.3.0",
author="DarkGlance",
author_email="[email protected]",
description="A CLI based auto updation assistant tool for python applications",
Expand Down

0 comments on commit aa5ad49

Please sign in to comment.