Skip to content
Snippets Groups Projects
Commit d151f3fd authored by kon0379's avatar kon0379
Browse files

Merge branch 'develop' into 'main'

refactor: CI/CD process

See merge request !13
parents 0eb14994 9b9886ea
Branches
1 merge request!13refactor: CI/CD process
Pipeline #834 passed with stages
in 2 minutes and 42 seconds
......@@ -5,27 +5,22 @@ stages:
- test
- deploy
modify-user-file-development:
stage: build
script:
- echo $CI_DEV_USERS_SEED > WebAPI/default-users.json
only:
- develop
environment:
name: development
variables:
DOCKER_COMPOSE_CMD: "sudo docker-compose"
before_script:
- echo "kon0379 gitlab CI/CD process started"
build-development:
needs: [modify-user-file-development]
stage: build
only:
- develop
script:
- sudo docker-compose -f docker-compose.development.yaml build --no-cache
- $DOCKER_COMPOSE_CMD -f docker-compose.development.yaml build --no-cache
environment:
name: development
unit-tests-development:
needs: [build-development]
stage: test
only:
- develop
......@@ -40,43 +35,37 @@ unit-tests-development:
- ./**/*test-result.xml
environment:
name: development
needs:
- build-development
deploy-development:
needs: [build-development, unit-tests-development]
stage: deploy
only:
- develop
script:
- sudo docker-compose -f docker-compose.development.yaml up -d
- echo $CI_DEV_USERS_SEED > WebAPI/default-users.json
- $DOCKER_COMPOSE_CMD -f docker-compose.development.yaml build --no-cache
- $DOCKER_COMPOSE_CMD -f docker-compose.development.yaml up -d
environment:
name: development
modify-user-file-production:
stage: build
script:
- echo $CI_PROD_USERS_SEED > WebAPI/default-users.json
only:
- main
environment:
name: production
needs:
- unit-tests-development
build-production:
needs: [modify-user-file-production]
stage: build
only:
- main
script:
- sudo docker-compose -f docker-compose.production.yaml build --no-cache
- $DOCKER_COMPOSE_CMD -f docker-compose.production.yaml build --no-cache
environment:
name: production
unit-tests-production:
needs: [build-production ]
stage: test
only:
- main
script:
- 'sudo dotnet test --test-adapter-path:. --logger:"junit;LogFilePath=..\artifacts\{assembly}-test-result.xml;MethodFormat=Class;FailureBodyFormat=Verbose"'
- 'sudo dotnet test --test-adapter-path:. --logger:"junit;LogFilePath=..\artifacts\{assembly}-test-result.xml;MethodFormat=Class;FailureBodyFormat=Verbose"'
artifacts:
when: always
paths:
......@@ -86,13 +75,18 @@ unit-tests-production:
- ./**/*test-result.xml
environment:
name: production
needs:
- build-production
deploy-production:
needs: [build-production, unit-tests-production]
stage: deploy
only:
- main
script:
- sudo docker-compose -f docker-compose.production.yaml up -d
- echo $CI_PROD_USERS_SEED > WebAPI/default-users.json
- $DOCKER_COMPOSE_CMD -f docker-compose.production.yaml build --no-cache
- $DOCKER_COMPOSE_CMD -f docker-compose.production.yaml up -d
environment:
name: production
\ No newline at end of file
name: production
needs:
- unit-tests-production
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