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

flos_core Test run #5

Open
wants to merge 31 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
3097f6f
fix(compose): Fix compose file path resolution as it is copied into the
florianPat Nov 1, 2024
8cacc5f
refactor(compose): Fix to use the configured compose seperator in all
florianPat Nov 1, 2024
54ed5bf
chore(pipelines): Be able to run github actions
florianPat Sep 26, 2024
bb645a6
fix(app.mounts): Use configured appMount of service and not always /a…
florianPat Oct 2, 2024
94e43a3
refactor(home-dir): Add a config option to just share the ssh directo…
florianPat Nov 1, 2024
144c308
update(traefik): Update traefik and enable the dashboard as thats use…
florianPat Nov 1, 2024
c12a609
fix(perm-helpers): Fix permission setup so that it also works for alpine
florianPat Dec 29, 2024
12261a6
fix(tooling): Check that container setup is finished at container sta…
florianPat Sep 9, 2024
1b37b9f
fix(events): Make sure the perm-sweep is run for docker-compose services
florianPat Nov 16, 2024
2d77c7b
feat(exec): Exec can also run if the app is not yet started and add n…
florianPat Oct 19, 2024
f7dba84
feat(volumes): Use the lando proxy dir as the config volume and there…
florianPat Sep 9, 2024
7b8da64
fix(docker): Docker in bitbucket pipelines has another error message, so
florianPat Jan 2, 2025
4873b47
feat(bootstrap): Add new bootstrap event and special '_init' service …
florianPat Oct 19, 2024
f582520
feat(_init-for-tooling): Add special _init service for tooling commands
florianPat Oct 20, 2024
9471b6c
feat(init): Remove init compose after execution
florianPat Oct 19, 2024
05703f4
feat(core): Add core loading also from config
florianPat Nov 7, 2024
9d79347
feat(core-plugin): Be able to overwrite @lando/core with other
florianPat Nov 6, 2024
a202437
fix(update): Make sure to not update the cli beyond the core
florianPat Nov 15, 2024
f47cfd9
fix(config): Fix reloading of lando config after setup as binary config
florianPat Jan 3, 2025
85bbe74
feat(events): Add special `lando` service for events to run tooling
florianPat Jan 5, 2025
8e82479
feat(project-name): Do not docker-composify the project name
florianPat Jan 6, 2025
fdf2e55
fix(lando-entrypoint): Due to script mounting changes the fallback of
florianPat Jan 19, 2025
e1d9d41
fix(separator): Fix separator
florianPat Feb 18, 2025
5804280
feat(bootstrap): Add bootstrap event handling and fix lando is not ye…
florianPat Feb 18, 2025
55321b1
feat(env-file): Add compose_env_file option to the .lando.yml
florianPat Feb 24, 2025
2c4e259
feat(docker-bin): Use which docker to find the docker binary
florianPat Mar 4, 2025
f128b37
fix(exec): Fix exec services
florianPat Mar 4, 2025
432edde
feat(cli): Add lando_cli env var as a yargs configuration
florianPat Mar 4, 2025
e70297b
fix(compose-cache): Just set the compose cache after the app was
florianPat Mar 4, 2025
20f4333
chore(deployment): Package publishing
florianPat Nov 6, 2024
b3f7866
fix(tests): Fixing tests
florianPat Mar 5, 2025
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
9 changes: 5 additions & 4 deletions .github/workflows/build-util-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: Build Utility Images
on:
# Uncomment below for testing purposes
pull_request:
push:
branches:
- main
#push:
# branches:
# - main

jobs:
buildx:
Expand Down Expand Up @@ -38,6 +38,7 @@ jobs:
run: echo "tag-suffix=-edge" >> $GITHUB_OUTPUT
- name: Login to DockerHub
uses: docker/login-action@v2
if: ${{ github.event_name != 'pull_request' }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand All @@ -47,7 +48,7 @@ jobs:
context: ${{ matrix.context }}
file: ${{ matrix.dockerfile }}
platforms: linux/amd64,linux/arm64
push: true
push: ${{ github.event_name != 'pull_request' }}
tags: devwithlando/${{ matrix.image }}:${{ matrix.tag }}${{ steps.pr.outputs.tag-suffix }}
cache-from: type=gha
cache-to: type=gha,mode=max
5 changes: 1 addition & 4 deletions .github/workflows/dev-release.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
name: Create Dev Releases

on:
push:
branches:
- main
- 'preview-**'
workflow_call:

jobs:
package:
Expand Down
251 changes: 46 additions & 205 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,214 +6,55 @@ on:
- created

jobs:
package:
uses: ./.github/workflows/pkg-binary.yml
strategy:
fail-fast: false
matrix:
arch:
- x64
- arm64
os:
- linux
- macos
- win
fatcore:
- false
- true
with:
arch: ${{ matrix.arch }}
edge: ${{ github.event.release.prerelease }}
fatcore: ${{ matrix.fatcore }}
filename: lando-${{ matrix.os }}-${{ matrix.arch }}-${{ github.ref_name }}${{ matrix.fatcore == false && '-slim' || '' }}
node-version: "20"
os: ${{ matrix.os }}
version: ${{ github.event.release.tag_name }}

sign:
uses: ./.github/workflows/sign-binary.yml
needs:
- package
strategy:
fail-fast: false
matrix:
file:
- lando-linux-arm64-${{ github.ref_name }}
- lando-macos-arm64-${{ github.ref_name }}
- lando-win-arm64-${{ github.ref_name }}

- lando-linux-x64-${{ github.ref_name }}
- lando-macos-x64-${{ github.ref_name }}
- lando-win-x64-${{ github.ref_name }}

- lando-linux-arm64-${{ github.ref_name }}-slim
- lando-macos-arm64-${{ github.ref_name }}-slim
- lando-win-arm64-${{ github.ref_name }}-slim

- lando-linux-x64-${{ github.ref_name }}-slim
- lando-macos-x64-${{ github.ref_name }}-slim
- lando-win-x64-${{ github.ref_name }}-slim
with:
download-pattern: packaged-lando-*
file: ${{ matrix.file }}
secrets:
apple-notary-user: ${{ secrets.APPLE_NOTARY_USER }}
apple-notary-password: ${{ secrets.APPLE_NOTARY_PASSWORD }}
certificate-data: ${{ contains(matrix.file, 'macos') && secrets.APPLE_CERT_DATA || secrets.KEYLOCKER_CLIENT_CERT }}
certificate-password: ${{ contains(matrix.file, 'macos') && secrets.APPLE_CERT_PASSWORD || secrets.KEYLOCKER_CLIENT_CERT_PASSWORD }}
keylocker-api-key: ${{ secrets.KEYLOCKER_API_KEY }}
keylocker-cert-sha1-hash: ${{ secrets.KEYLOCKER_CERT_SHA1_HASH }}
keylocker-keypair-alias: ${{ secrets.KEYLOCKER_KEYPAIR_ALIAS }}

build-release-binary-alias:
uses: ./.github/workflows/release-rename-binary.yml
needs:
- sign
strategy:
fail-fast: false
matrix:
arch:
- x64
- arm64
os:
- linux
- macos
- win
type:
- -slim
-
alias: ${{ github.event.release.prerelease == true && fromJson('["edge"]') || fromJson('["stable", "edge"]') }}

with:
source: lando-${{ matrix.os }}-${{ matrix.arch }}-${{ github.ref_name }}${{ matrix.type }}
destination: lando-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.alias }}${{ matrix.type }}
download-pattern: signed-lando-*
build-release-binary-tag:
uses: ./.github/workflows/release-rename-binary.yml
needs:
- sign
bump-and-npm:
runs-on: ${{ matrix.os }}
env:
TERM: xterm
strategy:
fail-fast: false
matrix:
arch:
- x64
- arm64
os:
- linux
- macos
- win
type:
- -slim
-
with:
source: lando-${{ matrix.os }}-${{ matrix.arch }}-${{ github.ref_name }}${{ matrix.type }}
destination: lando-${{ matrix.os }}-${{ matrix.arch }}-${{ github.ref_name }}${{ matrix.type }}
download-pattern: signed-lando-*

checksum:
uses: ./.github/workflows/generate-checksums.yml
needs:
- build-release-binary-alias
- build-release-binary-tag
with:
download-pattern: release-*-${{ github.ref_name }}*
flatten: true
show: true
upload-name: release-checksums-${{ github.ref_name }}
checksum-s3-aliases:
uses: ./.github/workflows/generate-checksums.yml
strategy:
fail-fast: false
matrix:
alias:
- edge
- ${{ github.event.release.prerelease == false && 'stable' || 'prerelease' }}
- ${{ github.ref_name }}
needs:
- build-release-binary-alias
- build-release-binary-tag
with:
download-pattern: release-*-${{ github.ref_name }}*
output: sha256sum-${{ matrix.alias }}.txt
flatten: true
show: true
upload-name: release-checksums${{ matrix.alias }}

deploy-releases-s3:
uses: ./.github/workflows/deploy-s3.yml
needs:
- checksum
- checksum-s3-aliases
with:
download-pattern: release-*
secrets:
aws-secret-access-key: ${{ secrets.S3_SECRET_ACCESS_KEY }}
aws-access-key-id: ${{ secrets.S3_ACCESS_KEY_ID }}
aws-region: us-east-1
deploy-releases-artifacts:
uses: ./.github/workflows/deploy-artifacts.yml
needs:
- checksum
with:
download-pattern: release-*
deploy-releases-releases:
uses: ./.github/workflows/deploy-releases.yml
needs:
- checksum
with:
download-pattern: release-*-${{ github.ref_name }}*
deploy-npm:
uses: ./.github/workflows/deploy-npm.yml
needs:
- checksum
secrets:
github-token: ${{ secrets.RTFM47_COAXIUM_INJECTOR }}
npm-token: ${{ secrets.NPM_DEPLOY_TOKEN }}
deploy-legacy-notifications:
runs-on: ubuntu-24.04
needs:
- checksum
env:
TERM: xterm
- ubuntu-24.04
node-version:
- '20'
steps:
- name: Push release to lando/lando
uses: softprops/action-gh-release@v2
- name: Checkout code
uses: actions/checkout@v4
- name: Install node ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
repository: lando/lando
name: ${{ github.event.release.tag_name }}
draft: ${{ github.event.release.draft }}
prerelease: ${{ github.event.release.prerelease }}
tag_name: ${{ github.event.release.tag_name }}
token: ${{ secrets.RTFM47_COAXIUM_INJECTOR }}
body: |
**Starting with v3.21.0-beta.18, Lando is no longer distributed via package installers in here in this releases page!**

To install Lando please visit the [official install docs](https://docs.lando.dev/install).

## Changelogs

Lando now runs as a distributed plugin-based ecosystem so you will want to check the releases/changelogs in
the various [plugins](https://docs.lando.dev/plugins.html) for relevant notes.

[Click Here](https://github.com/lando/core/releases/tag/${{ github.event.release.tag_name }}) to check out the notes for `@lando/core@${{ github.event.release.tag_name }}`.

## Notes

* We will continue to push releases here for backwards compatibility, posterity, etc
* [Extended release notes](https://lando.dev/blog/2024/01/16/v321-extended.html)

- name: Push release to lando/cli
uses: softprops/action-gh-release@v2
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org
cache: npm
- name: Install dependencies
run: npm clean-install --prefer-offline --frozen-lockfile
- name: Lint code
run: npm run lint
- name: Run unit tests
run: npm run test:unit
- name: Prepare Release
uses: lando/prepare-release-action@v3
with:
repository: lando/legacy-cli
name: ${{ github.event.release.tag_name }}
draft: ${{ github.event.release.draft }}
prerelease: ${{ github.event.release.prerelease }}
tag_name: ${{ github.event.release.tag_name }}
token: ${{ secrets.RTFM47_COAXIUM_INJECTOR }}
body: |
**Starting with v3.23.0, Lando CLI binaries are no longer distributed here in these releases!**

They are now available in the `@lando/core` [releases page](https://github.com/lando/core/releases) including [this ${{ github.event.release.tag_name }} release](https://github.com/lando/core/releases/tag/${{ github.event.release.tag_name }}).

All that said we don't recommned you use these binaries directly. Instead, to install Lando please visit the [official install docs](https://docs.lando.dev/install).
lando-plugin: true
sync: false
- name: Publish to npm
run: |
VERSION=$(node -p "require('./package.json').version")
PACKAGE=$(node -p "require('./package.json').name")

if [ "${{ github.event.release.prerelease }}" == "false" ]; then
npm publish --access public --dry-run
npm publish --access public
npm dist-tag add "$PACKAGE@$VERSION" edge

echo "::notice title=Published $VERSION to $PACKAGE::This is a stable release published to the default 'latest' npm tag"
echo "::notice title=Updated latest tag to $VERSION::The stable tag now points to $VERSION"
echo "::notice title=Updated edge tag to $VERSION::The edge tag now points to $VERSION"
else
npm publish --access public --tag edge --dry-run
npm publish --access public --tag edge

echo "::notice title=Published $VERSION to $PACKAGE::This is a prerelease published to the 'edge' npm tag"
echo "::notice title=Updated edge tag to $VERSION::The edge tag now points to $VERSION"
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_DEPLOY_TOKEN }}
50 changes: 3 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,5 @@
# Lando Core
# Flos Lando Core

These are the core libraries that power Lando. They are implemented in [`@lando/cli`] and things like [Pantheon LocalDev](https://pantheon.io/product/localdev) and [WordPress VIP CLI](https://github.com/Automattic/vip-cli/blob/develop/package.json).
These are the core libraries that power flos version of Lando with seamless compose integration.

On a high level they serve as:

**An abstraction layer** Lando vastly reduces the complexity of spinning up containers by exposing only the most relevant config for a given "service" and setting "sane defaults". Lando also provides "recipes" which are common combinations of services and their tooling that satisfy a given development use case - e.g. Drupal, Python, Laravel, Dotnet, etc.

**A superset** Lando provides ways for developers to run complex commands, build steps and automation on their services without the hassle of custom Dockerfiles or long "docker exec" commands. Think `lando yarn add express`. Think clear my applications cache after I import a database. Think install this core-extension before my appserver starts and then `composer install` after it does.

**A utility** Lando handles some of the more arduous configuration required for a good Docker Compose setup - e.g. proxying, nice urls, cross-application networking (think Vue.js frontend talking to a separate Laravel backend), host-container file permission handling, file sharing, per-container SSL certificate handling, ssh-key handling, etc.

## Basic Usage

```js
const Lando = require('@lando/core');
const lando = new Lando(config);

// bootstrap and go
return lando.bootstrap(bsLevel).then(lando => {
lando.getApp().init().then(() => cli.run(getTasks(config, cli.argv()), config));
});
const
```

For more info you should check out the [docs](https://docs.lando.dev/core/v3):

## Issues, Questions and Support

If you have a question or would like some community support we recommend you [join us on Slack](https://launchpass.com/devwithlando).

If you'd like to report a bug or submit a feature request then please [use the issue queue](https://github.com/lando/core/issues/new/choose) in this repo.

## Changelog

We try to log all changes big and small in both [THE CHANGELOG](https://github.com/lando/core/blob/main/CHANGELOG.md) and the [release notes](https://github.com/lando/core/releases).

## Contributors

<a href="https://github.com/lando/core/graphs/contributors">
<img src="https://contrib.rocks/image?repo=lando/cli" />
</a>

Made with [contributors-img](https://contrib.rocks).`

## Other Selected Resources

* [LICENSE](https://github.com/lando/core/blob/main/LICENSE.md)
* [The best professional advice ever](https://www.youtube.com/watch?v=tkBVDh7my9Q)
Thanks to the upstream [lando-core](https://github.com/lando/core)!
7 changes: 5 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ module.exports = async (app, lando) => {
// Add tooling if applicable
app.events.on('post-init', async () => await require('./hooks/app-add-tooling')(app, lando));

// Add _init tooling for bootstrap reference
app.events.on('pre-bootstrap', async () => await require('./hooks/app-add-init-tooling')(app, lando));

// Collect info so we can inject LANDO_INFO
// @NOTE: this is not currently the full lando info because a lot of it requires the app to be on
app.events.on('post-init', 10, async () => await require('./hooks/app-set-lando-info')(app, lando));
Expand All @@ -128,7 +131,7 @@ module.exports = async (app, lando) => {
app.events.on('ready', 1, async () => await require('./hooks/app-override-tooling-defaults')(app, lando));

// set tooling compose cache
app.events.on('ready', async () => await require('./hooks/app-set-compose-cache')(app, lando));
app.events.on('ready-engine', async () => await require('./hooks/app-set-compose-cache')(app, lando));

// v4 parts of the app are ready
app.events.on('ready', 6, async () => await require('./hooks/app-v4-ready')(app, lando));
Expand All @@ -141,7 +144,7 @@ module.exports = async (app, lando) => {

// Save a compose cache every time the app is ready, we have to duplicate this for v4 because we modify the
// composeData after the v3 app.ready event
app.events.on('ready-v4', async () => await require('./hooks/app-set-v4-compose-cache')(app, lando));
app.events.on('ready-engine', async () => await require('./hooks/app-set-v4-compose-cache')(app, lando));

// Otherwise set on rebuilds
// NOTE: We set this pre-rebuild because post-rebuild runs after post-start because you would need to
Expand Down
4 changes: 4 additions & 0 deletions bin/lando
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ const cores = [
path.resolve(__dirname, '..'),
];

if (typeof _.get(config, 'plugins.@lando/core') === 'string') {
cores.unshift(path.resolve(appConfig.root, config.plugins['@lando/core']));
}

// if appConfig points to a different core lets set that here
if (typeof _.get(appConfig, 'plugins.@lando/core') === 'string') {
cores.unshift(path.resolve(appConfig.root, appConfig.plugins['@lando/core']));
Expand Down
Loading
Loading