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

Uploaded newversion file #11

Closed
wants to merge 7 commits into from
Closed

Conversation

powerexploit
Copy link

@phracek
Copy link
Member

phracek commented Mar 30, 2020

First of all, you have to add here a new command newversion https://github.com/sclorg/container-workflow-tool/blob/master/container_workflow_tool/constants.py#L38

action_map['newversion'] = {
'add': 'add_new_version',
'show': 'show_changes',
}

And here create a new python file called newversion.py https://github.com/sclorg/container-workflow-tool/tree/master/container_workflow_tool

The newversion.py should be similar to:

import os
import shutil

from git import Repo
from git.exc import GitCommandError

class NewVersion(object):

In to the file https://github.com/sclorg/container-workflow-tool/blob/master/container_workflow_tool/cli.py#L28 , you have to add a function like

    def newversion_usage(self):
        return CliCommon.newversion_usage(self) % (self.prg_name, "")

and the newversion_usage itself will be defined here:
https://github.com/sclorg/container-workflow-tool/blob/master/container_workflow_tool/cli_common.py#L88

Similar to git_usage.

@powerexploit powerexploit changed the title Created newversion file Updated newversion file Apr 10, 2020
@powerexploit powerexploit changed the title Updated newversion file Uploaded newversion file Apr 10, 2020
Copy link
Member

@phracek phracek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use proper indent spacing, which is important in python language.

I will test your code soon.

Copy link
Member

@phracek phracek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have run your code and it needs to be better formated. You have Indention Errors.

Also newversion command does not exist because of in constants.py is missing dictionary.

See my comments.

container_workflow_tool/newversion.py Outdated Show resolved Hide resolved
container_workflow_tool/newversion.py Outdated Show resolved Hide resolved
@@ -36,4 +36,9 @@
actions['dockerhub'] = ['updatefulldescription', ]
actions['utils'] = ['showconfig', 'listimages', 'listupstream', ]

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actions['newversion'] is missing here.

Copy link
Author

@powerexploit powerexploit May 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I need some instructions to add commands for newversion.
for #11 .
79c30bf

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Take inspiration from the other cwt subcommands like git. This is a part of your job ;)

@phracek
Copy link
Member

phracek commented Jun 1, 2021

Closing this pull request. We will not implement it for now.

@phracek phracek closed this Jun 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants