Skip to content

Commit

Permalink
#257: attempt ipv4first option in CLI to resolve some plugin-add issues
Browse files Browse the repository at this point in the history
  • Loading branch information
pirog committed Apr 5, 2024
1 parent 446b9e3 commit 7c21f3d
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/dev-release-slim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,13 @@ jobs:
entrypoint: bin/lando
node-version: ${{ matrix.node-version }}
os: ${{ matrix.os }}
options: --options dns-result-order=ipv4first
- name: Ensure slimcore
if: matrix.os == 'linux' && runner.os == 'Linux' && runner.arch == 'X64'
run: ./dist/@lando/cli config --path fatcore | grep false
- name: Ensure ipv4first
if: matrix.os == 'linux' && runner.os == 'Linux' && runner.arch == 'X64'
run: ./dist/@lando/cli config --path cli.args | grep dns-result-order=ipv4first

sign-n-deploy:
runs-on: ${{ matrix.os }}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/dev-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,13 @@ jobs:
entrypoint: bin/lando
node-version: ${{ matrix.node-version }}
os: ${{ matrix.os }}
options: --options dns-result-order=ipv4first
- name: Ensure fatcore
if: matrix.os == 'linux' && runner.os == 'Linux' && runner.arch == 'X64'
run: ./dist/@lando/cli config --path fatcore | grep true
- name: Ensure ipv4first
if: matrix.os == 'linux' && runner.os == 'Linux' && runner.arch == 'X64'
run: ./dist/@lando/cli config --path cli.args | grep dns-result-order=ipv4first

sign-n-deploy:
runs-on: ${{ matrix.os }}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/pr-release-tests-slim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,13 @@ jobs:
entrypoint: bin/lando
node-version: ${{ matrix.node-version }}
os: ${{ matrix.os }}
options: --options dns-result-order=ipv4first
- name: Ensure slimcore
if: matrix.os == 'linux' && runner.os == 'Linux' && runner.arch == 'X64'
run: ./dist/@lando/cli config --path fatcore | grep false
- name: Ensure ipv4first
if: matrix.os == 'linux' && runner.os == 'Linux' && runner.arch == 'X64'
run: ./dist/@lando/cli config --path cli.args | grep dns-result-order=ipv4first

sign-n-deploy:
runs-on: ${{ matrix.os }}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/pr-release-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,13 @@ jobs:
entrypoint: bin/lando
node-version: ${{ matrix.node-version }}
os: ${{ matrix.os }}
options: --options dns-result-order=ipv4first
- name: Ensure fatcore
if: matrix.os == 'linux' && runner.os == 'Linux' && runner.arch == 'X64'
run: ./dist/@lando/cli config --path fatcore | grep true
- name: Ensure ipv4first
if: matrix.os == 'linux' && runner.os == 'Linux' && runner.arch == 'X64'
run: ./dist/@lando/cli config --path cli.args | grep dns-result-order=ipv4first

sign-n-deploy:
runs-on: ${{ matrix.os }}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/release-slim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,13 @@ jobs:
entrypoint: bin/lando
node-version: ${{ matrix.node-version }}
os: ${{ matrix.os }}
options: --options dns-result-order=ipv4first
- name: Ensure slimcore
if: matrix.os == 'linux' && runner.os == 'Linux' && runner.arch == 'X64'
run: ./dist/@lando/cli config --path fatcore | grep false
- name: Ensure ipv4first
if: matrix.os == 'linux' && runner.os == 'Linux' && runner.arch == 'X64'
run: ./dist/@lando/cli config --path cli.args | grep dns-result-order=ipv4first

sign-n-deploy:
runs-on: ${{ matrix.os }}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,13 @@ jobs:
entrypoint: bin/lando
node-version: ${{ matrix.node-version }}
os: ${{ matrix.os }}
options: --options dns-result-order=ipv4first
- name: Ensure fatcore
if: matrix.os == 'linux' && runner.os == 'Linux' && runner.arch == 'X64'
run: ./dist/@lando/cli config --path fatcore | grep true
- name: Ensure ipv4first
if: matrix.os == 'linux' && runner.os == 'Linux' && runner.arch == 'X64'
run: ./dist/@lando/cli config --path cli.args | grep dns-result-order=ipv4first

sign-n-deploy:
runs-on: ${{ matrix.os }}
Expand Down
2 changes: 1 addition & 1 deletion bin/lando
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env node
#!/usr/bin/env node --dns-result-order=ipv4first

/**
* Main CLI entrypoint that wraps @lando/core@3 or @lando/core@4
Expand Down
3 changes: 2 additions & 1 deletion lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,14 @@ module.exports = class Cli {
const installPath = path.join(this.userConfRoot, 'bin');

// if the cli is running from source (eg a git repo) or not
const args = process.execArgv;
const source = fs.existsSync(path.join(srcRoot, '.git', 'HEAD'));
const commit = source ? require('../utils/get-commit-hash')(srcRoot, {short: true}) : false;
const coreBase = this.coreBase === '@lando/core';
const slim = !fs.existsSync(path.resolve(__dirname, '..', 'FATCORE'));

// put it all together
const cli = {commit, coreBase, dev, entrypoint, file, installPath, packaged, plugin: srcRoot, slim, source};
const cli = {args, commit, coreBase, dev, entrypoint, file, installPath, packaged, plugin: srcRoot, slim, source};
this.debug('using cli config %o', cli);

const config = {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"all": true
},
"scripts": {
"pkg": "pkg -c package.json -t node18 bin/lando",
"pkg": "pkg --config package.json --targets node18 --options dns-result-order=ipv4first bin/lando",
"docs:dev": "vitepress dev docs",
"docs:build": "vitepress build docs",
"docs:preview": "vitepress preview docs",
Expand Down

0 comments on commit 7c21f3d

Please sign in to comment.