forked from easychen/CookieCloud
-
Notifications
You must be signed in to change notification settings - Fork 0
/
RoboFile.php
52 lines (43 loc) · 1.35 KB
/
RoboFile.php
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
<?php
/**
* This is project's console commands configuration for Robo task runner.
*
* @see https://robo.li/
*/
class RoboFile extends \Robo\Tasks
{
public function apiDev()
{
$this->_exec("cd api && node_modules/nodemon/bin/nodemon.js app.js");
}
public function api()
{
$this->_exec("cd api && API_ROOT=/cookie node app.js");
}
public function imagePub($uniqid = null)
{
if ($uniqid == null) {
$uniqid = date("Y.m.d.H.i");
;
}
$this->_exec("docker buildx create --use --name build-node-example --driver docker-container");
$this->_exec("docker buildx build -t easychen/cookiecloud:latest -t easychen/cookiecloud:$uniqid --platform=linux/amd64,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x --push ./docker");
$this->_exec("docker buildx rm build-node-example");
}
public function extBuild()
{
$this->_exec("cd extension && pnpm build && pnpm package");
}
public function firefoxBuild()
{
$this->_exec("cd extension && pnpm build --target=firefox-mv2 && pnpm package --target=firefox-mv2");
}
public function firefoxDev()
{
$this->_exec("cd extension && pnpm dev --target=firefox-mv2");
}
public function extDev()
{
$this->_exec("cd extension && pnpm dev");
}
}