Skip to content

Commit

Permalink
chore: stopped using staging branch
Browse files Browse the repository at this point in the history
  • Loading branch information
borolepratik committed Mar 6, 2024
1 parent 5602537 commit df41b50
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 63 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ name: Test, Build, Publish, Release

on:
push:
branches: [main, staging, dev]
branches: [main, dev]
pull_request:
branches: [main, staging, dev]
branches: [main, dev]

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
# if branch is main, use prod, else staging or dev as necessary
BUILD_NAME: ${{ github.ref == 'refs/heads/main' && 'prod' || github.ref == 'refs/heads/staging' && 'staging' || 'dev' }}
# if branch is main, use prod, else dev
BUILD_NAME: ${{ github.ref == 'refs/heads/main' && 'prod' || 'dev' }}

jobs:
test:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ name: "CodeQL"

on:
push:
branches: [main, staging, dev]
branches: [main, dev]
pull_request:
branches: [main, staging, dev]
branches: [main, dev]
schedule:
- cron: "26 3 * * 6"

Expand Down
49 changes: 0 additions & 49 deletions Dockerfile.staging

This file was deleted.

6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,19 +147,17 @@ For other docker commands, see [useful_commands.md](./useful_commands.md)
- [Git Graph](https://marketplace.visualstudio.com/items?itemName=mhutchie.git-graph) (free)
- **Branches**:
- `main` is the production mainline.
- `staging` is the staging line.
- `dev` is the development line (***default branch***).
- **PR merge strategy on Github**
- Code should flow in the following direction through branches:
```
feature/bug fix -> dev -> staging -> main
feature/bug fix -> dev -> main
```
- We'll be keeping a linear commit history and so using a combination of `Rebase and merge` and `Squash and merge` merge strategies.
- Use `Rebase and merge` as ***default*** to ensure all commits from the branch to be merged are brought in individually to the target branch.
- `Squash and merge` may be used ***ONLY*** when bringing in changes from a feature/bug fix branch into `dev`.
- To maintain linear commit history, ensure to use `push force` when:
- Bringing `dev` on the same commit as `staging` (ie rebasing `dev` onto `staging`).
- Bringing `staging` on the same commit as `main` (ie rebasing `staging` onto `main`).
- Bringing `dev` on the same commit as `main` (ie rebasing `dev` onto `main`).
- [More information on git rebase](https://www.atlassian.com/git/tutorials/rewriting-history/git-rebase).
- [More information on PR merge strategies](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/about-merge-methods-on-github).
- **Jira issue linking**
Expand Down
4 changes: 0 additions & 4 deletions useful_commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,31 +71,27 @@ docker ps

```sh
docker build --file Dockerfile.dev --tag backend-dev .
docker build --file Dockerfile.staging --tag backend-staging .
docker build --file Dockerfile.prod --tag backend-prod .
```

#### Start the containers

```sh
docker run --name backend-dev --publish 8081:8081 backend-dev --detach
docker run --name backend-staging --publish 80:80 backend-staging --detach
docker run --name backend-prod --publish 80:80 backend-prod --detach
```

#### Stop the containers

```sh
docker stop backend-dev
docker stop backend-staging
docker stop backend-prod
```

#### Restart the containers

```sh
docker restart backend-dev
docker restart backend-staging
docker restart backend-prod
```

Expand Down

0 comments on commit df41b50

Please sign in to comment.