Skip to content

1. HowTo

Pixailz edited this page Aug 25, 2023 · 2 revisions

Run

Install latest docker engine

a full tutorial for each distribution / os on how to install docker engine could be found here

Prod mode

simply invoke docker compose up on the root folder, like so: docker compose up --build

Dev mode

simply invoke docker compose up on the root folder, specifying the docker-compose-dev.yaml file, like so: docker compose -f docker-compose-dev.yaml up --build

Commit

Commits

When creating a new commit, try to break it into as many pieces you can. For example, if you modified both front-end and back-end files for your new feature, add files one by one instead of doing git add . and choose a concise but factual commit message. This makes it easier to revert a bad commit and keep good ones if something goes wrong. Repeat for all modified files until you added them all. If you can, try to follow this spec, which makes it easier in therory to know what the commit does to the project.

Example:

You implemented a password recovery tool and needed to implement the logic in the back-end and the components in the front-end. You also added the components to the login page. You can do as follow :

git add src/backend/controllers/passwordrecovery
git commit -m "✨ [backend] Implemented Backend password recovery logic"

git add src/frontend/components/passwordrecovery
git commit -m "✨ [frontend:components] Created password recovery components for frontend"

git add src/frontend/pages/login/
git commit -m "💄 [frontend:pages] Added 'reset password' component to login page"

git status #this is to check you added all your modifications
git push -u origin nestjs-passrecovery

Feature Branch Workflow

Explained here in details, but here's the basic workflow

Step 1: New Feature

If you think of a new feature to implement, first check if there isn't already a branch trying to implement it. If there isn't, pull from origin then create a new branch named by the feature :

git checkout main
git fetch origin
git reset --hard origin/main
git checkout -b new-feature

Step 2: Code It

~Do your thing!~

Step 3: Commit It

Please refer to above instructions.

Step 4: Push It

Everytime you go away of your PC, and preferably after each commits, push your modifications ! Do not wait until your feature works, as you push it on a dedicated branch that will be merged into main when finished. This also permits multiple people to work on the same feature remotely!

Step 5: Repeat It

Repeat steps 2 to 4 until your feature is perfect!

Step 6: Pull Request It

Create a pull request to merge your branch with main. It needs to be reviewed by someone before you merge it!

Delete all run from a specific actions

  1. sudo apt install gh
  2. create a token in this page, that have repo and workflow access
  3. export GH_TOKEN=<put_your_token_here>
  4. get all actions ids gh api -X GET /repos/$OWNER/$REPO/actions/workflows | jq '.workflows[] | .name,.id'
  5. list all runs id gh api -X GET /repos/$OWNER/$REPO/actions/workflows/$WORKFLOW_ID/runs --paginate | jq '.workflow_runs[] | .id'
  6. delete all runs gh api -X GET /repos/$OWNER/$REPO/actions/workflows/$WORKFLOW_ID/runs --paginate | jq '.workflow_runs[] | .id' | xargs -I{} gh api -X DELETE /repos/$OWNER/$REPO/actions/runs/{} --silent