Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cloud-monitor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Edouard DE BRYE
cloud-monitor
Commits
a0aa0711
Commit
a0aa0711
authored
4 years ago
by
Timothée AUFORT
Browse files
Options
Downloads
Patches
Plain Diff
feat(ci): update .gitlab-ci.yml file
parent
79405641
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+10
-50
10 additions, 50 deletions
.gitlab-ci.yml
with
10 additions
and
50 deletions
.gitlab-ci.yml
+
10
−
50
View file @
a0aa0711
image
:
name
:
hashicorp/terraform:0.14.
8
name
:
hashicorp/terraform:0.14.
9
entrypoint
:
-
'
/usr/bin/env'
-
'
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
...
...
@@ -9,26 +9,17 @@ stages:
-
Staging Plan
-
Staging Apply
-
Integration Test
-
Production Plan
-
Production Apply
-
Destroy
Test and Lint
:
stage
:
Test and Lint
script
:
-
echo "test to do"
rules
:
-
if
:
'
$CI_MERGE_REQUEST_TARGET_BRANCH_NAME
=~
/^(master|production)$/
||
$CI_COMMIT_BRANCH
=~
/^(master|production)$/'
Validate Terraform
:
stage
:
Test and Lint
script
:
-
cd deploy/
-
terraform fmt -check -recursive
-
terraform init -backend=false
-
terraform validate
-
terraform fmt -check
rules
:
-
if
:
'
$CI_MERGE_REQUEST_TARGET_BRANCH_NAME
=~
/^(master
|production
)$/
||
$CI_COMMIT_BRANCH
=~
/^(master
|production
)$/'
-
if
:
'
$CI_MERGE_REQUEST_TARGET_BRANCH_NAME
=~
/^(master)$/
||
$CI_COMMIT_BRANCH
=~
/^(master)$/'
Staging Plan
:
stage
:
Staging Plan
...
...
@@ -38,7 +29,7 @@ Staging Plan:
-
terraform workspace select staging || terraform workspace new staging
-
terraform plan
rules
:
-
if
:
'
$CI_COMMIT_BRANCH
=~
/^(master
|production
)$/'
-
if
:
'
$CI_MERGE_REQUEST_TARGET_BRANCH_NAME
=~
/^(master)$/
||
$CI_COMMIT_BRANCH
=~
/^(master)$/'
Staging Apply
:
stage
:
Staging Apply
...
...
@@ -56,22 +47,22 @@ Staging Apply:
reports
:
dotenv
:
deploy.env
rules
:
-
if
:
'
$CI_COMMIT_BRANCH
=~
/^(master
|production
)$/'
-
if
:
'
$CI_COMMIT_BRANCH
=~
/^(master)$/'
Integration Tests
:
stage
:
Integration Test
image
:
name
:
postman/newman
name
:
postman/newman
:5
entrypoint
:
[
"
"
]
script
:
-
newman run Lambda_CRUD.postman_collection.json --env-var "endpoint=$API_ENDPOINT"
rules
:
-
if
:
'
$CI_COMMIT_BRANCH
=~
/^(master
|production
)$/'
-
if
:
'
$CI_COMMIT_BRANCH
=~
/^(master)$/'
Load Tests
:
stage
:
Integration Test
image
:
name
:
peterevans/vegeta
name
:
peterevans/vegeta
:6.9
entrypoint
:
[
"
"
]
script
:
-
echo "GET $API_ENDPOINT/crud" | vegeta attack -duration=3s -rate=100/s | vegeta report
...
...
@@ -79,29 +70,9 @@ Load Tests:
-
echo "PATCH $API_ENDPOINT/crud" | vegeta attack -duration=3s -rate=100/s | vegeta report
-
echo "DELETE $API_ENDPOINT/crud" | vegeta attack -duration=3s -rate=100/s | vegeta report
rules
:
-
if
:
'
$CI_COMMIT_BRANCH
=~
/^(master
|production
)$/'
-
if
:
'
$CI_COMMIT_BRANCH
=~
/^(master)$/'
when
:
manual
Production Plan
:
stage
:
Production Plan
script
:
-
cd deploy/
-
terraform init
-
terraform workspace select production || terraform workspace new production
-
terraform plan
rules
:
-
if
:
'
$CI_COMMIT_BRANCH
==
"production"'
Production Apply
:
stage
:
Production Apply
script
:
-
cd deploy/
-
terraform init
-
terraform workspace select production
-
terraform apply -auto-approve
rules
:
-
if
:
'
$CI_COMMIT_BRANCH
==
"production"'
Staging Destroy
:
stage
:
Destroy
script
:
...
...
@@ -110,16 +81,5 @@ Staging Destroy:
-
terraform workspace select staging
-
terraform destroy -auto-approve
rules
:
-
if
:
'
$CI_COMMIT_BRANCH
=~
/^(master|production)$/'
when
:
manual
Production Destroy
:
stage
:
Destroy
script
:
-
cd deploy/
-
terraform init
-
terraform workspace select production
-
terraform destroy -auto-approve
rules
:
-
if
:
'
$CI_COMMIT_BRANCH
==
"production"'
-
if
:
'
$CI_COMMIT_BRANCH
=~
/^(master)$/'
when
:
manual
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment