This repository was archived by the owner on Mar 13, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
48 lines (43 loc) · 1.72 KB
/
.gitlab-ci.yml
File metadata and controls
48 lines (43 loc) · 1.72 KB
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
deploy:
# This is for deploying the API specs using redoc as a way to view it.
# NOTES:
# 1. You must have a file named openapi.yaml. Nothing else will be deployed
# 2. Your project will be available at https://internal.zoetrope.io/<project_name>
stage: deploy
only:
- master
image: debian:jessie
# This requires a debian type base image
before_script:
- apt-get update -y && apt-get install rsync -y
- 'which ssh-agent || ( apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- echo "$DEPLOY_SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- ssh-add -l
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
script:
- mkdir www
- |
echo "<!DOCTYPE html>\
<html>\
<head>\
<title>$CI_PROJECT_NAMESPACE $CI_PROJECT_NAME</title>\
<meta charset=\"utf-8\"/>\
<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\
<link href=\"https://fonts.googleapis.com/css?family=Montserrat:300,400,700|Roboto:300,400,700\" rel=\"stylesheet\">\
<style>\
body {\
margin: 0;\
padding: 0;\
}\
</style>\
</head>\
<body>\
<redoc spec-url='openapi.yaml'></redoc>\
<script src=\"https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js\"> </script>\
</body>\
</html>" > www/index.html
- cp openapi.yaml www/
#- scp -o StrictHostKeyChecking=no -P2223 -r -p www docsuser@staging.zoetrope.io:/home/docs/$CI_PROJECT_NAME
- rsync --delete -arvce "ssh -o StrictHostKeyChecking=no -p2223" www/ docsuser@staging.zoetrope.io:/home/docs/$CI_PROJECT_NAMESPACE-$CI_PROJECT_NAME/