forked from Nanle-code/StarForge
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
62 lines (56 loc) · 1.46 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
62 lines (56 loc) · 1.46 KB
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
54
55
56
57
58
59
60
61
62
stages:
- quality
- deploy
default:
image: rust:latest
quality:
stage: quality
before_script:
- apt-get update -y && apt-get install -y libudev-dev
- rustup component add rustfmt clippy
script:
- cargo fmt --all --check
- cargo build --locked
- cargo test --locked
- cargo clippy --all-features --locked -- -D warnings
- cargo test --test cli_smoke --locked
deploy_staging:
stage: deploy
needs: [quality]
environment: staging
resource_group: deployment-staging
when: manual
script:
- export STARFORGE_DEPLOY_ENVIRONMENT=staging
- bash scripts/ci-deploy.sh
rollback_staging:
stage: deploy
needs: [quality]
environment: staging
resource_group: deployment-staging
when: manual
script:
- export STARFORGE_DEPLOY_ENVIRONMENT=staging
- bash scripts/ci-rollback.sh
deploy_production:
stage: deploy
needs: [quality]
environment: production
resource_group: deployment-production
when: manual
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
script:
- export STARFORGE_DEPLOY_ENVIRONMENT=production STARFORGE_DEPLOY_APPROVED=true
- bash scripts/ci-deploy.sh
rollback_production:
stage: deploy
needs: [quality]
environment: production
resource_group: deployment-production
when: manual
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
script:
- export STARFORGE_DEPLOY_ENVIRONMENT=production STARFORGE_ROLLBACK_APPROVED=true
- bash scripts/ci-rollback.sh