aboutsummaryrefslogtreecommitdiff
path: root/ci/plugins.taskfile.yaml
blob: de62e00dfcb8d07a808094a13489367628372daa (plain)
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
136
137
138
139
140
141
142
143
144
145
146
147
148
# https://taskfile.dev

#Called by the vnbuild system to produce builds for my website
#https://www.vaughnnugent.com/resources/software

version: "3"

vars:

tasks:

  all:
    cmds:
    - echo "Installing and configuring plugins and UI"
    - task: install-accounts
    - task: install-sessions
    - task: install-vncache
    - task: install-vncache-sessions
    - task: install-router
    - task: install-users
    - task: install-argon2-lib
    - task: build-cmnext

  build-cmnext:
    cmds:
    #build js libraries
    - cd ../lib/admin && npm install && npm run build
    - cd ../front-end && npm install && npm run build
    #move dist files to web root
    - powershell -Command "cp -Recurse -Force ../front-end/dist {{.USER_WORKING_DIR}}"
    #move the plugin output
    - powershell -Command "cp -Recurse -Force ../back-end/src/bin/release/net6.0/publish/* ./plugins/CMNext"
    #move cmnext config file
    - powershell -Command "cp -Force config/CMNext.json ./plugins/CMNext/CMNext.json"

  install-accounts:
    cmds:
    #install accounts plugin
    - task: install-plugin
      vars:
        NAME: 'Essentials.Accounts'
        PROJECT_NAME: 'VNLib.Plugins.Essentials.Accounts'
        MODULE_NAME: "Plugins.Essentials"
        FILE_NAME: "release.tgz"
        DIR: './plugins/Essentials.Accounts'

  install-router:
    cmds:
    #install router plugin
    - task: install-plugin
      vars:
        NAME: 'PageRouter'
        PROJECT_NAME: 'VNLib.Plugins.Essentials.Content.Routing'
        MODULE_NAME: "Plugins.Essentials"
        FILE_NAME: "release.tgz"
        DIR: './plugins/PageRouter'

  install-sessions:
    cmds:
    #install sessions plugin
    - task: install-plugin
      vars:
        NAME: 'SessionProvider'
        PROJECT_NAME: 'SessionProvider'
        MODULE_NAME: "VNLib.Plugins.Sessions"
        FILE_NAME: "release.tgz"
        DIR: './plugins/SessionProvider'

  install-users:
    cmds:
    #install users plugin
    - task: install-plugin
      vars:
        NAME: 'VNLib.Plugins.Essentials.Users'
        PROJECT_NAME: 'VNLib.Plugins.Essentials.Users'
        MODULE_NAME: "VNLib.Plugins.Essentials.Users"
        FILE_NAME: "release.tgz"
        DIR: './plugins/assets/VNLib.Plugins.Essentials.Users'

    #move routes xml files
    - cmd: powershell -Command "cp -Force config/routes.xml ./plugins/routes.xml"

  install-vncache:
    cmds:
    #install vncache global cache provider plugin
    - task: install-plugin
      vars:
        NAME: 'VNLib.Data.Caching.Providers.VNCache'
        PROJECT_NAME: 'VNLib.Data.Caching.Providers.VNCache'
        MODULE_NAME: "VNLib.Data.Caching"
        FILE_NAME: "release.tgz"
        DIR: './plugins/assets/VNLib.Data.Caching.Providers.VNCache'

  install-vncache-sessions:
    cmds:
    #install vncache-web-sessions plugin
    - task: install-plugin
      vars:
        NAME: 'VNLib.Plugins.Sessions.VNCache'
        PROJECT_NAME: 'VNLib.Plugins.Sessions.VNCache'
        MODULE_NAME: "VNLib.Plugins.Sessions"
        FILE_NAME: "release.tgz"
        DIR: './plugins/assets/VNLib.Plugins.Sessions.VNCache'

  install-argon2-lib:
    cmds:
    #install the argon2 binary for Windows
    - task: install-plugin
      vars:
        NAME: 'argon2'
        PROJECT_NAME: 'phc-winner-argon2'
        MODULE_NAME: "VNLib.Core"
        FILE_NAME: "win-x64-release-Argon2.tgz"
        DIR: './lib/argon2'

    #install the argon2 source code package for Linux and Mac
    - task: install-plugin
      vars:
        NAME: 'argon2'
        PROJECT_NAME: 'phc-winner-argon2'
        MODULE_NAME: "VNLib.Core"
        FILE_NAME: "src.tgz"
        DIR: './lib/argon2'

    #remove unneeded files
    - cmd: powershell -Command "rm ./lib/argon2/man -Recurse"
      ignore_error: true
    - cmd: powershell -Command "rm ./lib/argon2/latex -Recurse"
      ignore_error: true
    - cmd: powershell -Command "rm ./lib/argon2/kats -Recurse"
      ignore_error: true
    - cmd: powershell -Command "rm ./lib/argon2/argon2-specs.pdf"
      ignore_error: true
    - cmd: powershell -Command "rm ./lib/argon2/package.json"
      ignore_error: true

  install-plugin:
    cmds:
    #make the plugin directory
    - cmd: powershell -Command "mkdir {{.DIR}} -Force"
      ignore_error: true
    - cd {{.DIR}} && powershell "{{.USER_WORKING_DIR}}/install.ps1" -BaseUrl {{.BUILDS_URL}} -ModuleName {{.MODULE_NAME}} -ProjectName {{.PROJECT_NAME}} -FileName {{.FILE_NAME}}
    - cd {{.DIR}} && tar -xzf {{.FILE_NAME}} 
    #remove the archive file 
    - cd {{.DIR}} && powershell -Command "rm {{.FILE_NAME}}"
    #copy config file from config dir
    - cmd: powershell -Command "cp -Force ./config/{{.NAME}}.json {{.DIR}}/{{.NAME}}.json"
      ignore_error: true