Skip to content
Snippets Groups Projects
Commit e7af0485 authored by Sivan Duijn's avatar Sivan Duijn
Browse files

feat(pipeline): update gitlab ci and dockerfile

parent 60058dc4
No related branches found
No related tags found
1 merge request!13merge develop into main
Pipeline #115449 failed
node_modules
\ No newline at end of file
......@@ -2,6 +2,7 @@ image: node:16-alpine
stages:
- setup
- test
- build
install-dependencies:
stage: setup
......@@ -33,14 +34,41 @@ install-dependencies:
paths:
- node_modules/.cache/nx
build:
test:
stage: test
extends: .distributed
script:
- yarn nx affected --base=HEAD~1 --target=build --parallel --max-parallel=3
- yarn nx affected --base=HEAD~1 --target=test --parallel --max-parallel=2
test:
build:
stage: test
extends: .distributed
only:
- main
needs:
- install-dependencies
artifacts:
paths:
- node_modules/.cache/nx
- dist/apps/web-graphpolaris
script:
- yarn nx affected --base=HEAD~1 --target=test --parallel --max-parallel=2
# - yarn nx affected --base=HEAD~1 --target=build --parallel --max-parallel=3
# only build web-graphpolaris
- yarn nx build web-graphpolaris --prod
build-docker:
image: docker:stable
stage: dockerize
tags:
- docker
only:
- develop
- debug
script:
- docker build --progress plain -t $CI_PROJECT_NAME-webserver-service:latest .
# after_script:
# - docker login datastropheregistry.azurecr.io -u $REGISTRY_USERNAME -p $REGISTRY_PASSWORD
# - if [[ ! -z $CI_COMMIT_BRANCH+x ]]; then DOCKER_TAG=$CI_COMMIT_BRANCH; else DOCKER_TAG=$CI_MERGE_REQUEST_TARGET_BRANCH_NAME; fi
# - docker tag $CI_PROJECT_NAME-webserver-service datastropheregistry.azurecr.io/$CI_PROJECT_NAME-webserver-service:$DOCKER_TAG
# - docker push datastropheregistry.azurecr.io/$CI_PROJECT_NAME-webserver-service:$DOCKER_TAG
dependencies:
- build
# # Prepare nginx
# FROM nginx:1.19-alpine
# WORKDIR /app
# Prepare nginx
FROM nginx:1.19-alpine
WORKDIR /app
# # ! This copy source needs to be changed to reflect the actual app name
# COPY ./dist/apps/frontend /usr/share/nginx/html
COPY ./dist/apps/web-graphpolaris /usr/share/nginx/html
# RUN rm /etc/nginx/conf.d/default.conf
# COPY nginx/nginx.conf /etc/nginx/conf.d
RUN rm /etc/nginx/conf.d/default.conf
COPY nginx/nginx.conf /etc/nginx/conf.d
# # Fire up nginx
# EXPOSE 80
# CMD ["nginx", "-g", "daemon off;"]
# Fire up nginx
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
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