forked from mtleonard120/it-inventory
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.yaml
103 lines (92 loc) · 4.12 KB
/
build.yaml
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
tag: false
maintainers: michael.leonard@cqlcorp.com
pipelines:
default:
############################################################
# NOTE
#
# Any changes you make to this might also be necessary in
# build.prod-deploy.yaml, that is until the production build
# relies on copy-artifacts
############################################################
- step:
name: Clean
checkout: true
image: containers.cqlcorp.net/build/git
script:
- rm -rf artifacts artifacts.*
- git reset --hard
- git clean -fdx -e node_modules/ -e packages/ -e vendor/
- mkdir -p artifacts
- parallel:
- step:
name: Back-end API
checkout: false
image: microsoft/dotnet:2.2.104-sdk-stretch
script:
- dotnet publish --self-contained false --configuration Release --runtime win-x64 --output $(pwd)/artifacts/backend-api src/backend-api/backend-api.csproj
- rm $(pwd)/artifacts/backend-api/*.pdb $(pwd)/artifacts/backend-api/*.config
- find $(pwd)/artifacts/backend-api/ ! -name '*.deps.json' ! -name '*.runtimeconfig.json' -name '*.json' -type f -exec rm {} +
- step:
name: Front-end Admin
checkout: false
image: node:10.13.0-jessie
script:
- cd src/frontend-admin
- cp -f deploy/build-agent-template.env .env
- npm install
- npm run build
- mv build ../../artifacts/frontend-admin
- cd ../..
- step:
name: Archive Artifacts
checkout: false
image: containers.cqlcorp.net/build/git
artifacts: artifacts/**
- step:
name: Deploy to DEV (on develop branch)
condition:
branch: develop
checkout: false
image: containers.cqlcorp.net/build/git
credentials:
- type: string
args:
credentialsId: itinventory.cqlcorp.net-sftp-host
variable: SFTPHOST
- type: usernamePassword
args:
credentialsId: itinventory.cqlcorp.net-sftp-username-password
usernameVariable: SFTPUSER
passwordVariable: SFTPPASSWORD
- type: string
args:
credentialsId: itinventory.cqlcorp.net-itinventorydb-connstring-dbo
variable: ITINVENTORYDB_DBO_CONNSTRING
- type: string
args:
credentialsId: itinventory.cqlcorp.net-itinventorydb-connstring-appuser
variable: ITINVENTORYDB_APPUSER_CONNSTRING
- type: string
args:
credentialsId: itinventory.cqlcorp.net-jwt-secret
variable: JWT_SECRET
- type: string
args:
credentialsId: itinventory.cqlcorp.net-jobs-authtoken
variable: JOBS_AUTHTOKEN
- type: string
args:
credentialsId: itinventory.cqlcorp.net-smtp-server
variable: SMTP_SERVER
configFiles:
- fileId: itinventory.cqlcorp.net-appsettings.json
targetLocation: env/DEV/itinventory.cqlcorp.net/appsettings.json
replaceTokens: true
script:
- export API_SFTPROOT=/www/itinventory.cqlcorp.net
- export API_WEBCONFIGTEMPLATE=env/DEV/itinventory.cqlcorp.net/web.config.template
- export API_APPSETTINGSJSON=env/DEV/itinventory.cqlcorp.net/appsettings.json
- export SFTPURI="sftp://$SFTPUSER:$SFTPPASSWORD@$SFTPHOST"
- cp env/DEV/app_offline.htm /tmp/app_offline.htm
- ./deploy-iis.sh