forked from citysciencelab/cut-dana-platform-mp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbitbucket-pipelines.yml
135 lines (133 loc) · 7.03 KB
/
bitbucket-pipelines.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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
image: node:20.12.2
clone:
depth: 5000 # include the last five hundred commits
pipelines:
# Start pipeline with tag to build examples zips and copy them to the Bitbucket download folder
tags:
'v3.*.*':
- step:
name: build examples zip
caches:
- node
artifacts:
- dist/**
script:
- export NODE_OPTIONS=--openssl-legacy-provider
- npm install
- npm run buildExamples
- apt-get update
- step:
name: deploy examples zip
caches:
- node
script:
- apt-get install -y curl
# find all zip folders in dist folder, loop through the results and post the zips to the BB download folder
- for zipFilePath in $(find dist -name \*.zip); do
curl -X POST --user "$bbapi_name:$bbapi_key" "https://api.bitbucket.org/2.0/repositories/geowerkstatt-hamburg/masterportal/downloads" --form files=@"$zipFilePath" --verbose;
done
- step:
name: create mkdocs
image: python:3.8
caches:
- pip
script:
- apt-get update && apt-get install zip && apt-get install -y curl wput jq && apt-get install zip
- pip install -r devtools/docsValidation/python-dependencies.txt
- mike deploy $BITBUCKET_TAG
- mv $BITBUCKET_CLONE_DIR/site $BITBUCKET_CLONE_DIR/$BITBUCKET_TAG
- pipe: atlassian/ftp-deploy:0.7.0
variables:
USER: $MKDOCS_FTP_NAME
PASSWORD: $MKDOCS_FTP_PW
SERVER: $MKDOCS_FTP_SERVER
REMOTE_PATH: '/doc/'
LOCAL_PATH: $BITBUCKET_CLONE_DIR/$BITBUCKET_TAG
DEBUG: 'true'
# TODO: enable, if version 3 shall be Latest
# - mv $BITBUCKET_CLONE_DIR/$BITBUCKET_TAG $BITBUCKET_CLONE_DIR/Latest
# - pipe: atlassian/ftp-deploy:0.7.0
# variables:
# USER: $MKDOCS_FTP_NAME
# PASSWORD: $MKDOCS_FTP_PW
# SERVER: $MKDOCS_FTP_SERVER
# REMOTE_PATH: '/doc/'
# LOCAL_PATH: '$BITBUCKET_CLONE_DIR/Latest'
# DEBUG: 'true'
- step:
name: deploy on openCode
script:
- echo 'deply to opencode:'$BITBUCKET_TAG
- git fetch --all --tags
- git checkout tags/$BITBUCKET_TAG
- git push https://$OpenCode_User:[email protected]/geowerkstatt-hamburg/masterportal.git $BITBUCKET_TAG
- git clone --single-branch --branch dev_vue https://[email protected]/geowerkstatt-hamburg/masterportal.git
- cd masterportal
- git push https://$OpenCode_User:[email protected]/geowerkstatt-hamburg/masterportal.git -f
custom: # Pipelines that are triggered manually
npm audit:
- step:
name: npm audit (security)
caches:
- node
script:
- npm install
- npm audit --json
deploy last tag on openCode:
- variables:
- name: BITBUCKET_TAG
description: tag to publish docs for, e.g. v3.1.0
- step:
name: deploy last tag on openCode
script:
- apt-get update && apt-get install -y curl wput jq
- git fetch --all --tags
- echo 'deply to opencode:'$BITBUCKET_TAG
- git checkout tags/$BITBUCKET_TAG
- git push https://$OpenCode_User:[email protected]/geowerkstatt-hamburg/masterportal.git $BITBUCKET_TAG
- git clone --single-branch --branch dev_vue https://[email protected]/geowerkstatt-hamburg/masterportal.git
- cd masterportal
- git push https://$OpenCode_User:[email protected]/geowerkstatt-hamburg/masterportal.git -f
mkdocs to masterportal.org:
- variables:
- name: BITBUCKET_TAG
description: tag to publish docs for, e.g. v3.1.0
- step:
name: create mkdocs
image: python:3.8
caches:
- pip
script:
- apt-get update && apt-get install zip && apt-get install -y curl wput jq && apt-get install zip
- pip install -r devtools/docsValidation/python-dependencies.txt
- mike deploy $BITBUCKET_TAG
- mv $BITBUCKET_CLONE_DIR/site $BITBUCKET_CLONE_DIR/$BITBUCKET_TAG
- pipe: atlassian/ftp-deploy:0.7.0
variables:
USER: $MKDOCS_FTP_NAME
PASSWORD: $MKDOCS_FTP_PW
SERVER: $MKDOCS_FTP_SERVER
REMOTE_PATH: '/doc/'
LOCAL_PATH: $BITBUCKET_CLONE_DIR/$BITBUCKET_TAG
DEBUG: 'true'
# TODO: enable, if version 3 shall be Latest
# - mv $BITBUCKET_CLONE_DIR/$BITBUCKET_TAG $BITBUCKET_CLONE_DIR/Latest
# - pipe: atlassian/ftp-deploy:0.7.0
# variables:
# USER: $MKDOCS_FTP_NAME
# PASSWORD: $MKDOCS_FTP_PW
# SERVER: $MKDOCS_FTP_SERVER
# REMOTE_PATH: '/doc/'
# LOCAL_PATH: '$BITBUCKET_CLONE_DIR/Latest'
# DEBUG: 'true'
validate mkdocs:
- step:
name: validate mkdocs
image: python:3.8
caches:
- pip
script:
- python -m venv .venv
- source .venv/bin/activate
- pip install -r devtools/docsValidation/python-dependencies.txt
- devtools/docsValidation/docsValidation.sh