Skip to content
Snippets Groups Projects
Commit 14e9289a authored by Farrel Farandieka Fibriyanto's avatar Farrel Farandieka Fibriyanto
Browse files

Merge branch 'development' into 'main'

Development

See merge request !3
parents b8ee9c64 1c9c3cfb
1 merge request!3Development
Pipeline #53406 passed with stages
in 4 minutes and 35 seconds
......@@ -15,7 +15,6 @@
# 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/Getting-Started.gitlab-ci.yml
image: "node:19-alpine"
stages: # List of stages for jobs, and their order of execution
- local build
......@@ -25,17 +24,19 @@ stages: # List of stages for jobs, and their order of execution
build-locally:
stage: local build
image: "node:19-alpine"
script:
- npm i
- set -e
- npm run dev > >(tee -a output.log) 2>&1 &
- sleep 10
- sleep 5
- kill -INT $! || true
- echo "Stopping the program if necessary"
- if grep -q "error" output.log; then exit 1; fi
lint-test-job: # This job also runs in the test stage.
stage: test # It can run at the same time as unit-test-job (in parallel).
image: "node:19-alpine"
script:
- npm i
- npm i prettier
......@@ -44,6 +45,7 @@ lint-test-job: # This job also runs in the test stage.
unit-test-job: # This job runs in the test stage.
stage: test # It only starts when the job in the build stage completes successfully.
image: "node:19-alpine"
script:
- npm i
- npm i mocha
......@@ -76,12 +78,11 @@ unit-test-job: # This job runs in the test stage.
deploy-dev-job:
stage: deploy
image: "docker:20.10.16"
script:
- docker stop playground-dev || true
- docker rm playground-dev || true
- docker build -f Dockerfile.cicd -t playground-dev-img .
- cp $DOT_ENV_DEV .env
- docker build --no-cache -f Dockerfile.cicd -t playground-dev-img .
- docker run -d -p 3001:3001 --name playground-dev playground-dev-img
# when: manual
only:
- development
......@@ -8,7 +8,10 @@ WORKDIR /usr/src/app
COPY package.json .
RUN npm i
# Copies remanding files
copy . .
# Exports
EXPOSE 3001
CMD [ "npm", "run", "dev" ]
\ No newline at end of file
CMD [ "npm", "run", "dev" ]
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment