Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
nmcc1212 committed Jun 11, 2024
1 parent 5d92bb3 commit 30633b9
Show file tree
Hide file tree
Showing 239 changed files with 204,754 additions and 208,916 deletions.
36 changes: 18 additions & 18 deletions .github/workflows/build-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,24 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: nmcc1212
password: ${{ secrets.GHCR_PAT }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: nmcc1212
password: ${{ secrets.GHCR_PAT }}

- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64,linux/arm64
file: newAPI/Dockerfile
push: true
tags: ghcr.io/nmcc1212/mongo-api:latest
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64,linux/arm64
file: newAPI/Dockerfile
push: true
tags: ghcr.io/nmcc1212/mongo-api:latest
36 changes: 18 additions & 18 deletions .github/workflows/build-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,27 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: nmcc1212
password: ${{ secrets.GHCR_PAT }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: nmcc1212
password: ${{ secrets.GHCR_PAT }}

- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64,linux/arm64
file: docker/cacher/Dockerfile
push: true
tags: ghcr.io/nmcc1212/cacher:latest
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64,linux/arm64
file: docker/cacher/Dockerfile
push: true
tags: ghcr.io/nmcc1212/cacher:latest

build-next-app:
runs-on: ubuntu-latest
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/old.build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:
branches:
- main


jobs:
build:
name: Build
Expand All @@ -14,7 +13,7 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: install dependencies
working-directory: ./intro to react/vite-project
run: sudo npm install
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/postman.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
postman collection run 32854919-ced710d2-8af1-4f36-bdc1-027dce3c78af -i 32854919-68fb46d3-8dcf-4965-ae19-063315b21e38 --insecure
- name: run users tests
run: |
postman collection run 32854919-ced710d2-8af1-4f36-bdc1-027dce3c78af -i 32854919-df352302-1081-4e05-beb5-b6e62127eb13 --insecure
postman collection run 32854919-ced710d2-8af1-4f36-bdc1-027dce3c78af -i 32854919-df352302-1081-4e05-beb5-b6e62127eb13 --insecure
143 changes: 71 additions & 72 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -1,77 +1,76 @@
name: Tests

on:
push:
branches:
- main

push:
branches:
- main

jobs:
jest:
runs-on: ubuntu-latest
permissions: read-all
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: install dependencies
working-directory: ./next/news-aggregation
run: sudo npm install
- name: install jest globally
run: sudo npm install -g jest
- name: run tests
working-directory: ./next/news-aggregation
run: npm run test
playwright:
runs-on: ubuntu-latest
permissions: read-all
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: install dependencies
working-directory: ./next/news-aggregation
run: sudo npm install
- name: playright setup
run: npx playwright install --with-deps
- name: Tailscale
uses: tailscale/github-action@v2
with:
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
tags: tag:ci
- name: Deploy to remote host
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.NEWNEWTITANIUM_IP }}
username: ${{ secrets.NEWNEWTITANIUM_USER }}
password: ${{ secrets.NEWNEWTITANIUM_PASS }}
script: |
cd /home/nial/TSI
git pull
npm install
screen -S TSI -X quit
screen -dmS TSI npm run dev
- name: run tests
working-directory: ./next/news-aggregation
run: npx playwright test
sonarqube:
runs-on: ubuntu-latest
permissions: read-all
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: install dependencies
working-directory: ./next/news-aggregation
run: sudo npm install
- uses: sonarsource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
# If you wish to fail your job when the Quality Gate is red, uncomment the
# following lines. This would typically be used to fail a deployment.
# - uses: sonarsource/sonarqube-quality-gate-action@master
# timeout-minutes: 5
# env:
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
jest:
runs-on: ubuntu-latest
permissions: read-all
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: install dependencies
working-directory: ./next/news-aggregation
run: sudo npm install
- name: install jest globally
run: sudo npm install -g jest
- name: run tests
working-directory: ./next/news-aggregation
run: npm run test
playwright:
runs-on: ubuntu-latest
permissions: read-all
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: install dependencies
working-directory: ./next/news-aggregation
run: sudo npm install
- name: playright setup
run: npx playwright install --with-deps
- name: Tailscale
uses: tailscale/github-action@v2
with:
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
tags: tag:ci
- name: Deploy to remote host
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.NEWNEWTITANIUM_IP }}
username: ${{ secrets.NEWNEWTITANIUM_USER }}
password: ${{ secrets.NEWNEWTITANIUM_PASS }}
script: |
cd /home/nial/TSI
git pull
npm install
screen -S TSI -X quit
screen -dmS TSI npm run dev
- name: run tests
working-directory: ./next/news-aggregation
run: npx playwright test
sonarqube:
runs-on: ubuntu-latest
permissions: read-all
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: install dependencies
working-directory: ./next/news-aggregation
run: sudo npm install
- uses: sonarsource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
# If you wish to fail your job when the Quality Gate is red, uncomment the
# following lines. This would typically be used to fail a deployment.
# - uses: sonarsource/sonarqube-quality-gate-action@master
# timeout-minutes: 5
# env:
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
12 changes: 6 additions & 6 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"sonarlint.connectedMode.project": {
"connectionId": "macbook",
"projectKey": "nmcc1212_TSI_AYwhmp3yeDOWGHdFx60w"
},
"jest.rootPath": "next/news-aggregation"
}
"sonarlint.connectedMode.project": {
"connectionId": "macbook",
"projectKey": "nmcc1212_TSI_AYwhmp3yeDOWGHdFx60w"
},
"jest.rootPath": "next/news-aggregation"
}
44 changes: 20 additions & 24 deletions FIle handling/EzFileHandling.js
Original file line number Diff line number Diff line change
@@ -1,41 +1,37 @@
// create a new text file or open it if it exists

const fs = require('fs');

const fileName = 'newFile.txt';
const content = 'This is a new file';
const fs = require("fs");

const fileName = "newFile.txt";
const content = "This is a new file";

try {
fs.writeFileSync(fileName, content);
console.log('Saved Text!');
}
catch (err) {
console.error(err);
fs.writeFileSync(fileName, content);
console.log("Saved Text!");
} catch (err) {
console.error(err);
}

// Json file handling
const jsFileName = 'newJsonFile.json';
const jsFileName = "newJsonFile.json";
const jsContent = '{"name":"John", "age":30, "city":"New York"}';

try {
fs.writeFileSync(jsFileName, jsContent);
console.log('Saved JSON!');
const data = fs.readFileSync(jsFileName, 'utf8');
console.log(data);
}
catch (err) {
console.error(err);
fs.writeFileSync(jsFileName, jsContent);
console.log("Saved JSON!");
const data = fs.readFileSync(jsFileName, "utf8");
console.log(data);
} catch (err) {
console.error(err);
}

// Read a json file
const existingJsFile = 'vscode.json';
const existingJsFile = "vscode.json";

try {
const data = fs.readFileSync(existingJsFile, 'utf8');
const obj = JSON.parse(data);
console.log(JSON.stringify(obj, null, 2));
const data = fs.readFileSync(existingJsFile, "utf8");
const obj = JSON.parse(data);
console.log(JSON.stringify(obj, null, 2));
} catch (err) {
console.error(err);
}
catch (err) {
console.error(err);
}
Loading

0 comments on commit 30633b9

Please sign in to comment.