Skip to content

Commit

Permalink
isolate update 2 (#26)
Browse files Browse the repository at this point in the history
* Dial fully for `lando update`

* Update to node 18

* Fix some script-generated issues.

* First stab at new directory structure and adding in lamp-y builders

* Feed linter.

* Try clearing lando.

* Get rid of erroneous builder.js/init.

* Set confsrc.

* Update dependencies.

* Correct path to local joomla.
  • Loading branch information
reynoldsalec authored Dec 23, 2023
1 parent adb6ada commit 319cccd
Show file tree
Hide file tree
Showing 29 changed files with 9,715 additions and 4,487 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/pr-docs-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
os:
- ubuntu-22.04
node-version:
- '16'
- '18'
steps:
# Install deps and cache
- name: Checkout code
Expand All @@ -20,12 +20,12 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: yarn
- name: Install Yarn dependencies
run: yarn install --prefer-offline --frozen-lockfile
cache: npm
- name: Install NPM dependencies
run: npm clean-install --prefer-offline --frozen-lockfile

# Run tests
- name: Run linter
run: yarn docs:lint
run: npm run docs:lint
- name: Test build
run: yarn docs:build
run: npm run docs:build
31 changes: 17 additions & 14 deletions .github/workflows/pr-joomla-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ jobs:
strategy:
fail-fast: false
matrix:
leia-test:
- examples/joomla
- examples/joomla-mysql8
lando-version:
- 3-dev
- 3-dev-slim
os:
- ubuntu-22.04
node-version:
- '16'
- '18'
leia-test:
- examples/joomla
- examples/joomla-mysql8

steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -28,21 +29,23 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org
cache: yarn
- name: Install Yarn dependencies
run: yarn install --prefer-offline --frozen-lockfile
cache: npm
- name: Install NPM dependencies
run: npm clean-install --prefer-offline --frozen-lockfile
- name: Bundle Deps
uses: lando/prepare-release-action@v2
with:
lando-plugin: true
version: dev
sync: false
- name: Setup lando ${{ matrix.lando-version }}
uses: lando/setup-lando@v2
with:
lando-version: ${{ matrix.lando-version }}
config: |
plugins.@lando/joomla=/home/runner/work/joomla/joomla
setup.skipCommonPlugins=true
setup.plugins.@lando/joomla=/home/runner/work/joomla/joomla
telemetry: false
- name: Verify Lando works and we are dogfooding this plugin for tests
run: |
lando --clear
lando version
lando config --path plugins | grep joomla | grep /home/runner/work/joomla/joomla || (echo "::error:: Not dogfooding this plugin correctly!" && exit 1)
- name: Run Leia Tests
uses: lando/run-leia-action@v2
with:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/pr-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
os:
- ubuntu-22.04
node-version:
- '16'
- '18'
steps:
# Install deps and cache
- name: Checkout code
Expand All @@ -20,10 +20,10 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: yarn
- name: Install Yarn dependencies
run: yarn install --prefer-offline --frozen-lockfile
cache: npm
- name: Install NPM dependencies
run: npm clean-install --prefer-offline --frozen-lockfile

# Run the linter
- name: Run code linter
run: yarn lint
run: npm run lint
10 changes: 5 additions & 5 deletions .github/workflows/pr-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- ubuntu-22.04
- macos-12
node-version:
- '16'
- '18'
steps:
# Install deps and cache
- name: Checkout code
Expand All @@ -23,10 +23,10 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: yarn
- name: Install Yarn dependencies
run: yarn install --prefer-offline --frozen-lockfile
cache: npm
- name: Install NPM dependencies
run: npm clean-install --prefer-offline --frozen-lockfile

# Run unit tests
- name: Run unit tests
run: yarn test:unit
run: npm run test:unit
14 changes: 7 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
os:
- ubuntu-22.04
node-version:
- '16'
- '18'
steps:
# Install deps and cache
- name: Checkout code
Expand All @@ -27,19 +27,19 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org
cache: yarn
- name: Install Yarn dependencies
run: yarn install --prefer-offline --frozen-lockfile
cache: npm
- name: Install NPM dependencies
run: npm clean-install --prefer-offline --frozen-lockfile

# Let's do tests rq just to make sure we dont push something that is fundamentally broken
- name: Lint code
run: yarn lint
run: npm run lint
- name: Run unit tests
run: yarn test:unit
run: npm run test:unit

# Prepare release.
- name: Prepare release
uses: lando/prepare-release-action@v2
uses: lando/prepare-release-action@v3
with:
lando-plugin: true

Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,7 @@ coverage/
_site
docs/.vuepress/.cache
docs/.vuepress/.temp
docs/.vuepress/dist
docs/.vuepress/dist

# YARN
yarn.lock
6 changes: 3 additions & 3 deletions .lando.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: lando-joomla-plugin
services:
node:
type: node:14
type: node:18
build:
- yarn install
- npm install
scanner: false
ssl: false
sslExpose: false
tooling:
node:
service: node
yarn:
npm:
service: node
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16
18
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## v1.0.0 - [December 7, 2023](https://github.com/lando/joomla/releases/tag/v1.0.0)
* Dialed fully for `lando update`

## v0.9.0 - [July 3, 2023](https://github.com/lando/joomla/releases/tag/v0.9.0)
* Removed bundle-dependencies and version-bump-prompt from plugin.
* Updated package to use prepare-release-action.
Expand Down
15 changes: 15 additions & 0 deletions builders/joomla-mariadb.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use strict';

const _ = require('lodash');
const LandoMariadb = require('./../node_modules/@lando/mariadb/builders/mariadb.js');

// Builder
module.exports = {
name: 'joomla-mariadb',
parent: '_service',
builder: (parent, config) => class JoomlaMariadb extends LandoMariadb.builder(parent, LandoMariadb.config) {
constructor(id, options = {}) {
super(id, _.merge({}, config, options), {services: _.set({}, options.name)});
};
},
};
15 changes: 15 additions & 0 deletions builders/joomla-mysql.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use strict';

const _ = require('lodash');
const LandoMysql = require('./../node_modules/@lando/mysql/builders/mysql.js');

// Builder
module.exports = {
name: 'joomla-mysql',
parent: '_service',
builder: (parent, config) => class JoomlaMysql extends LandoMysql.builder(parent, LandoMysql.config) {
constructor(id, options = {}) {
super(id, _.merge({}, config, options), {services: _.set({}, options.name)});
};
},
};
18 changes: 18 additions & 0 deletions builders/joomla-nginx.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
'use strict';

const _ = require('lodash');
const PhpNginx = require('@lando/php/builders/php-nginx.js');

// Builder
module.exports = {
name: 'joomla-nginx',
parent: '_webserver',
config: {
version: '1.25',
},
builder: (parent, config) => class JoomlaNginx extends PhpNginx.builder(parent, PhpNginx.config) {
constructor(id, options = {}) {
super(id, _.merge({}, config, options), {services: _.set({}, options.name)});
};
},
};
32 changes: 32 additions & 0 deletions builders/joomla-php.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
'use strict';

const _ = require('lodash');
const fs = require('fs');
const path = require('path');
const landoPhpPath = path.join(__dirname, '../node_modules/@lando/php');
const LandoPhp = require(`${landoPhpPath}/builders/php.js`);

const loadScripts = options => {
const lando = _.get(options, '_app._lando');
// Move the script to the confDir and make executable.
if (fs.existsSync(path.join(landoPhpPath, 'scripts'))) {
const confDir = path.join(lando.config.userConfRoot, 'scripts');
const dest = lando.utils.moveConfig(path.join(landoPhpPath, 'scripts'), confDir);
lando.utils.makeExecutable(fs.readdirSync(dest), dest);
lando.log.debug('automoved scripts from %s to %s and set to mode 755',
path.join(landoPhpPath, 'scripts'), confDir);
}
};

// Builder
module.exports = {
name: 'joomla-php',
parent: '_appserver',
builder: (parent, config) => class JoomlaPhp extends LandoPhp.builder(parent, LandoPhp.config) {
constructor(id, options = {}, factory) {
loadScripts(options);
options.nginxServiceType = 'joomla-nginx';
super(id, _.merge({}, config, options), factory);
};
},
};
15 changes: 15 additions & 0 deletions builders/joomla-postgres.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use strict';

const _ = require('lodash');
const LandoPostgres = require('./../node_modules/@lando/postgres/builders/postgres.js');

// Builder
module.exports = {
name: 'joomla-postgres',
parent: '_service',
builder: (parent, config) => class JoomlaPostgres extends LandoPostgres.builder(parent, LandoPostgres.config) {
constructor(id, options = {}) {
super(id, _.merge({}, config, options), {services: _.set({}, options.name)});
};
},
};
Loading

0 comments on commit 319cccd

Please sign in to comment.