forked from screwdriver-cd/store
-
Notifications
You must be signed in to change notification settings - Fork 0
/
screwdriver.yaml
72 lines (68 loc) · 2.57 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
shared:
image: node:8
jobs:
main:
environment:
SD_SONAR_OPTS: "-Dsonar.sources=lib, plugins -Dsonar.javascript.lcov.reportPath=coverage/lcov.info"
requires: [~pr, ~commit]
steps:
- install: npm install
- test: npm test
# Publish the package to GitHub and build Docker image
publish:
requires: [main]
template: screwdriver-cd/semantic-release
steps:
- postpublish: |
git clone https://github.com/screwdriver-cd/toolbox.git ci
git fetch
export DOCKER_TAG=`git describe --tags`
./ci/docker-trigger.sh
environment:
# Docker hub repo
DOCKER_REPO: screwdrivercd/store
secrets:
# Publishing to NPM
- NPM_TOKEN
# Pushing tags to Git
- GH_TOKEN
# Trigger a Docker Hub build
- DOCKER_TRIGGER
# Deploy to beta environment and run tests
beta:
requires: [publish]
steps:
- setup-ci: git clone https://github.com/screwdriver-cd/toolbox.git ci
- get-tag: ./ci/git-latest.sh
- wait-docker: DOCKER_TAG=`cat VERSION` ./ci/docker-wait.sh
- deploy-k8s: K8S_TAG=`cat VERSION` ./ci/k8s-deploy.sh
- test: sleep 10 && curl --silent --fail -o /dev/null https://beta.store.screwdriver.cd/v1/status
environment:
DOCKER_REPO: screwdrivercd/store
K8S_CONTAINER: screwdriver-store
K8S_IMAGE: screwdrivercd/store
K8S_HOST: api.k8s.screwdriver.cd
K8S_DEPLOYMENT: sdstore-beta
SD_STORE: beta.store.screwdriver.cd
secrets:
# Talking to Kubernetes
- K8S_TOKEN
# Deploy to prod environment and run tests
prod:
requires: [beta]
steps:
- setup-ci: git clone https://github.com/screwdriver-cd/toolbox.git ci
- get-tag: ./ci/git-latest.sh
- wait-docker: DOCKER_TAG=`cat VERSION` ./ci/docker-wait.sh
- deploy-k8s: K8S_TAG=`cat VERSION` ./ci/k8s-deploy.sh
- test: sleep 10 && curl --silent --fail -o /dev/null https://store.screwdriver.cd/v1/status
environment:
DOCKER_REPO: screwdrivercd/store
K8S_CONTAINER: screwdriver-store
K8S_IMAGE: screwdrivercd/store
K8S_HOST: api.k8s.screwdriver.cd
K8S_DEPLOYMENT: sdstore
SD_STORE: store.screwdriver.cd
secrets:
# Talking to Kubernetes
- K8S_TOKEN