-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:lando/core into 67-windows-dc2
- Loading branch information
Showing
21 changed files
with
389 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
github |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
Lando Init GitHub Source Example | ||
================================ | ||
|
||
This example exists primarily to test the following documentation: | ||
|
||
* [Lando Init with GitHub Source](https://docs.lando.dev/cli/init.html#github) | ||
|
||
Start up tests | ||
-------------- | ||
|
||
Run the following commands to get up and running with this example. | ||
|
||
```bash | ||
# Should clone code down from GitHub | ||
mkdir -p github && cd github | ||
lando init --source github --recipe none --github-auth="$GITHUB_PAT" --github-repo="[email protected]:lando/lando.git" --github-key-name="$GITHUB_SHA" --yes | ||
``` | ||
|
||
Verification commands | ||
--------------------- | ||
|
||
Run the following commands to verify things work as expected | ||
|
||
```bash | ||
# Should have a landofile in the approot | ||
cd github && cat .lando.yml | ||
``` | ||
|
||
Destroy tests | ||
------------- | ||
|
||
```bash | ||
# Should remove key | ||
docker run --rm -v "$(pwd)":/data -w /data badouralix/curl-jq:alpine sh -c "/data/remove-key.sh $GITHUB_PAT $GITHUB_SHA" | ||
|
||
# Should remove initialized code | ||
rm -rf github | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
TOKEN="$1" | ||
TITLE="$2" | ||
|
||
ID=$(curl -L \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "Authorization: Bearer ${TOKEN}" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
https://api.github.com/user/keys | jq -r --arg TITLE "$TITLE" '.[] | select(.title == $TITLE).id') | ||
|
||
|
||
# TRY TO REMOVE KEY | ||
echo "Trying to remove key $KEYID"... | ||
curl -L \ | ||
-X DELETE \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "Authorization: Bearer ${TOKEN}" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
"https://api.github.com/user/keys/${ID}" | ||
|
||
echo "REMOVED!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
git | ||
tar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
Lando Init Remote Source Example | ||
================================ | ||
|
||
This example exists primarily to test the following documentation: | ||
|
||
* [Lando Init with Remote Source](https://docs.lando.dev/cli/init.html#remote-git-repo-or-archive) | ||
|
||
Start up tests | ||
-------------- | ||
|
||
Run the following commands to get up and running with this example. | ||
|
||
```bash | ||
# Should clone code down from a remote git repo | ||
mkdir -p git && cd git | ||
lando init --source remote --recipe none --remote-url="[email protected]:lando/lando.git" --yes | ||
|
||
# Should extract code from a remote tar file | ||
mkdir -p tar && cd tar | ||
lando init --source remote --recipe none --remote-url="https://github.com/lando/lando/archive/refs/tags/v3.20.2.tar.gz" --remote-options="--strip-components=1" --yes | ||
``` | ||
|
||
Verification commands | ||
--------------------- | ||
|
||
Run the following commands to verify things work as expected | ||
|
||
```bash | ||
# Should have a landofile in the approot of the git clone | ||
cd git && cat .lando.yml | ||
|
||
# Should have a landofile in the approot of thee extracted tar | ||
cd tar && cat .lando.yml | ||
``` | ||
|
||
Destroy tests | ||
------------- | ||
|
||
```bash | ||
# Should remove initialized code | ||
rm -rf git | ||
rm -rf tar | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ const autoLoaders = [ | |
'app.js', | ||
'builders', | ||
'compose', | ||
'inits', | ||
'methods', | ||
'scripts', | ||
'services', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
'use strict'; | ||
|
||
const {nanoid} = require('nanoid'); | ||
|
||
/* | ||
* Init Lamp | ||
*/ | ||
module.exports = { | ||
name: 'none', | ||
overrides: { | ||
name: { | ||
when: answers => { | ||
answers.name = nanoid(); | ||
return false; | ||
}, | ||
}, | ||
webroot: {when: () => false}, | ||
}, | ||
build: () => false, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# user info | ||
user="${1:-$LANDO_WEBROOT_USER}" | ||
id="${2:-$LANDO_HOST_UID}" | ||
|
||
# retry settings | ||
attempt=0 | ||
delay=1 | ||
retry=5 | ||
|
||
until [ "$attempt" -ge "$retry" ] | ||
do | ||
id "$user"| grep uid | grep "$id" &>/dev/null && break | ||
attempt=$((attempt+1)) | ||
sleep "$delay" | ||
done |
Oops, something went wrong.