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
variables:
TARGET_REPO: "G:/CIV_CI/CivWebPublish2021_CIVWeb5/CivWebPublish2021/"
GIT_STRATEGY: 'fetch'
GIT_CHECKOUT: 'false'
before_script:
- chcp 65001
- 'git config core.autocrlf false'
stages:
- install
- package
- push
install:
stage: install
tags:
- civ_base
script:
- git pull origin master
- npm run init
#cache:
# key: ${CI_COMMIT_REF_SLUG}
# paths:
# - node_modules/
only:
refs:
- master
variables:
- $NPM_INSTALL == "true"
when: manual
package:
stage: package
tags:
- civ_base
script:
- echo "${CI_PROJECT_DIR}"
- git pull origin master
#- npm run init
- npm run build --releasepath=../CivWebPublish2021
#cache:
# key: ${CI_COMMIT_REF_SLUG}
# paths:
# - node_modules/
only:
- master
when: manual
push:
variables:
GIT_STRATEGY: none
stage: push
tags:
- civ_base
script:
- 'cd "${TARGET_REPO}"'
- 'git reset --hard head'
- 'git clean -fd'
- 'git remote set-url origin "https://${GIT_ACCESS_USER}:${GIT_ACCESS_PASSWORD}@g.civnet.cn:8443/CivPublish/CivWebPublish2021.git"'
- 'git pull origin map'
- 'git rm -rf "${TARGET_REPO}/civbase"'
- 'git commit -m "chore: clear folder"'
#- 'git push origin map'
- 'robocopy "${CI_PROJECT_DIR}/../CivWebPublish2021/civbase" "${TARGET_REPO}/civbase" /S ;
IF ((${LASTEXITCODE} -le 8)) {cmd /c "exit /b 0"}'
- 'git add . ; git reset HEAD Web.config CityInterface/Web.config CityWebFW/Web.config ; git commit -m "auto package civbase."'
- 'git push origin map'
only:
- master
when: manual