Skip to content
Snippets Groups Projects
Commit 0f5b923c authored by alexander06's avatar alexander06 Committed by fu1106jv
Browse files

Implement pipeline

parent c7500e09
No related branches found
No related tags found
No related merge requests found
# This file is a template, and might need editing before it works on your project.
# To contribute improvements to CI/CD templates, please follow the Development guide at:
# https://docs.gitlab.com/ee/development/cicd/templates.html
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Nodejs.gitlab-ci.yml
# Official framework image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/node/tags/
image: node:16.2.0
# Pick zero or more services to be used on all builds.
# Only needed when using a docker container to run your tests in.
# Check out: http://docs.gitlab.com/ee/ci/docker/using_docker_images.html#what-is-a-service
services:
- postgres:latest
variables:
DB_NAME: $POSTGRES_DB
DB_USER: $POSTGRES_USER
DB_HOST: postgres
DB_DRIVER: postgres
DB_PASSWORD: $POSTGRES_PASSWORD
TEST_DB_NAME: test
POSTGRES_DB: $POSTGRES_DB
POSTGRES_USER: $POSTGRES_USER
POSTGRES_PASSWORD: $POSTGRES_PASSWORD
POSTGRES_HOST_AUTH_METHOD: trust
# This folder is cached between builds
# https://docs.gitlab.com/ee/ci/yaml/index.html#cache
cache:
paths:
- node_modules/
- dist/server.js
before_script:
- npm install
- nohup npm run watch:server &
stages:
- build
- launch
- test
check_build:
stage: build
script:
- npm run build
#launch_build:
# stage: launch
# script:
# - nohup npm run watch:server &
test_run:
stage: test
script:
- npm test
\ No newline at end of file
This diff is collapsed.
...@@ -4,10 +4,12 @@ ...@@ -4,10 +4,12 @@
"description": "", "description": "",
"main": "dist/server.js", "main": "dist/server.js",
"scripts": { "scripts": {
"build": "webpack",
"watch:build": "webpack -w", "watch:build": "webpack -w",
"watch:server": "nodemon -r dotenv/config dist/server.js", "watch:server": "nodemon -r dotenv/config dist/server.js",
"dev": "npm-run-all --parallel watch:*", "dev": "npm-run-all --parallel watch:*",
"start": "node dist/server.js" "start": "node dist/server.js",
"test": "jest"
}, },
"author": "", "author": "",
"license": "ISC", "license": "ISC",
...@@ -39,10 +41,13 @@ ...@@ -39,10 +41,13 @@
"css-loader": "^6.5.0", "css-loader": "^6.5.0",
"eslint": "^8.1.0", "eslint": "^8.1.0",
"eslint-webpack-plugin": "^3.1.0", "eslint-webpack-plugin": "^3.1.0",
"jest": "^27.3.1",
"mocha": "^9.1.3",
"nodemon": "^2.0.14", "nodemon": "^2.0.14",
"npm-run-all": "^4.1.5", "npm-run-all": "^4.1.5",
"sass-loader": "^12.3.0", "sass-loader": "^12.3.0",
"style-loader": "^3.3.1", "style-loader": "^3.3.1",
"supertest": "^6.1.6",
"ts-loader": "^9.2.6", "ts-loader": "^9.2.6",
"webpack": "^5.60.0", "webpack": "^5.60.0",
"webpack-cli": "^4.9.1", "webpack-cli": "^4.9.1",
......
import { Dialect, Sequelize } from 'sequelize' import { Dialect, Sequelize } from 'sequelize'
const dbName = process.env.DB_NAME as string const dbName = process.env.DB_NAME
const dbUser = process.env.DB_USER as string const dbUser = process.env.DB_USER
const dbHost = process.env.DB_HOST const dbHost = process.env.DB_HOST
const dbDriver = process.env.DB_DRIVER as Dialect const dbDriver = process.env.DB_DRIVER as Dialect
const dbPassword = process.env.DB_PASSWORD const dbPassword = process.env.DB_PASSWORD
......
File moved
require('dotenv').config();
const request = require('supertest');
describe('GET /', () => {
it('responds with successful (2XX) request and html file', (done) => {
request("http://localhost:3000")
.get('/')
.set('Accept', 'text/html')
.expect('Content-Type', /html/)
.expect(200, done);
});
});
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment