Skip to content

Commit

Permalink
Merge branch 'main' of github.com:lando/core into m32323
Browse files Browse the repository at this point in the history
  • Loading branch information
pirog committed Jan 14, 2025
2 parents 76c2446 + 5c88ea6 commit 6900e55
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 7 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }})

* Merged in improvements from `@lando/[email protected]`

## v3.24.0-beta.8 - [December 14, 2024](https://github.com/lando/core/releases/tag/v3.24.0-beta.8)

* Merged in improvements from `@lando/[email protected]`
Expand Down Expand Up @@ -30,6 +32,10 @@
* Fixed bug causing auto setup to not correctly reset the orchestrator binary path
* Improved `lando init` so that it can auto setup if needed

## v3.23.23 - [January 14, 2025](https://github.com/lando/core/releases/tag/v3.23.23)

* Fixed bug causing service script loading collisions

## v3.23.22 - [December 17, 2024](https://github.com/lando/core/releases/tag/v3.23.22)

* Added ability to customize `networkLimit` [#245](https://github.com/lando/core/pull/245)
Expand Down
23 changes: 17 additions & 6 deletions builders/_lando.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ module.exports = {
refreshCerts = false,
remoteFiles = {},
scripts = [],
scriptsDir = '',
sport = '443',
ssl = false,
sslExpose = true,
Expand All @@ -70,16 +71,23 @@ module.exports = {
console.error(color.yellow(`${type} version ${version} is a legacy version! We recommend upgrading.`));
}

// normalize scripts dir if needed
if (!path.isAbsolute(scriptsDir)) scriptsDir = path.resolve(root, scriptsDir);

// Get some basic locations
const globalScriptsDir = path.join(userConfRoot, 'scripts');
const serviceScriptsDir = path.join(userConfRoot, 'helpers', project, type, name);
const entrypointScript = path.join(globalScriptsDir, 'lando-entrypoint.sh');
const addCertsScript = path.join(globalScriptsDir, 'add-cert.sh');
const refreshCertsScript = path.join(globalScriptsDir, 'refresh-certs.sh');

// Move our config into the userconfroot if we have some
// NOTE: we need to do this because on macOS and Windows not all host files
// are shared into the docker vm
if (fs.existsSync(confSrc)) require('../utils/move-config')(confSrc, confDest);

// Get some basic locations
const scriptsDir = path.join(userConfRoot, 'scripts');
const entrypointScript = path.join(scriptsDir, 'lando-entrypoint.sh');
const addCertsScript = path.join(scriptsDir, 'add-cert.sh');
const refreshCertsScript = path.join(scriptsDir, 'refresh-certs.sh');
// ditto for service helpers
if (fs.existsSync(scriptsDir)) require('../utils/move-config')(scriptsDir, serviceScriptsDir);

// Handle Environment
const environment = {
Expand All @@ -98,11 +106,14 @@ module.exports = {
// Handle volumes
const volumes = [
`${userConfRoot}:/lando:cached`,
`${scriptsDir}:/helpers`,
`${globalScriptsDir}:/helpers`,
`${entrypointScript}:/lando-entrypoint.sh`,
`${dataHome}:/var/www`,
];

// add in service helpers if we have them
if (fs.existsSync(serviceScriptsDir)) volumes.push(`${serviceScriptsDir}:/etc/lando/service/helpers`);

// Handle ssl
if (ssl) {
// also expose the sport
Expand Down
4 changes: 4 additions & 0 deletions examples/networking/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ cp -rf index.php lemp/index.php
cp -rf nginx.conf lemp/nginx.conf
cp -rf .lando.lemp.yml lemp/.lando.yml
cd lemp && lando start

# Should copy .config.yml to ~/.lando/config.yml
cp config.yml ~/.lando/config.yml
lando --clear
```

## Verification commands
Expand Down
14 changes: 14 additions & 0 deletions examples/tooling/.lando.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ services:
api: 3
type: lando
meUser: node
scriptsDir: scripts
services:
image: node:16
command: docker-entrypoint.sh tail -f /dev/null
Expand Down Expand Up @@ -311,6 +312,19 @@ tooling:
arg2:
describe: Uses arg2
type: string
sdargs:
cmd: /etc/lando/service/helpers/args.sh
service: node
positionals:
arg1:
describe: Uses arg1
type: string
choices:
- thing
- stuff
arg2:
describe: Uses arg2
type: string

plugins:
"@lando/core": ../..
4 changes: 4 additions & 0 deletions examples/tooling/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@ lando everything --help | grep "lando everything \[arg1\] \[arg2\] MORETHINGS"
# Should allow for example pasthru in task definition
lando everything --help | grep "lando this is just for testing"

# Should be able to access scriptsDir from the landofile
lando exec node -- stat /etc/lando/service/helpers/args.sh
lando sdargs hello there | grep "hello there"

# Should be able to run even if options are empty
lando emptyopter

Expand Down
3 changes: 3 additions & 0 deletions examples/tooling/scripts/args.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

echo "$1 $2"
1 change: 1 addition & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"https://docs.google.com/document",
"https://docs.google.com/forms",
"https://github.com",
"https://www.drupal.org/community/events",
"/v/"
]
skipPatterns = [
Expand Down
2 changes: 1 addition & 1 deletion release-aliases/3-STABLE
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v3.23.22
v3.23.23
1 change: 1 addition & 0 deletions utils/get-config-defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const defaultConfig = options => ({
home: os.homedir(),
isArmed: _.includes(['arm64', 'aarch64'], process.arch),
logLevel: 'debug',
networkLimit: 32,
node: process.version,
os: {
type: os.type(),
Expand Down

0 comments on commit 6900e55

Please sign in to comment.