Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
6f01e7e3
Commit
6f01e7e3
authored
Dec 20, 2017
by
Joshua Lambert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Auto DevOps template
parent
3ee5fd15
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
0 deletions
+70
-0
vendor/gitlab-ci-yml/Auto-DevOps.gitlab-ci.yml
vendor/gitlab-ci-yml/Auto-DevOps.gitlab-ci.yml
+70
-0
No files found.
vendor/gitlab-ci-yml/Auto-DevOps.gitlab-ci.yml
View file @
6f01e7e3
...
@@ -41,6 +41,7 @@ stages:
...
@@ -41,6 +41,7 @@ stages:
-
staging
-
staging
-
canary
-
canary
-
production
-
production
-
performance
-
cleanup
-
cleanup
build
:
build
:
...
@@ -83,6 +84,21 @@ codequality:
...
@@ -83,6 +84,21 @@ codequality:
artifacts
:
artifacts
:
paths
:
[
codeclimate.json
]
paths
:
[
codeclimate.json
]
performance
:
stage
:
performance
image
:
name
:
sitespeedio/sitespeed.io:6.0.3
entrypoint
:
[
"
"
]
script
:
-
performance
artifacts
:
paths
:
-
performance.json
only
:
refs
:
-
branches
kubernetes
:
active
sast
:
sast
:
image
:
registry.gitlab.com/gitlab-org/gl-sast:latest
image
:
registry.gitlab.com/gitlab-org/gl-sast:latest
variables
:
variables
:
...
@@ -93,6 +109,19 @@ sast:
...
@@ -93,6 +109,19 @@ sast:
artifacts
:
artifacts
:
paths
:
[
gl-sast-report.json
]
paths
:
[
gl-sast-report.json
]
sast:image:
image
:
docker:latest
variables
:
DOCKER_DRIVER
:
overlay2
allow_failure
:
true
services
:
-
docker:dind
script
:
-
setup_docker
-
sast_image
artifacts
:
paths
:
[
gl-sast-image-report.json
]
review
:
review
:
stage
:
review
stage
:
review
script
:
script
:
...
@@ -103,10 +132,13 @@ review:
...
@@ -103,10 +132,13 @@ review:
-
install_tiller
-
install_tiller
-
create_secret
-
create_secret
-
deploy
-
deploy
-
persist_environment_url
environment
:
environment
:
name
:
review/$CI_COMMIT_REF_NAME
name
:
review/$CI_COMMIT_REF_NAME
url
:
http://$CI_PROJECT_PATH_SLUG-$CI_ENVIRONMENT_SLUG.$AUTO_DEVOPS_DOMAIN
url
:
http://$CI_PROJECT_PATH_SLUG-$CI_ENVIRONMENT_SLUG.$AUTO_DEVOPS_DOMAIN
on_stop
:
stop_review
on_stop
:
stop_review
artifacts
:
paths
:
[
environment_url.txt
]
only
:
only
:
refs
:
refs
:
-
branches
-
branches
...
@@ -201,9 +233,12 @@ production:
...
@@ -201,9 +233,12 @@ production:
-
create_secret
-
create_secret
-
deploy
-
deploy
-
delete canary
-
delete canary
-
persist_environment_url
environment
:
environment
:
name
:
production
name
:
production
url
:
http://$CI_PROJECT_PATH_SLUG.$AUTO_DEVOPS_DOMAIN
url
:
http://$CI_PROJECT_PATH_SLUG.$AUTO_DEVOPS_DOMAIN
artifacts
:
paths
:
[
environment_url.txt
]
# when: manual
# when: manual
only
:
only
:
refs
:
refs
:
...
@@ -222,6 +257,18 @@ production:
...
@@ -222,6 +257,18 @@ production:
export CI_CONTAINER_NAME=ci_job_build_${CI_JOB_ID}
export CI_CONTAINER_NAME=ci_job_build_${CI_JOB_ID}
export TILLER_NAMESPACE=$KUBE_NAMESPACE
export TILLER_NAMESPACE=$KUBE_NAMESPACE
function sast_image() {
docker run -d --name db arminc/clair-db:latest
docker run -p 6060:6060 --link db:postgres -d --name clair arminc/clair-local-scan:v2.0.1
apk add -U wget ca-certificates
docker pull ${CI_APPLICATION_REPOSITORY}:${CI_APPLICATION_TAG}
wget https://github.com/arminc/clair-scanner/releases/download/v6/clair-scanner_linux_386
mv clair-scanner_linux_386 clair-scanner
chmod +x clair-scanner
touch clair-whitelist.yml
./clair-scanner -c http://docker:6060 --ip $(hostname -i) -r gl-sast-image-report.json -l clair.log -w clair-whitelist.yml ${CI_APPLICATION_REPOSITORY}:${CI_APPLICATION_TAG} || true
}
function codeclimate() {
function codeclimate() {
cc_opts="--env CODECLIMATE_CODE="$PWD" \
cc_opts="--env CODECLIMATE_CODE="$PWD" \
--volume "$PWD":/code \
--volume "$PWD":/code \
...
@@ -416,6 +463,29 @@ production:
...
@@ -416,6 +463,29 @@ production:
-o yaml --dry-run | kubectl replace -n "$KUBE_NAMESPACE" --force -f -
-o yaml --dry-run | kubectl replace -n "$KUBE_NAMESPACE" --force -f -
}
}
function performance() {
export CI_ENVIRONMENT_URL=$(cat environment_url.txt)
mkdir gitlab-exporter
wget -O gitlab-exporter/index.js https://gitlab.com/gitlab-org/gl-performance/raw/10-3/index.js
mkdir sitespeed-results
if [ -f .gitlab-urls.txt ]
then
sed -i -e 's@^@'"$CI_ENVIRONMENT_URL"'@' .gitlab-urls.txt
/start.sh --plugins.add gitlab-exporter --outputFolder sitespeed-results .gitlab-urls.txt
else
/start.sh --plugins.add gitlab-exporter --outputFolder sitespeed-results $CI_ENVIRONMENT_URL
fi
mv sitespeed-results/data/performance.json performance.json
}
function persist_environment_url() {
echo $CI_ENVIRONMENT_URL > environment_url.txt
}
function delete() {
function delete() {
track="${1-stable}"
track="${1-stable}"
name="$CI_ENVIRONMENT_SLUG"
name="$CI_ENVIRONMENT_SLUG"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment