Skip to content

Commit

Permalink
Switch away from using git subrepo, to a simple embedded copy scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
ssorj committed Jan 5, 2024
1 parent 34257bb commit e22ace4
Show file tree
Hide file tree
Showing 30 changed files with 38 additions and 43 deletions.
10 changes: 10 additions & 0 deletions .plano.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,13 @@ def clean():
remove("README.html")
remove("htmlcov")
remove(".coverage")

@command
def update_plano():
"""
Update the embedded Plano repo
"""

make_dir("external")
remove("external/plano-main")
run("curl -sfL https://github.com/ssorj/plano/archive/main.tar.gz | tar -C external -xz", shell=True)
31 changes: 10 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,29 @@ use the [Skupper example template][template] as a starting point.

[template]: https://github.com/skupperproject/skupper-example-template

Make sure you have git-subrepo installed:
Add the Skewer code as a subdirectory in your example project:

dnf install git-subrepo

Add the Skewer code as a subrepo in your example project:

cd project-dir/
git subrepo clone https://github.com/skupperproject/skewer subrepos/skewer
cd <project-dir>/
mkdir external
curl -sfL https://github.com/skupperproject/skewer/archive/main.tar.gz | tar -C external -xz

Symlink the Skewer library into your `python` directory:

mkdir -p python
ln -s ../subrepos/skewer/python/skewer python/skewer
ln -s ../external/skewer-main/python/skewer python/skewer

Symlink the `plano` command into the root of your project. Symlink
the standard `config/.plano.py` as `.plano.py` in the root as well:

ln -s subrepos/skewer/plano
ln -s subrepos/skewer/config/.plano.py
ln -s external/skewer-main/plano
ln -s external/skewer-main/config/.plano.py

<!-- This sucks. GitHub Actions doesn't support workflow files as symlinks. -->

<!-- Symlink the standard GitHub Actions workflow file: -->

<!-- mkdir -p .github/workflows -->
<!-- ln -s ../../subrepos/skewer/config/.github/workflows/main.yaml .github/workflows/main.yaml -->
<!-- ln -s ../../external/skewer-main/config/.github/workflows/main.yaml .github/workflows/main.yaml -->

<!-- So I have a convenience for copying the latest version into place. -->

Expand Down Expand Up @@ -82,14 +79,15 @@ options:
-f FILE, --file FILE Load commands from FILE (default '.plano.py')

commands:
{generate,render,run,run-external,demo,test,update-workflow}
{generate,render,run,run-external,demo,test,update-workflow,update-skewer}
generate Generate README.md from the data in skewer.yaml
render Render README.html from the data in skewer.yaml
run Run the example steps using Minikube
run-external Run the example steps against external clusters
demo Run the example steps and pause before cleaning up
test Test README generation and run the steps on Minikube
update-workflow Update the GitHub Actions workflow file
update-skewer Update the embedded Skewer repo
~~~

## Updating a Skewer subrepo inside your example project
Expand All @@ -98,15 +96,6 @@ Use `git subrepo pull`:

git subrepo pull --force subrepos/skewer

Some older versions of git-subrepo won't complete a force pull. If
that happens, you can simply blow away your changes and get the latest
Skewer, using these commands:

git subrepo clean subrepos/skewer
git rm -rf subrepos/skewer/
git commit -am "Temporarily remove the previous version of Skewer"
git subrepo clone https://github.com/skupperproject/skewer subrepos/skewer

## Skewer YAML

The top level:
Expand Down
14 changes: 11 additions & 3 deletions config/.plano.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,16 @@ def update_workflow():
"""
Update the GitHub Actions workflow file
"""
copy("external/skewer-main/config/.github/workflows/main.yaml", ".github/workflows/main.yaml")

from_file = join("subrepos", "skewer", "config", ".github", "workflows", "main.yaml")
to_file = join(".github", "workflows", "main.yaml")
@command
def update_skewer():
"""
Update the embedded Skewer repo
"""
check_program("curl")

make_dir("external")
remove("external/skewer-main")

copy(from_file, to_file)
run("curl -sfL https://github.com/skupperproject/skewer/archive/main.tar.gz | tar -C external -xz", shell=True)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ def _run_curl(method, url, content=None, content_file=None, content_type=None, o
user=None, password=None):
check_program("curl")

args = ["curl", "-sf"]
args = ["curl", "-sfL"]

if method != "GET":
args.extend(["-X", method])
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion plano
2 changes: 1 addition & 1 deletion python/plano
12 changes: 0 additions & 12 deletions subrepos/plano/.gitrepo

This file was deleted.

2 changes: 1 addition & 1 deletion test-example/.plano.py
1 change: 1 addition & 0 deletions test-example/external/skewer-main
2 changes: 1 addition & 1 deletion test-example/plano
2 changes: 1 addition & 1 deletion test-example/python/skewer
1 change: 0 additions & 1 deletion test-example/subrepos/skewer

This file was deleted.

0 comments on commit e22ace4

Please sign in to comment.