-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
716 changed files
with
57,385 additions
and
1,487 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,39 @@ | ||
#!/bin/bash | ||
|
||
REGEX="^((Merge[ a-z-]* branch.*)|(Revert*)|((build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\(.*\))?!?: .*))" | ||
# Regex to validate the type pattern | ||
REGEX="^((Merge[ a-z-]* branch.*)|(Revert.*)|((build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\(.*\))?!?: .*))" | ||
|
||
# Check if a file argument was provided | ||
if [ -z "$1" ]; then | ||
echo >&2 "ERROR: No commit message file provided." | ||
exit 1 | ||
fi | ||
|
||
# Read the commit message from the file passed as an argument | ||
FILE=$(cat "$1") | ||
|
||
FILE=$(cat $1) | ||
echo "Commit Message: ${FILE}" | ||
|
||
if ! [[ $FILE =~ $REGEX ]]; then | ||
echo >&2 "ERROR: Commit aborted for not following the Conventional Commit standard." | ||
if [[ ! $FILE =~ $REGEX ]]; then | ||
echo >&2 "ERROR: Commit aborted for not following the Conventional Commit standard." | ||
|
||
# Check if the message is missing a valid type | ||
if ! [[ $FILE =~ ^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\(.*\))?!?: ]]; then | ||
echo >&2 "Hint: Commit message must start with one of the following types: build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test." | ||
fi | ||
|
||
# Check if the message is missing the scope (optional) and subject | ||
if [[ ! $FILE =~ ^((build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\(.*\))?!?: ) ]]; then | ||
echo >&2 "Hint: Commit message must follow the pattern 'type(scope): subject'. The scope is optional." | ||
fi | ||
|
||
# Check if the message is missing the colon and space after type (and scope) | ||
if [[ $FILE =~ ^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\(.*\))?[^:]*$ ]]; then | ||
echo >&2 "Hint: Commit message must include a colon and space after the type (and scope if present)." | ||
fi | ||
|
||
exit 1 | ||
else | ||
echo >&2 "Valid commit message." | ||
fi | ||
echo "Valid commit message." | ||
fi | ||
|
16 changes: 10 additions & 6 deletions
16
.github/workflows/build-and-test.yml → .github/workflows/ci-build-lint-test.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Dev Deployment | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- dev | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Build Docker image | ||
run: docker build -t csharp_dev . | ||
|
||
- name: Save and compress Docker image | ||
run: docker save csharp_dev | gzip > csharp_dev.tar.gz | ||
|
||
- name: Upload Docker image | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: csharp_dev | ||
path: csharp_dev.tar.gz | ||
|
||
deploy: | ||
needs: build | ||
if: github.event.repository.fork == false | ||
runs-on: ubuntu-latest | ||
|
||
environment: | ||
name: "dev" | ||
url: ${{ vars.URL }} | ||
|
||
steps: | ||
- name: Download Docker image | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: csharp_dev | ||
path: . | ||
|
||
- name: Copy image to server | ||
uses: appleboy/scp-action@master | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
password: ${{ secrets.PASSWORD }} | ||
source: csharp_dev.tar.gz | ||
target: "/tmp" | ||
|
||
- name: Deploy on server | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
password: ${{ secrets.PASSWORD }} | ||
script: | | ||
gunzip -c /tmp/csharp_dev.tar.gz | docker load | ||
rm -f /tmp/csharp_dev.tar.gz | ||
cd ~/hng_boilerplate_csharp_web | ||
docker compose -p csharp_dev up -d |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Production Deployment | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Build Docker image | ||
run: docker build -t csharp_prod . | ||
|
||
- name: Save and compress Docker image | ||
run: docker save csharp_prod | gzip > csharp_prod.tar.gz | ||
|
||
- name: Upload Docker image | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: csharp_prod | ||
path: csharp_prod.tar.gz | ||
|
||
deploy: | ||
needs: build | ||
if: github.event.repository.fork == false | ||
runs-on: ubuntu-latest | ||
|
||
environment: | ||
name: "production" | ||
url: ${{ vars.URL }} | ||
|
||
steps: | ||
- name: Download Docker image | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: csharp_prod | ||
path: . | ||
|
||
- name: Copy image to server | ||
uses: appleboy/scp-action@master | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
password: ${{ secrets.PASSWORD }} | ||
source: csharp_prod.tar.gz | ||
target: "/tmp" | ||
|
||
- name: Deploy on server | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
password: ${{ secrets.PASSWORD }} | ||
script: | | ||
gunzip -c /tmp/csharp_prod.tar.gz | docker load | ||
rm -f /tmp/csharp_prod.tar.gz | ||
cd ~/hng_boilerplate_csharp_web | ||
docker compose -p csharp_prod -f docker-compose.prod.yml up -d |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Staging Deployment | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- staging | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Build Docker image | ||
run: docker build -t csharp_staging . | ||
|
||
- name: Save and compress Docker image | ||
run: docker save csharp_staging | gzip > csharp_staging.tar.gz | ||
|
||
- name: Upload Docker image | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: csharp_staging | ||
path: csharp_staging.tar.gz | ||
|
||
deploy: | ||
needs: build | ||
if: github.event.repository.fork == false | ||
runs-on: ubuntu-latest | ||
|
||
environment: | ||
name: "staging" | ||
url: ${{ vars.URL }} | ||
|
||
steps: | ||
- name: Download Docker image | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: csharp_staging | ||
path: . | ||
|
||
- name: Copy image to server | ||
uses: appleboy/scp-action@master | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
password: ${{ secrets.PASSWORD }} | ||
source: csharp_staging.tar.gz | ||
target: "/tmp" | ||
|
||
- name: Deploy on server | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
password: ${{ secrets.PASSWORD }} | ||
script: | | ||
gunzip -c /tmp/csharp_staging.tar.gz | docker load | ||
rm -f /tmp/csharp_staging.tar.gz | ||
cd ~/hng_boilerplate_csharp_web | ||
docker compose -p csharp_staging -f docker-compose.staging.yml up -d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -375,3 +375,8 @@ src/Hng.Web/internal-nlog.txt | |
# AppSettings | ||
appsettings.*.json | ||
|
||
# Rider folder | ||
.idea | ||
|
||
#env files | ||
.envrc |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.