Skip to content

Commit 41a7b9b

Browse files
chore: move deployment to google cloud run
1 parent 95a6f29 commit 41a7b9b

26 files changed

+514
-1287
lines changed

.circleci/config.yml

Lines changed: 2 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,14 @@
11
version: 2.1
22

3-
orbs:
4-
kubernetes: circleci/[email protected]
5-
6-
refs:
7-
- &only_master
8-
filters:
9-
branches:
10-
only: master
11-
12-
- &not_master
13-
filters:
14-
branches:
15-
ignore: master
16-
173
workflows:
184
test:
195
jobs:
20-
- unit-tests:
21-
<<: *not_master
22-
23-
- staging-approval:
24-
<<: *not_master
25-
type: approval
26-
27-
- deploy-staging:
28-
<<: *not_master
29-
requires:
30-
- staging-approval
31-
32-
release:
33-
jobs:
34-
- deploy-staging:
35-
<<: *only_master
36-
37-
- production-approval:
38-
type: approval
39-
requires:
40-
- deploy-staging
41-
42-
- deploy-production:
43-
<<: *only_master
44-
requires:
45-
- production-approval
6+
- unit-tests
467

478
jobs:
489
unit-tests:
4910
docker:
50-
- image: circleci/node:12.18.2
51-
steps:
52-
- setup
53-
54-
deploy-staging:
55-
docker:
56-
- image: circleci/node:12.18.2
57-
steps:
58-
- setup
59-
- push
60-
- deploy:
61-
environment: staging
62-
- run: node test staging
63-
64-
deploy-production:
65-
docker:
66-
- image: circleci/node:12.18.2
67-
steps:
68-
- setup
69-
- run: node test staging
70-
- deploy:
71-
environment: production
72-
- run: node test production
73-
74-
commands:
75-
setup:
76-
description: 'Checkout and install dependencies'
11+
- image: circleci/node:14.18.3
7712
steps:
7813
- checkout
7914
- run:
@@ -85,47 +20,3 @@ commands:
8520
- run:
8621
name: Build
8722
command: yarn build
88-
89-
npm_auth:
90-
description: 'Authenticate with the npm registry'
91-
steps:
92-
- run:
93-
name: Authenticate with registry
94-
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
95-
96-
push:
97-
steps:
98-
- setup_remote_docker
99-
- run:
100-
name: Build Docker
101-
command: docker build -t $DOCKERHUB_USERNAME/esdiscuss:$CIRCLE_SHA1 .
102-
- run:
103-
name: Authenticate
104-
command: echo "$DOCKERHUB_PASS" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin
105-
- run:
106-
name: Push Docker
107-
command: docker push $DOCKERHUB_USERNAME/esdiscuss:$CIRCLE_SHA1
108-
109-
deploy:
110-
parameters:
111-
environment:
112-
type: enum
113-
enum: ['staging', 'production']
114-
steps:
115-
- kubernetes/install
116-
- run:
117-
name: Copy certificate
118-
command: echo "$KUBERNETES_CLUSTER_CERTIFICATE" | base64 --decode > cert.crt
119-
- run:
120-
name: Deploy to Kubernetes
121-
command: |
122-
ENVIRONMENT=<< parameters.environment >> npx jskube apply \
123-
--kubeconfig=/dev/null \
124-
-f .kube/deployment.ts
125-
- run:
126-
name: Wait for rollout to complete
127-
command: |
128-
npx jskube rollout status \
129-
deployment/esdiscuss-<< parameters.environment >> \
130-
--namespace esdiscuss \
131-
--kubeconfig=/dev/null

.dockerignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
*
2+
!package.json
3+
!yarn.lock
4+
!build
5+
!lib
6+
!static
7+
!favicon.ico
8+
!profiles.json
9+
10+
lib/*.d.ts
11+
lib/*.js.map

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ environment.toml
2121

2222
lib/
2323

24-
.env
24+
.env
25+
/build/

.kube/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.kube/createConfigMap.ts

Lines changed: 0 additions & 20 deletions
This file was deleted.

.kube/createDeployment.ts

Lines changed: 0 additions & 102 deletions
This file was deleted.

.kube/createIngress.ts

Lines changed: 0 additions & 72 deletions
This file was deleted.

.kube/createSecrets.ts

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)