-
Notifications
You must be signed in to change notification settings - Fork 5
/
screwdriver.yaml
97 lines (94 loc) · 3.65 KB
/
screwdriver.yaml
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
shared:
environment:
DOCKER_REPO: screwdrivercd/queue-service
DOCKER_MULTI_PLATFORM_BUILDS_ENABLED: 1
jobs:
main:
image: node:18
annotations:
screwdriver.cd/ram: TURBO
screwdriver.cd/cpu: TURBO
requires:
- ~pr
- ~commit
- ~sd@73:publish #artifact-bookend https://cd.screwdriver.cd/pipelines/73
steps:
- setup-ci: git clone https://github.com/screwdriver-cd/toolbox.git ci
- install: npm install
- duplicate: NPM_FILTER=screwdriver- ./ci/npm-dups.sh
- test: npm test
- coverage: ./ci/coverage.sh
- cp-coverage-to-artifacts: cp -r artifacts/coverage $SD_ARTIFACTS_DIR
environment:
SD_SONAR_OPTS: "-Dsonar.sources=lib,plugins -Dsonar.tests=test -Dsonar.javascript.lcov.reportPaths=artifacts/coverage/lcov.info -Dsonar.testExecutionReportPaths=artifacts/report/test.xml"
NODE_OPTIONS: "--max_old_space_size=8192"
secrets:
# Uploading coverage information to coveralls
- COVERALLS_REPO_TOKEN
publish:
image: node:18
requires: [main]
steps:
- setup-ci: git clone https://github.com/screwdriver-cd/toolbox.git ci
- install-ci: npm install npm-auto-version
- publish-npm-and-git-tag: ./ci/publish.sh
secrets:
# Publishing to NPM
- NPM_TOKEN
# Pushing tags to Git
- GIT_KEY
docker-publish:
requires: publish
template: sd/dind@latest
# Deploy to our beta environment and run tests
beta:
image: node:18
requires: [docker-publish]
steps:
- setup-ci: git clone https://github.com/screwdriver-cd/toolbox.git ci
- wait-docker: DOCKER_TAG=`meta get docker_tag` ./ci/docker-wait.sh
- deploy-k8s: K8S_TAG=`meta get docker_tag` ./ci/k8s-deploy.sh
- test: npm install && npm run functional
environment:
K8S_CONTAINER: screwdriver-queue-service
K8S_IMAGE: screwdrivercd/queue-service
K8S_HOST: kubernetes.default.svc
K8S_DEPLOYMENT: sdqueuesvc-beta
K8S_ENV_KEY: DATASTORE_DYNAMODB_PREFIX
K8S_ENV_VALUE: beta_rc2_
TEST_USERNAME: sd-buildbot
TEST_ORG: screwdriver-cd-test
secrets:
# Access key for functional tests
- SD_API_TOKEN
# Git access token
- GIT_TOKEN
# Talking to Kubernetes
- K8S_TOKEN
# Deploy to our prod environment and run tests
prod:
image: node:18
requires: [beta]
steps:
- setup-ci: git clone https://github.com/screwdriver-cd/toolbox.git ci
- wait-docker: DOCKER_TAG=`meta get docker_tag` ./ci/docker-wait.sh
- deploy-k8s: K8S_TAG=`meta get docker_tag` ./ci/k8s-deploy.sh
- test: |
npm install
GIT_TOKEN=${GIT_TOKEN_PROD} SD_API_TOKEN=${SD_API_TOKEN_PROD} npm run functional
environment:
K8S_CONTAINER: screwdriver-queue-service
K8S_IMAGE: screwdrivercd/queue-service
K8S_HOST: kubernetes.default.svc
K8S_DEPLOYMENT: sdqueuesvc
K8S_ENV_KEY: DATASTORE_DYNAMODB_PREFIX
K8S_ENV_VALUE: rc2_
TEST_USERNAME: sd-buildbot-functional
TEST_ORG: screwdriver-cd-test
secrets:
# Access key for functional tests
- SD_API_TOKEN_PROD
# Git access token
- GIT_TOKEN_PROD
# Talking to Kubernetes
- K8S_TOKEN