File tree 4 files changed +91
-0
lines changed
4 files changed +91
-0
lines changed Original file line number Diff line number Diff line change 1
1
.DS_Store
2
2
.env
3
3
.env.production
4
+ .env.staging
4
5
.vscode /
5
6
node_modules /
6
7
npm-debug.log
Original file line number Diff line number Diff line change @@ -38,6 +38,11 @@ deploy:
38
38
skip_cleanup : true
39
39
on :
40
40
branch : master
41
+ - provider : script
42
+ script : ./deploy-staging.sh
43
+ skip_cleanup : true
44
+ on :
45
+ branch : feature/public-api
41
46
42
47
env :
43
48
global :
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ set -e
4
+
5
+ docker-compose build --no-cache
6
+ docker login -u=" $DOCKER_USERNAME " -p=" $DOCKER_PASSWORD "
7
+ docker tag $APP_IMAGE_NAME $DOCKER_USERNAME /$DOCKER_STAGING_REPOSITORY :$TRAVIS_COMMIT
8
+ docker tag $APP_IMAGE_NAME $DOCKER_USERNAME /$DOCKER_STAGING_REPOSITORY :latest
9
+ docker push $DOCKER_USERNAME /$DOCKER_STAGING_REPOSITORY :$TRAVIS_COMMIT
10
+ docker push $DOCKER_USERNAME /$DOCKER_STAGING_REPOSITORY :latest
11
+
12
+ echo $GCLOUD_SERVICE_KEY_PRD | base64 --decode -i > ${HOME} /gcloud-service-key.json
13
+ gcloud auth activate-service-account --key-file ${HOME} /gcloud-service-key.json
14
+
15
+ gcloud --quiet config set project $PROJECT_NAME_PRD
16
+ gcloud --quiet config set container/cluster $CLUSTER_NAME_PRD
17
+ gcloud --quiet config set compute/zone ${CLOUDSDK_COMPUTE_ZONE}
18
+ gcloud --quiet container clusters get-credentials $CLUSTER_NAME_PRD
19
+
20
+ kubectl config view
21
+ kubectl config current-context
22
+
23
+ kubectl set image deployment/${KUBE_DEPLOYMENT_NAME} ${KUBE_DEPLOYMENT_CONTAINER_NAME} =index.docker.io/$DOCKER_USERNAME /$DOCKER_STAGING_REPOSITORY :$TRAVIS_COMMIT --namespace=staging
Original file line number Diff line number Diff line change @@ -118,3 +118,65 @@ spec:
118
118
# - secretRef:
119
119
# name: web-editor-credentials
120
120
# restartPolicy: Never
121
+ ---
122
+ apiVersion : v1
123
+ kind : Namespace
124
+ metadata :
125
+ name : staging
126
+ labels :
127
+ name : staging
128
+ ---
129
+ apiVersion : v1
130
+ kind : Service
131
+ metadata :
132
+ name : web-editor-node
133
+ namespace : staging
134
+ labels :
135
+ app : web-editor
136
+ spec :
137
+ # if your cluster supports it, uncomment the following to automatically create
138
+ # an external load-balanced IP for the frontend service.
139
+ type : LoadBalancer
140
+ # type: NodePort
141
+ ports :
142
+ - port : 8001
143
+ targetPort : 8000
144
+ selector :
145
+ app : web-editor
146
+ ---
147
+ apiVersion : apps/v1
148
+ kind : Deployment
149
+ metadata :
150
+ name : web-editor-node
151
+ namespace : staging
152
+ spec :
153
+ selector :
154
+ matchLabels :
155
+ app : web-editor
156
+ replicas : 1
157
+ template :
158
+ metadata :
159
+ labels :
160
+ app : web-editor
161
+ spec :
162
+ containers :
163
+ - name : web-editor-app
164
+ image : index.docker.io/catarak/p5.js-web-editor:latest
165
+ # temp, just to test kubernetes
166
+ # envFrom:
167
+ # - configMapRef:
168
+ # name: web-editor-env
169
+ envFrom :
170
+ - secretRef :
171
+ name : web-editor-credentials
172
+ imagePullPolicy : Always
173
+ resources :
174
+ requests :
175
+ cpu : 100m
176
+ memory : 100Mi
177
+ ports :
178
+ - containerPort : 8000
179
+ readinessProbe :
180
+ httpGet :
181
+ path : /health
182
+ port : 8000
You can’t perform that action at this time.
0 commit comments