appsody / appsody

Appsody command line tool. This repo will be archived soon.
https://appsody.dev
170 stars 46 forks source link

Add new CLI command which will add a stack to an index file #524

Closed groeges closed 4 years ago

groeges commented 4 years ago

Is your feature request related to a problem? Please describe. appsody stack package command is being used to generate a full release build using the CI scripts. The release version of the index.yaml file needs to have the full http:// URLs rather than the file:/// URLs that appsody stack package currently places in the dev-local-index.yaml.

Describe the solution you'd like Rather than change the user experience of the appsody stack package command it is suggested we have a new command in the CLI, appsody stack add-to-repo` which will add the stack info into a release version of the index.yaml file and use the full http:// URLs we need.

The command would be appsody add-to-repo <name> --release-url <http://github.com/.....>

The <name> is a positional argument because it is required. This will refer to a repo name from appsody repo list. The flag --release-url will be optional.

A clear and concise description of what you want to happen

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

groeges commented 4 years ago

@kylegc @neeraj-laad Still not certain that the command should be appsody add-to-repo <name> As this is now a completely separate command which is adding the stack information to an index, why does it need to refer to a repo-name that is in the appsody repo list.

If this index was to be used later to create stacks (using appsody init) and test them then I can see that this needs to be added to the appsody repo list but this could be done lat a later stage.

There doesn't seem to be a need for the index that is being generated to be in the appsody repo list, especially for when we are generating a new index, eg for kabanero and for the index that is to be used with the nginx image.

Think we need to discuss this a bit more.

neeraj-laad commented 4 years ago

I just want to make sure this additional command has a clear purpose.. and see if that can be something that end-users can use at some point too vs a command that is only for CI.

Could this be a command that the stack creators use to create an index that they can share with their team? appsody stack <<cmd>> --index <index-name> --url <release-url>, where the <> can be something like share, publish or create-index

The command will create (or update) the index with the specified name.. Updating the entry for the current stack and use the release url. Users can then share this index in whichever way they want - publish on GitHub release, upload to artifactory, or send it to them in a different way.

groeges commented 4 years ago

Following several discussion the new command syntax will be:

appsody stack add-to-repo <repo-name> --release-url <https://prefix/to/tar/download> --use-local-cache

and the execution flow will be:

if reponame exists (in appsody repo list)
    if reponame points to remote url
        if local file ~/.appsody/stacks/dev.local/reponame-index.yaml exists AND --use-local-cache
            update the local file - does not upload so appsody commands cannot use it yet
        else
            download remote index and update it locally - overwrites file if exists - does not upload so appsody commands cannot use it yet
    else reponame points to local file
        update the local file in place so appsody commands can start using the stack immediately
else reponame doesn't exist
    if local file ~/.appsody/stacks/dev.local/reponame-index.yaml exists AND --use-local-cache
        update the local file
    else
        create a new local index ~/.appsody/stacks/dev.local/reponame-index.yaml - overwrites file if it exists
    add to repo list?? this could be another optional flag
neeraj-laad commented 4 years ago

implemented and released