Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
032658e0
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
032658e0
编写于
12月 20, 2017
作者:
J
Joshua Lambert
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update Auto DevOps template
上级
130b03c2
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
70 addition
and
0 deletion
+70
-0
vendor/gitlab-ci-yml/Auto-DevOps.gitlab-ci.yml
vendor/gitlab-ci-yml/Auto-DevOps.gitlab-ci.yml
+70
-0
未找到文件。
vendor/gitlab-ci-yml/Auto-DevOps.gitlab-ci.yml
浏览文件 @
032658e0
...
...
@@ -41,6 +41,7 @@ stages:
-
staging
-
canary
-
production
-
performance
-
cleanup
build
:
...
...
@@ -83,6 +84,21 @@ codequality:
artifacts
:
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
:
image
:
registry.gitlab.com/gitlab-org/gl-sast:latest
variables
:
...
...
@@ -92,6 +108,19 @@ sast:
-
sast .
artifacts
:
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
:
stage
:
review
...
...
@@ -103,10 +132,13 @@ review:
-
install_tiller
-
create_secret
-
deploy
-
persist_environment_url
environment
:
name
:
review/$CI_COMMIT_REF_NAME
url
:
http://$CI_PROJECT_PATH_SLUG-$CI_ENVIRONMENT_SLUG.$AUTO_DEVOPS_DOMAIN
on_stop
:
stop_review
artifacts
:
paths
:
[
environment_url.txt
]
only
:
refs
:
-
branches
...
...
@@ -201,9 +233,12 @@ production:
-
create_secret
-
deploy
-
delete canary
-
persist_environment_url
environment
:
name
:
production
url
:
http://$CI_PROJECT_PATH_SLUG.$AUTO_DEVOPS_DOMAIN
artifacts
:
paths
:
[
environment_url.txt
]
# when: manual
only
:
refs
:
...
...
@@ -221,6 +256,18 @@ production:
export CI_APPLICATION_TAG=$CI_COMMIT_SHA
export CI_CONTAINER_NAME=ci_job_build_${CI_JOB_ID}
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() {
cc_opts="--env CODECLIMATE_CODE="$PWD" \
...
...
@@ -415,6 +462,29 @@ production:
--docker-email="$GITLAB_USER_EMAIL" \
-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() {
track="${1-stable}"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录