forked from mtleonard120/it-inventory
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.prod-deploy.yaml
101 lines (89 loc) · 3.91 KB
/
build.prod-deploy.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
tag: false
pipelines:
default:
## TODO: Use artifacts from existing build rather than duplicating dev build
# - copy-artifacts:
# sources:
# - job: github.com/cqlcorp/it-inventory
# ref: "$COPY_ARTIFACTS_FROM_REF"
############################################################
# NOTE
#
# Any changes you make to this might also be necessary in
# build.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 PRODUCTION
checkout: false
image: containers.cqlcorp.net/build/git
credentials:
- type: string
args:
credentialsId: PRODUCTION_ITINVENTORY_SFTP_HOST
variable: SFTPHOST
- type: usernamePassword
args:
credentialsId: PRODUCTION_ITINVENTORY_SFTP_USERNAME_PASSWORD
usernameVariable: SFTPUSER
passwordVariable: SFTPPASSWORD
- type: string
args:
credentialsId: PRODUCTION_ITINVENTORYDB_CONNSTRING_DBO
variable: ITINVENTORYDB_DBO_CONNSTRING
- type: string
args:
credentialsId: PRODUCTION_ITINVENTORYDB_CONNSTRING_APPUSER
variable: ITINVENTORYDB_APPUSER_CONNSTRING
- type: string
args:
credentialsId: PRODUCTION_ITINVENTORY_JWT_SECRET
variable: JWT_SECRET
- type: string
args:
credentialsId: PRODUCTION_ITINVENTORY_JOBS_AUTHTOKEN
variable: JOBS_AUTHTOKEN
- type: string
args:
credentialsId: PRODUCTION_ITINVENTORY_SMTP_SERVER
variable: SMTP_SERVER
script:
- export API_SFTPROOT=/
- export API_WEBCONFIGTEMPLATE=env/PROD/itinventory.cqlcorp.com/web.config.template
- export SFTPURI="sftp://$SFTPUSER:$SFTPPASSWORD@$SFTPHOST"
- cp env/PROD/app_offline.htm /tmp/app_offline.htm
- ./deploy-iis.sh