-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
53 lines (47 loc) · 1.32 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
workflow:
name: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME Challenge | $GITLAB_USER_LOGIN
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
when: always
- if: $CI_PIPELINE_SOURCE == 'push'
when: never
default:
image: ubuntu:22.04
variables:
DIRECTORY: challenges
README_FILE: README.md
.standard_rules:
rules:
- if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == 'dev'
when: on_success
allow_failure: true
- when: always
Test Challenge Structure:
extends: .standard_rules
image: python:3.11.4-alpine3.18
script:
- python .gitlab/scripts/chall_structure_validator.py $DIRECTORY/$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
Check Deployability:
extends: .standard_rules
needs:
- Test Challenge Structure
script:
- bash .gitlab/scripts/deployability_checker.sh $DIRECTORY/$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
- cat deploy.env
artifacts:
reports:
dotenv: deploy.env
Test Challenge Build/Deploy:
extends: .standard_rules
image: docker:latest
services:
- docker:dind
needs:
- job: Check Deployability
artifacts: true
script:
- sh .gitlab/scripts/test_deploy.sh $DIRECTORY/$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
Check Challs in Readme File:
extends: .standard_rules
script:
- bash .gitlab/scripts/readme_file_checker.sh $DIRECTORY $README_FILE