forked from splunk/security_content
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
83 lines (77 loc) · 2.79 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
variables:
GIT_SUBMODULE_STRATEGY: recursive
K8S_PLAYGROUND_ROLE: k8s:v1/app-play1/namespace/threat-research/role/deployer
K8S_GSTAGING_ROLE: k8s:v1/kube-wicket-iad10/namespace/tr-st-deploy/role/deployer
DOCKER_ROLE: docker:v1/registry/prefix/threat-research
K8_DEPLOYER_CONTAINER: docker.repo.splunkdev.net/threat-research/k8-deployer
SMOKETEST_RUNNER: docker.repo.splunkdev.net/threat-research/smoketest-runner
SRCBRANCH: $CI_COMMIT_REF_NAME
stages:
- publish_smoketest_runner
- publish_deployer
- smoketest_staging
- publish_build_to_pre_qa
publish_deployer:
stage: publish_deployer
image: docker.repo.splunkdev.net/ci-cd/ci-container:alpine-3.11
before_script:
- apk add --update docker
script:
- eval $(go-go vault -a ${DOCKER_ROLE})
- cd bin/ssa-end-to-end-testing/k8s-deployer
- docker build . -t ${K8_DEPLOYER_CONTAINER}:${CI_COMMIT_SHORT_SHA}
- docker push ${K8_DEPLOYER_CONTAINER}:${CI_COMMIT_SHORT_SHA}
only:
- /^ssa.*$/
- develop
publish_smoketest_runner:
stage: publish_smoketest_runner
image: docker.repo.splunkdev.net/ci-cd/ci-container:alpine-3.11
before_script:
- apk add --update docker
script:
- eval $(go-go vault -a ${DOCKER_ROLE})
- docker build bin/ssa-end-to-end-testing/smoke-test-runner -t ${SMOKETEST_RUNNER}:${CI_COMMIT_SHORT_SHA} --build-arg SRCBRANCH=$CI_COMMIT_REF_NAME
- docker push ${SMOKETEST_RUNNER}:${CI_COMMIT_SHORT_SHA}
only:
- /^ssa.*$/
- develop
smoketest_staging:
stage: smoketest_staging
resource_group: staging
dependencies:
- publish_smoketest_runner
- publish_deployer
image: ${K8_DEPLOYER_CONTAINER}:${CI_COMMIT_SHORT_SHA}
script:
- eval $(go-go vault -a ${K8S_GSTAGING_ROLE})
- eval $(go-go vault -a ${DOCKER_ROLE})
- cd /deployer/k8s
- ./deployer.sh
- ./check_deploy_status.sh
variables:
SCSENV: app_gstaging1
SMOKETEST_RUNNER_IMAGE: ${SMOKETEST_RUNNER}:${CI_COMMIT_SHORT_SHA}
only:
- /^ssa.*$/
- develop
publish_build_to_pre_qa:
stage: publish_build_to_pre_qa
artifacts:
when: always
paths:
- artifacts/*
image: python:3.8-alpine
before_script:
- apk add --update --no-cache make curl bash git
- curl -L https://github.com/screwdriver-cd/gitversion/releases/download/v1.1.1/gitversion_linux_amd64 -o /usr/local/bin/gitversion && chmod +x /usr/local/bin/gitversion
- eval $(ssh-agent -s)
script:
- mkdir -p artifacts
- pip install requests
- python security_content_automation/publish_build_to_pre_qa/publish_build_to_pre_qa.py --version $CI_COMMIT_REF_NAME --builds DA-ESS_AmazonWebServices_Content DA-ESS-ContentUpdate
after_script:
- cp publish_build_to_pre_qa.log artifacts/publish_build_to_pre_qa.log
rules:
- if: '$CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+\.[0-9]$/'
when: always