Skip to content

Commit 4d95e91

Browse files
authored
Merge pull request #91 from boostcampwm-2024/dev-be
[CHORE] backend ci 설정
2 parents 966a2c3 + 1317d87 commit 4d95e91

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+314
-6409
lines changed

.github/workflows/ci.yml

Lines changed: 33 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,39 +10,45 @@ on:
1010
branches:
1111
- dev
1212
- dev-fe
13-
- dev-be
13+
- dev-be
1414

1515
jobs:
1616
build:
1717
runs-on: ubuntu-latest
1818

1919
strategy:
2020
matrix:
21-
workspace: [frontend]
21+
workspace: [frontend, backend]
2222

2323
steps:
24-
- name: Checkout repository
25-
uses: actions/checkout@v3
26-
27-
- name: Setup Node.js
28-
uses: actions/setup-node@v3
29-
with:
30-
node-version: '20'
31-
32-
- name: Install dependencies
33-
run: yarn install
34-
35-
- name: Build ${{ matrix.workspace }}
36-
run: |
37-
cd ${{ matrix.workspace }}
38-
yarn build
39-
40-
- name: Lint ${{ matrix.workspace }}
41-
run: |
42-
cd ${{ matrix.workspace }}
43-
yarn lint || exit 1 # Lint 실패 시 종료
44-
45-
- name: TypeScript Check ${{ matrix.workspace }}
46-
run: |
47-
cd ${{ matrix.workspace }}
48-
yarn tsc --noEmit || exit 1 # 빌드하지 않고 타입 오류만 체크
24+
- name: Checkout repository
25+
uses: actions/checkout@v3
26+
27+
- name: .env setting
28+
run: |
29+
touch ../.env
30+
echo "GITHUB_REGISTRY_TOKEN:${{ secrets.REGISTRY_TOKEN }}" > ../.env
31+
32+
33+
- name: Setup Node.js
34+
uses: actions/setup-node@v3
35+
with:
36+
node-version: '20'
37+
38+
- name: Install dependencies
39+
run: yarn install
40+
41+
- name: Build ${{ matrix.workspace }}
42+
run: |
43+
cd ${{ matrix.workspace }}
44+
yarn build
45+
46+
- name: Lint ${{ matrix.workspace }}
47+
run: |
48+
cd ${{ matrix.workspace }}
49+
yarn lint || exit 1 # Lint 실패 시 종료
50+
51+
- name: TypeScript Check ${{ matrix.workspace }}
52+
run: |
53+
cd ${{ matrix.workspace }}
54+
yarn tsc --noEmit || exit 1 # 빌드하지 않고 타입 오류만 체크

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44
!.yarn/releases
55
!.yarn/sdks
66
!.yarn/versions
7+
!.yarn/plugin-env-npm.js
78

89
.DS_Store
910
.idea
1011

12+
backend/.env
1113
.env
12-
1314
# Swap the comments on the following lines if you wish to use zero-installs
1415
# In that case, don't forget to run `yarn config set enableGlobalCache false`!
1516
# Documentation here: https://yarnpkg.com/features/caching#zero-installs

.yarn/plugin-env-npm.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
module.exports = {
2+
name: 'plugin-env-npm',
3+
factory: require => ({
4+
hooks: {
5+
async getNpmAuthenticationHeader(currentHeader, registry, {ident}){
6+
// only trigger for specific scope
7+
if (!ident || ident.scope !== 'hoeeeeeh') {
8+
return currentHeader
9+
}
10+
11+
// try getting token from process.env
12+
let bufEnv = process.env.BUF_REGISTRY_TOKEN
13+
// alternatively, try to find it in .env
14+
if (!bufEnv) {
15+
const fs = require('fs/promises')
16+
const fileContent = await fs.readFile('../.env', 'utf8')
17+
const rows = fileContent.split(/\r?\n/)
18+
for (const row of rows) {
19+
const [key, value] = row.split(':', 2)
20+
if (key.trim() === 'GITHUB_REGISTRY_TOKEN') {
21+
bufEnv = value.trim()
22+
}
23+
}
24+
}
25+
26+
if (bufEnv) {
27+
return `${bufEnv}`
28+
}
29+
return currentHeader
30+
},
31+
},
32+
}),
33+
}

.yarnrc.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1-
yarnPath: .yarn/releases/yarn-4.5.1.cjs
21
nodeLinker: pnp
32

3+
npmScopes:
4+
hoeeeeeh:
5+
npmRegistryServer: 'https://npm.pkg.github.com/'
6+
7+
plugins:
8+
- ./.yarn/plugin-env-npm.js
9+
10+
yarnPath: .yarn/releases/yarn-4.5.1.cjs
11+
412
packageExtensions:
513
'@typescript-eslint/utils@*':
614
peerDependencies:

backend/.env

Lines changed: 0 additions & 5 deletions
This file was deleted.

backend/.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
node_modules
22
ffmpeg
3-
nodeMediaServer/media/*
4-
3+
rtmpServer/nodeMediaServer/media/*
4+
media
55
.env
6+
7+
.dist

backend/docker-compose.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
version: "3.9"
2+
services:
3+
rtmp-server:
4+
container_name: rtmp-container
5+
build:
6+
context: rtmpServer
7+
dockerfile: dockerfile
8+
image: liboost/backend-rtmp-server
9+
env_file: .env
10+
ports:
11+
- 8000:8000
12+
- 1935:1935
13+
networks:
14+
- backend-bridge
15+
16+
networks:
17+
backend-bridge:
18+
driver: bridge
19+
name: media-server

backend/eslint.config.mjs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import js from '@eslint/js';
2+
import globals from 'globals';
3+
import tseslint from 'typescript-eslint';
4+
5+
export default tseslint.config({ ignores: ['**/.*'] }, js.configs.recommended, ...tseslint.configs.recommended, {
6+
files: ['**/*.{ts,tsx}'],
7+
languageOptions: {
8+
ecmaVersion: 2020,
9+
globals: {
10+
...globals.browser
11+
},
12+
parser: tseslint.parser
13+
},
14+
plugins: {
15+
'@typescript-eslint': tseslint.plugin
16+
},
17+
rules: {
18+
eqeqeq: ['error', 'always'],
19+
indent: ['error', 2],
20+
quotes: ['error', 'single'],
21+
semi: ['error', 'always'],
22+
'@typescript-eslint/no-unused-vars': ['error']
23+
}
24+
});

backend/nodeMediaServer/README.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

backend/nodeMediaServer/package.json

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)