This repository has been archived by the owner on May 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
115 lines (108 loc) · 2.51 KB
/
.drone.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
---
kind: pipeline
name: default
steps:
- name: build
image: docker
when:
branch:
exclude:
- skip-ci*
event:
exclude:
- pull_request
- tag
environment:
DOCKER_PASSWORD:
from_secret: DOCKER_PASSWORD
commands:
- export DOCKER_HOST=unix:///var/run/host.sock
- docker login -u 'robot$drone' -p $DOCKER_PASSWORD harbor.dsrd.libraries.psu.edu
- docker build -t harbor.dsrd.libraries.psu.edu/library/ss-json:$DRONE_BUILD_NUMBER .
- docker tag harbor.dsrd.libraries.psu.edu/library/ss-json:$DRONE_BUILD_NUMBER harbor.dsrd.libraries.psu.edu/library/ss-json:ci
- docker push harbor.dsrd.libraries.psu.edu/library/ss-json:$DRONE_BUILD_NUMBER
volumes:
- name: docker-sock
path: /var/run/host.sock
- name: rspec
image: harbor.dsrd.libraries.psu.edu/library/ss-json:ci
user: root
environment:
RAILS_ENV: test
POSTGRES_USER: ssjson
POSTGRES_DB: ssjson
POSTGRES_HOST: postgres
POSTGRES_PASSWORD: ssjson
commands:
- rails db:create
- rails db:migrate
- rspec
- name: update ArgoCD (prod)
image: alpine/git
environment:
CONFIG_ENV: prod
when:
branch:
include:
- master
event:
exclude:
- pull_request
- tag
commands:
- git clone https://github.com/psu-stewardship/ss-json-config.git
- cd ss-json-config
- ./generate_application.sh
- name: update ArgoCD (qa)
image: alpine/git
environment:
CONFIG_ENV: qa
when:
event:
include:
- tag
commands:
- git clone https://github.com/psu-stewardship/ss-json-config.git
- cd ss-json-config
- ./generate_application.sh
- name: update ArgoCD (dev)
image: harbor.dsrd.libraries.psu.edu/public/drone-utils:latest
environment:
CONFIG_ENV: dev
ARGOCD_SERVER: argocd.dsrd.libraries.psu.edu
SLACK_WEBHOOK_URL:
from_secret: SLACK_WEBHOOK_URL
ARGOCD_AUTH_TOKEN:
from_secret: ARGOCD_AUTH_TOKEN
when:
branch:
include:
- preview/*
- develop
event:
exclude:
- pull_request
- tag
commands:
- git clone https://github.com/psu-stewardship/ss-json-config.git
- cd ss-json-config
- ./generate_application.sh
services:
- name: postgres
image: postgres:10
when:
branch:
exclude:
- skip-ci*
event:
exclude:
- pull_request
- tag
environment:
POSTGRES_PASSWORD: ssjson
POSTGRES_USER: ssjson
POSTGRES_DB: ssjson
volumes:
- name: docker-sock
host:
path: /var/run/docker.sock