Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dial fully for lando update #42

Merged
merged 8 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/pr-docs-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
os:
- ubuntu-22.04
node-version:
- '16'
- '18'
steps:
# Install deps and cache
- name: Checkout code
Expand All @@ -22,12 +22,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
32 changes: 17 additions & 15 deletions .github/workflows/pr-laravel-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ jobs:
strategy:
fail-fast: false
matrix:
lando-version:
- 3-dev-slim
os:
- ubuntu-22.04
node-version:
- '18'
leia-test:
- examples/7.1
- examples/7.2
- examples/7.4
- examples/8.1
- examples/8.1-mysql8
lando-version:
- 3-dev
os:
- ubuntu-22.04
node-version:
- '16'
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -31,21 +31,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/laravel=/home/runner/work/laravel/laravel
setup.skipCommonPlugins=true
setup.plugins.@lando/laravel=/home/runner/work/laravel/laravel
telemetry: false
- name: Verify Lando works and we are dogfooding this plugin for tests
run: |
lando --clear
lando version
lando config --path plugins | grep laravel | grep /home/runner/work/laravel/laravel || (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-laravel-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/laravel/releases/tag/v1.0.0)
* Dialed fully for `lando update`

## v0.9.0 - [July 3, 2023](https://github.com/lando/laravel/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/laravel-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: 'laravel-mariadb',
parent: '_service',
builder: (parent, config) => class LaravelMariadb extends LandoMariadb.builder(parent, LandoMariadb.config) {
constructor(id, options = {}) {
super(id, options, {services: _.set({}, options.name)});
};
},
};
15 changes: 15 additions & 0 deletions builders/laravel-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: 'laravel-mysql',
parent: '_service',
builder: (parent, config) => class LaravelMysql extends LandoMysql.builder(parent, LandoMysql.config) {
constructor(id, options = {}) {
super(id, options, {services: _.set({}, options.name)});
};
},
};
18 changes: 18 additions & 0 deletions builders/laravel-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: 'laravel-nginx',
parent: '_webserver',
config: {
version: '1.25',
},
builder: (parent, config) => class LaravelNginx 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/laravel-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: 'laravel-php',
parent: '_appserver',
builder: (parent, config) => class LaravelPhp extends LandoPhp.builder(parent, LandoPhp.config) {
constructor(id, options = {}, factory) {
loadScripts(options);
options.nginxServiceType = 'laravel-nginx';
super(id, options, factory);
};
},
};
15 changes: 15 additions & 0 deletions builders/laravel-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: 'laravel-postgres',
parent: '_service',
builder: (parent, config) => class LaravelPostgres extends LandoPostgres.builder(parent, LandoPostgres.config) {
constructor(id, options = {}) {
super(id, options, {services: _.set({}, options.name)});
};
},
};
15 changes: 15 additions & 0 deletions builders/laravel-redis.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use strict';

const _ = require('lodash');
const LandoRedis = require('@lando/redis/builders/redis.js');

// Builder
module.exports = {
name: 'laravel-redis',
parent: '_service',
builder: (parent, config) => class LaravelRedis extends LandoRedis.builder(parent, LandoRedis.config) {
constructor(id, options = {}) {
super(id, options, {services: _.set({}, options.name)});
};
},
};
Loading
Loading