@codigodoleo/wp-kit 2.0.4 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.cspell.json +5 -25
- package/README.md +127 -2
- package/lib/cli.js +1 -0
- package/lib/commands/init.js +32 -10
- package/lib/config/versions.js +163 -0
- package/lib/core/generator.js +63 -46
- package/lib/core/hook-manager.js +2 -2
- package/lib/core/infer-ci-capabilities.js +13 -24
- package/lib/prompts/index.js +31 -19
- package/lib/prompts/loadModulePrompts.js +4 -2
- package/lib/utils/generate-from-template.js +1 -0
- package/modules/deploy/index.js +34 -7
- package/modules/deploy/prompts.js +5 -5
- package/modules/deploy/templates/.github/workflows/ci.yml.hbs +49 -103
- package/modules/deploy/templates/.gitlab/gitlab-ci.yml.hbs +45 -145
- package/modules/deploy/templates/bitbucket-pipelines.yml.hbs +46 -97
- package/modules/docs/prompts.js +2 -2
- package/modules/docs/templates/README.md.hbs +67 -160
- package/modules/docs/templates/docs/Arquitetura.md +113 -92
- package/modules/docs/templates/docs/Deploy-Pipeline.md +22 -8
- package/modules/docs/templates/docs/Desenvolvimento.md +187 -164
- package/modules/docs/templates/docs/Getting-Started.md +37 -7
- package/modules/docs/templates/docs/Infraestrutura.md +41 -12
- package/modules/docs/templates/docs/Monitoramento.md +83 -45
- package/modules/docs/templates/docs/Sync-the-Production-DB-with-the-Staging-DB.md +6 -7
- package/modules/docs/templates/docs/Troubleshooting.md +1 -1
- package/modules/git/.github/PULL_REQUEST_TEMPLATE.md +1 -0
- package/modules/git/.gitlab/merge_request_templates/default.md +1 -0
- package/modules/git/.vscode/commit-instructions.md +7 -0
- package/modules/git/.vscode/conventional-commits.code-snippets +13 -43
- package/modules/git/docs/CONVENTIONAL-COMMITS.md +14 -14
- package/modules/git/index.js +39 -34
- package/modules/git/prompts.js +4 -4
- package/modules/git/templates/.lando.yml.hbs +5 -13
- package/modules/git/templates/package.json.hbs +4 -15
- package/modules/git/templates/workspace.json.hbs +28 -114
- package/modules/lint/eslint.config.mjs +36 -0
- package/modules/lint/index.js +1 -2
- package/modules/lint/prompts.js +3 -3
- package/modules/lint/templates/.lando.yml.hbs +2 -10
- package/modules/lint/templates/package.json.hbs +4 -16
- package/modules/lint/templates/workspace.json.hbs +15 -56
- package/modules/php/prompts.js +2 -2
- package/modules/php/templates/.lando.yml.hbs +2 -11
- package/modules/php/templates/composer.json.hbs +1 -6
- package/modules/php/templates/workspace.json.hbs +15 -74
- package/modules/redis/prompts.js +2 -2
- package/modules/redis/templates/.lando.yml.hbs +1 -8
- package/modules/sage/index.js +115 -7
- package/modules/sage/prompts.js +3 -3
- package/modules/sage/templates/.lando.yml.hbs +20 -64
- package/modules/sage/templates/theme/composer.json.hbs +3 -18
- package/modules/sage/templates/theme/package.json.hbs +3 -11
- package/modules/sage/templates/theme/style.css.hbs +20 -13
- package/modules/sage/templates/theme/vite.config.js.hbs +13 -53
- package/modules/sage/templates/workspace.json.hbs +12 -67
- package/modules/test-directory/prompts.js +2 -2
- package/package.json +20 -1
- package/templates/.editorconfig.hbs +5 -39
- package/templates/.env.hbs +14 -35
- package/templates/.gitignore.hbs +13 -86
- package/templates/.lando.yml.hbs +11 -44
- package/templates/README.md.hbs +7 -8
- package/templates/composer.json.hbs +12 -60
- package/templates/server/cmd/install-wp.sh.hbs +43 -58
- package/templates/server/www/vhosts.conf.hbs +21 -71
- package/templates/workspace.json.hbs +40 -177
|
@@ -1,103 +1,49 @@
|
|
|
1
|
-
# 🚀 WordPress CI (GitHub Actions)
|
|
2
|
-
|
|
3
|
-
name:
|
|
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
|
-
uses: actions/setup-node@v4
|
|
51
|
-
with:
|
|
52
|
-
node-version: ${{ '{{' }} env.NODE_VERSION {{ '}}' }}
|
|
53
|
-
- name: Build theme
|
|
54
|
-
run: |
|
|
55
|
-
THEME="{{ci.theme.paths.themeRoot}}"
|
|
56
|
-
if [ -d "$THEME" ]; then
|
|
57
|
-
cd "$THEME"
|
|
58
|
-
if [ -f package.json ]; then npm ci; fi
|
|
59
|
-
if [ -f yarn.lock ]; then yarn install --frozen-lockfile; fi
|
|
60
|
-
if [ -f package.json ]; then npm run build || yarn build; fi
|
|
61
|
-
else
|
|
62
|
-
echo "Tema não encontrado em $THEME — pulando build do tema"
|
|
63
|
-
fi
|
|
64
|
-
{{/if}}
|
|
65
|
-
|
|
66
|
-
test-basic:
|
|
67
|
-
name: Tests
|
|
68
|
-
runs-on: ubuntu-latest
|
|
69
|
-
steps:
|
|
70
|
-
- name: Checkout
|
|
71
|
-
uses: actions/checkout@v4
|
|
72
|
-
- name: Setup Node
|
|
73
|
-
uses: actions/setup-node@v4
|
|
74
|
-
with:
|
|
75
|
-
node-version: ${{ '{{' }} env.NODE_VERSION {{ '}}' }}
|
|
76
|
-
- name: Run basic tests
|
|
77
|
-
run: echo "No tests yet"
|
|
78
|
-
|
|
79
|
-
{{#if ci.deploy.docker}}
|
|
80
|
-
deploy-docker:
|
|
81
|
-
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/staging'
|
|
82
|
-
name: Deploy Docker
|
|
83
|
-
runs-on: ubuntu-latest
|
|
84
|
-
steps:
|
|
85
|
-
- name: Checkout
|
|
86
|
-
uses: actions/checkout@v4
|
|
87
|
-
- name: Set up Docker Buildx
|
|
88
|
-
uses: docker/setup-buildx-action@v3
|
|
89
|
-
- name: Login to GHCR
|
|
90
|
-
uses: docker/login-action@v3
|
|
91
|
-
with:
|
|
92
|
-
registry: ghcr.io
|
|
93
|
-
username: ${{ '{{' }} github.actor {{ '}}' }}
|
|
94
|
-
password: ${{ '{{' }} secrets.GITHUB_TOKEN {{ '}}' }}
|
|
95
|
-
- name: Build (placeholder)
|
|
96
|
-
run: echo "Deploy Docker"
|
|
97
|
-
{{/if}}
|
|
98
|
-
|
|
99
|
-
env:
|
|
100
|
-
PHP_VERSION: "{{phpVersion}}"
|
|
101
|
-
NODE_VERSION: "{{ci.nodeVersion}}"
|
|
102
|
-
WORDPRESS_VERSION: "{{wpCoreVersion}}"
|
|
103
|
-
PROJECT_NAME: "{{projectName}}"
|
|
1
|
+
# 🚀 WordPress CI (GitHub Actions) name: CI on: push: branches: [ main, develop, staging ]
|
|
2
|
+
pull_request: branches: [ main, develop, staging ] jobs: build-basic: name: Build basic runs-on:
|
|
3
|
+
ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Setup Node uses:
|
|
4
|
+
actions/setup-node@v4 with: node-version: ${{'{{'}}
|
|
5
|
+
env.NODE_VERSION
|
|
6
|
+
{{'}}'}}
|
|
7
|
+
- name: Install deps (if present) run: | if [ -f package.json ]; then npm ci; fi
|
|
8
|
+
|
|
9
|
+
{{#if ci.build.composer}}
|
|
10
|
+
build-composer: name: Build Composer runs-on: ubuntu-latest steps: - name: Checkout uses:
|
|
11
|
+
actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: ${{'{{'}}
|
|
12
|
+
env.PHP_VERSION
|
|
13
|
+
{{'}}'}}
|
|
14
|
+
- name: Install Composer deps run: | if [ -f composer.json ]; then composer install --no-dev
|
|
15
|
+
--optimize-autoloader; fi
|
|
16
|
+
{{/if}}
|
|
17
|
+
|
|
18
|
+
{{#if ci.build.sage}}
|
|
19
|
+
build-sage: name: Build Sage Theme runs-on: ubuntu-latest steps: - name: Checkout uses:
|
|
20
|
+
actions/checkout@v4 - name: Setup Node uses: actions/setup-node@v4 with: node-version: ${{'{{'}}
|
|
21
|
+
env.NODE_VERSION
|
|
22
|
+
{{'}}'}}
|
|
23
|
+
- name: Build theme run: | THEME="{{ci.theme.paths.themeRoot}}" if [ -d "$THEME" ]; then cd
|
|
24
|
+
"$THEME" if [ -f package.json ]; then npm ci; fi if [ -f yarn.lock ]; then yarn install
|
|
25
|
+
--frozen-lockfile; fi if [ -f package.json ]; then npm run build || yarn build; fi else echo "Tema
|
|
26
|
+
não encontrado em $THEME — pulando build do tema" fi
|
|
27
|
+
{{/if}}
|
|
28
|
+
|
|
29
|
+
test-basic: name: Tests runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 -
|
|
30
|
+
name: Setup Node uses: actions/setup-node@v4 with: node-version: ${{'{{'}}
|
|
31
|
+
env.NODE_VERSION
|
|
32
|
+
{{'}}'}}
|
|
33
|
+
- name: Run basic tests run: echo "No tests yet"
|
|
34
|
+
|
|
35
|
+
{{#if ci.deploy.docker}}
|
|
36
|
+
deploy-docker: if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/staging' name:
|
|
37
|
+
Deploy Docker runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Set
|
|
38
|
+
up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Login to GHCR uses:
|
|
39
|
+
docker/login-action@v3 with: registry: ghcr.io username: ${{'{{'}}
|
|
40
|
+
github.actor
|
|
41
|
+
{{'}}'}}
|
|
42
|
+
password: ${{'{{'}}
|
|
43
|
+
secrets.GITHUB_TOKEN
|
|
44
|
+
{{'}}'}}
|
|
45
|
+
- name: Build (placeholder) run: echo "Deploy Docker"
|
|
46
|
+
{{/if}}
|
|
47
|
+
|
|
48
|
+
env: PHP_VERSION: "{{phpVersion}}" NODE_VERSION: "{{ci.nodeVersion}}" WORDPRESS_VERSION: "{{wpCoreVersion}}"
|
|
49
|
+
PROJECT_NAME: "{{projectName}}"
|
|
@@ -1,154 +1,54 @@
|
|
|
1
|
-
# 🚀 WordPress CI/CD Pipeline (dinâmico)
|
|
2
|
-
|
|
3
|
-
variables:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
|
24
|
-
when: always
|
|
25
|
-
- when: never
|
|
26
|
-
|
|
27
|
-
stages:
|
|
28
|
-
- build
|
|
29
|
-
- test
|
|
30
|
-
- deploy
|
|
31
|
-
|
|
32
|
-
cache:
|
|
33
|
-
key:
|
|
34
|
-
files:
|
|
35
|
-
{{#each ci.cache.packageGlobs}}
|
|
36
|
-
- {{this}}
|
|
37
|
-
{{/each}}
|
|
38
|
-
{{#each ci.cache.composerGlobs}}
|
|
39
|
-
- {{this}}
|
|
40
|
-
{{/each}}
|
|
41
|
-
paths:
|
|
42
|
-
- **/node_modules/
|
|
43
|
-
- **/vendor/
|
|
44
|
-
|
|
45
|
-
default:
|
|
46
|
-
interruptible: true
|
|
47
|
-
retry:
|
|
48
|
-
max: 1
|
|
49
|
-
when:
|
|
50
|
-
- runner_system_failure
|
|
51
|
-
- stuck_or_timeout_failure
|
|
52
|
-
|
|
53
|
-
# ===== BUILD =====
|
|
54
|
-
|
|
55
|
-
build:basic:
|
|
56
|
-
stage: build
|
|
57
|
-
image: node:{{ci.nodeVersion}}-alpine
|
|
58
|
-
before_script:
|
|
59
|
-
- apk add --no-cache git
|
|
60
|
-
script:
|
|
61
|
-
- echo "🚀 Build básico"
|
|
62
|
-
- if [ -f package.json ]; then npm ci --cache .npm --prefer-offline; fi
|
|
63
|
-
artifacts:
|
|
64
|
-
paths:
|
|
65
|
-
- **/node_modules/
|
|
66
|
-
expire_in: 1 hour
|
|
67
|
-
rules:
|
|
68
|
-
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
|
69
|
-
- if: $CI_COMMIT_BRANCH == "main"
|
|
70
|
-
- if: $CI_COMMIT_BRANCH == "staging"
|
|
71
|
-
- if: $CI_COMMIT_BRANCH == "develop"
|
|
1
|
+
# 🚀 WordPress CI/CD Pipeline (dinâmico) variables: PHP_VERSION: "{{phpVersion}}" WORDPRESS_VERSION:
|
|
2
|
+
"{{wpCoreVersion}}" PROJECT_NAME: "{{projectName}}" NODE_VERSION: "{{ci.nodeVersion}}" workflow:
|
|
3
|
+
rules: - if: $CI_COMMIT_BRANCH == "main" variables: ENVIRONMENT: "production" when: always - if:
|
|
4
|
+
$CI_COMMIT_BRANCH == "staging" variables: ENVIRONMENT: "staging" when: always - if:
|
|
5
|
+
$CI_COMMIT_BRANCH == "develop" variables: ENVIRONMENT: "development" when: always - if:
|
|
6
|
+
$CI_PIPELINE_SOURCE == "merge_request_event" when: always - when: never stages: - build - test -
|
|
7
|
+
deploy cache: key: files:
|
|
8
|
+
{{#each ci.cache.packageGlobs}}
|
|
9
|
+
-
|
|
10
|
+
{{this}}
|
|
11
|
+
{{/each}}
|
|
12
|
+
{{#each ci.cache.composerGlobs}}
|
|
13
|
+
-
|
|
14
|
+
{{this}}
|
|
15
|
+
{{/each}}
|
|
16
|
+
paths: - **/node_modules/ - **/vendor/ default: interruptible: true retry: max: 1 when: -
|
|
17
|
+
runner_system_failure - stuck_or_timeout_failure # ===== BUILD ===== build:basic: stage: build
|
|
18
|
+
image: node:{{ci.nodeVersion}}-alpine before_script: - apk add --no-cache git script: - echo "🚀
|
|
19
|
+
Build básico" - if [ -f package.json ]; then npm ci --cache .npm --prefer-offline; fi artifacts:
|
|
20
|
+
paths: - **/node_modules/ expire_in: 1 hour rules: - if: $CI_PIPELINE_SOURCE ==
|
|
21
|
+
"merge_request_event" - if: $CI_COMMIT_BRANCH == "main" - if: $CI_COMMIT_BRANCH == "staging" - if:
|
|
22
|
+
$CI_COMMIT_BRANCH == "develop"
|
|
72
23
|
|
|
73
24
|
{{#if ci.build.composer}}
|
|
74
|
-
build:composer:
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
script:
|
|
80
|
-
- echo "📦 Composer install"
|
|
81
|
-
- if [ -f composer.json ]; then composer install --no-dev --optimize-autoloader; fi
|
|
82
|
-
artifacts:
|
|
83
|
-
paths:
|
|
84
|
-
- **/vendor/
|
|
85
|
-
expire_in: 1 hour
|
|
86
|
-
rules:
|
|
87
|
-
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
|
88
|
-
- if: $CI_COMMIT_BRANCH == "main"
|
|
89
|
-
- if: $CI_COMMIT_BRANCH == "staging"
|
|
90
|
-
- if: $CI_COMMIT_BRANCH == "develop"
|
|
25
|
+
build:composer: stage: build image: composer:latest before_script: - apk add --no-cache git
|
|
26
|
+
script: - echo "📦 Composer install" - if [ -f composer.json ]; then composer install --no-dev
|
|
27
|
+
--optimize-autoloader; fi artifacts: paths: - **/vendor/ expire_in: 1 hour rules: - if:
|
|
28
|
+
$CI_PIPELINE_SOURCE == "merge_request_event" - if: $CI_COMMIT_BRANCH == "main" - if:
|
|
29
|
+
$CI_COMMIT_BRANCH == "staging" - if: $CI_COMMIT_BRANCH == "develop"
|
|
91
30
|
{{/if}}
|
|
92
31
|
|
|
93
32
|
{{#if ci.build.sage}}
|
|
94
|
-
build:sage:
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
cd "$THEME"
|
|
105
|
-
if [ -f package.json ]; then npm ci --cache .npm --prefer-offline; fi
|
|
106
|
-
if [ -f yarn.lock ]; then yarn install --frozen-lockfile; fi
|
|
107
|
-
if [ -f package.json ]; then npm run build || yarn build; fi
|
|
108
|
-
else
|
|
109
|
-
echo "Tema não encontrado em $THEME — pulando build do tema"
|
|
110
|
-
fi
|
|
111
|
-
artifacts:
|
|
112
|
-
paths:
|
|
113
|
-
- {{ci.theme.paths.themeRoot}}/public/
|
|
114
|
-
- {{ci.theme.paths.themeRoot}}/dist/
|
|
115
|
-
when: always
|
|
116
|
-
expire_in: 1 day
|
|
117
|
-
rules:
|
|
118
|
-
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
|
119
|
-
- if: $CI_COMMIT_BRANCH == "main"
|
|
120
|
-
- if: $CI_COMMIT_BRANCH == "staging"
|
|
121
|
-
- if: $CI_COMMIT_BRANCH == "develop"
|
|
33
|
+
build:sage: stage: build image: node:{{ci.nodeVersion}}-alpine before_script: - apk add --no-cache
|
|
34
|
+
git script: - echo "🎨 Build do tema Sage" - | THEME="{{ci.theme.paths.themeRoot}}" if [ -d
|
|
35
|
+
"$THEME" ]; then cd "$THEME" if [ -f package.json ]; then npm ci --cache .npm --prefer-offline; fi
|
|
36
|
+
if [ -f yarn.lock ]; then yarn install --frozen-lockfile; fi if [ -f package.json ]; then npm run
|
|
37
|
+
build || yarn build; fi else echo "Tema não encontrado em $THEME — pulando build do tema" fi
|
|
38
|
+
artifacts: paths: -
|
|
39
|
+
{{ci.theme.paths.themeRoot}}/public/ -
|
|
40
|
+
{{ci.theme.paths.themeRoot}}/dist/ when: always expire_in: 1 day rules: - if: $CI_PIPELINE_SOURCE
|
|
41
|
+
== "merge_request_event" - if: $CI_COMMIT_BRANCH == "main" - if: $CI_COMMIT_BRANCH == "staging" -
|
|
42
|
+
if: $CI_COMMIT_BRANCH == "develop"
|
|
122
43
|
{{/if}}
|
|
123
44
|
|
|
124
|
-
# ===== TEST =====
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
image: node:{{ci.nodeVersion}}-alpine
|
|
129
|
-
script:
|
|
130
|
-
- echo "🧪 Testes básicos"
|
|
131
|
-
rules:
|
|
132
|
-
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
|
133
|
-
- if: $CI_COMMIT_BRANCH == "main"
|
|
134
|
-
- if: $CI_COMMIT_BRANCH == "staging"
|
|
135
|
-
- if: $CI_COMMIT_BRANCH == "develop"
|
|
136
|
-
|
|
137
|
-
# ===== DEPLOY =====
|
|
45
|
+
# ===== TEST ===== test:basic: stage: test image: node:{{ci.nodeVersion}}-alpine script: - echo "🧪
|
|
46
|
+
Testes básicos" rules: - if: $CI_PIPELINE_SOURCE == "merge_request_event" - if: $CI_COMMIT_BRANCH ==
|
|
47
|
+
"main" - if: $CI_COMMIT_BRANCH == "staging" - if: $CI_COMMIT_BRANCH == "develop" # ===== DEPLOY
|
|
48
|
+
=====
|
|
138
49
|
|
|
139
50
|
{{#if ci.deploy.docker}}
|
|
140
|
-
deploy:docker:
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
- docker:dind
|
|
145
|
-
before_script:
|
|
146
|
-
- docker info
|
|
147
|
-
script:
|
|
148
|
-
- echo "🐳 Deploy Docker (placeholder)"
|
|
149
|
-
rules:
|
|
150
|
-
- if: $CI_COMMIT_BRANCH == "main"
|
|
151
|
-
- if: $CI_COMMIT_BRANCH == "staging"
|
|
152
|
-
{{/if}}
|
|
153
|
-
|
|
154
|
-
|
|
51
|
+
deploy:docker: stage: deploy image: docker:latest services: - docker:dind before_script: - docker
|
|
52
|
+
info script: - echo "🐳 Deploy Docker (placeholder)" rules: - if: $CI_COMMIT_BRANCH == "main" -
|
|
53
|
+
if: $CI_COMMIT_BRANCH == "staging"
|
|
54
|
+
{{/if}}
|
|
@@ -1,97 +1,46 @@
|
|
|
1
|
-
# 🚀 WordPress CI (Bitbucket Pipelines)
|
|
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
|
-
- step: &test-basic
|
|
48
|
-
name: Tests
|
|
49
|
-
script:
|
|
50
|
-
- echo "🧪 Testes básicos"
|
|
51
|
-
|
|
52
|
-
branches:
|
|
53
|
-
main:
|
|
54
|
-
- step: *build-basic
|
|
55
|
-
{{#if ci.build.composer}}
|
|
56
|
-
- step: *build-composer
|
|
57
|
-
{{/if}}
|
|
58
|
-
{{#if ci.build.sage}}
|
|
59
|
-
- step: *build-sage
|
|
60
|
-
{{/if}}
|
|
61
|
-
- step: *test-basic
|
|
62
|
-
{{#if ci.deploy.docker}}
|
|
63
|
-
- step:
|
|
64
|
-
name: Deploy Docker
|
|
65
|
-
services:
|
|
66
|
-
- docker
|
|
67
|
-
script:
|
|
68
|
-
- echo "🐳 Deploy Docker (placeholder)"
|
|
69
|
-
{{/if}}
|
|
70
|
-
|
|
71
|
-
develop:
|
|
72
|
-
- step: *build-basic
|
|
73
|
-
{{#if ci.build.composer}}
|
|
74
|
-
- step: *build-composer
|
|
75
|
-
{{/if}}
|
|
76
|
-
{{#if ci.build.sage}}
|
|
77
|
-
- step: *build-sage
|
|
78
|
-
{{/if}}
|
|
79
|
-
- step: *test-basic
|
|
80
|
-
|
|
81
|
-
staging:
|
|
82
|
-
- step: *build-basic
|
|
83
|
-
{{#if ci.build.composer}}
|
|
84
|
-
- step: *build-composer
|
|
85
|
-
{{/if}}
|
|
86
|
-
{{#if ci.build.sage}}
|
|
87
|
-
- step: *build-sage
|
|
88
|
-
{{/if}}
|
|
89
|
-
- step: *test-basic
|
|
90
|
-
|
|
91
|
-
options:
|
|
92
|
-
size: 2x
|
|
93
|
-
|
|
94
|
-
definitions:
|
|
95
|
-
caches:
|
|
96
|
-
node: ~/.npm
|
|
97
|
-
composer: ~/.composer/cache
|
|
1
|
+
# 🚀 WordPress CI (Bitbucket Pipelines) image: node:{{ci.nodeVersion}}-alpine pipelines: default: -
|
|
2
|
+
step: &build-basic name: Build basic caches: - node script: - echo "🚀 Build básico" - | if [ -f
|
|
3
|
+
package.json ]; then npm ci --cache .npm --prefer-offline; fi
|
|
4
|
+
|
|
5
|
+
{{#if ci.build.composer}}
|
|
6
|
+
- step: &build-composer name: Build Composer image: composer:latest caches: - composer script: -
|
|
7
|
+
echo "📦 Composer install" - | if [ -f composer.json ]; then composer install --no-dev
|
|
8
|
+
--optimize-autoloader; fi
|
|
9
|
+
{{/if}}
|
|
10
|
+
|
|
11
|
+
{{#if ci.build.sage}}
|
|
12
|
+
- step: &build-sage name: Build Sage caches: - node script: - echo "🎨 Build do tema Sage" - |
|
|
13
|
+
THEME="{{ci.theme.paths.themeRoot}}" if [ -d "$THEME" ]; then cd "$THEME" if [ -f package.json ];
|
|
14
|
+
then npm ci; fi if [ -f yarn.lock ]; then yarn install --frozen-lockfile; fi if [ -f package.json
|
|
15
|
+
]; then npm run build || yarn build; fi else echo "Tema não encontrado em $THEME — pulando build
|
|
16
|
+
do tema" fi
|
|
17
|
+
{{/if}}
|
|
18
|
+
|
|
19
|
+
- step: &test-basic name: Tests script: - echo "🧪 Testes básicos" branches: main: - step:
|
|
20
|
+
*build-basic
|
|
21
|
+
{{#if ci.build.composer}}
|
|
22
|
+
- step: *build-composer
|
|
23
|
+
{{/if}}
|
|
24
|
+
{{#if ci.build.sage}}
|
|
25
|
+
- step: *build-sage
|
|
26
|
+
{{/if}}
|
|
27
|
+
- step: *test-basic
|
|
28
|
+
{{#if ci.deploy.docker}}
|
|
29
|
+
- step: name: Deploy Docker services: - docker script: - echo "🐳 Deploy Docker (placeholder)"
|
|
30
|
+
{{/if}}
|
|
31
|
+
|
|
32
|
+
develop: - step: *build-basic
|
|
33
|
+
{{#if ci.build.composer}}
|
|
34
|
+
- step: *build-composer
|
|
35
|
+
{{/if}}
|
|
36
|
+
{{#if ci.build.sage}}
|
|
37
|
+
- step: *build-sage
|
|
38
|
+
{{/if}}
|
|
39
|
+
- step: *test-basic staging: - step: *build-basic
|
|
40
|
+
{{#if ci.build.composer}}
|
|
41
|
+
- step: *build-composer
|
|
42
|
+
{{/if}}
|
|
43
|
+
{{#if ci.build.sage}}
|
|
44
|
+
- step: *build-sage
|
|
45
|
+
{{/if}}
|
|
46
|
+
- step: *test-basic options: size: 2x definitions: caches: node: ~/.npm composer: ~/.composer/cache
|
package/modules/docs/prompts.js
CHANGED