Skip to content

Provide an easier way to create archive for pkg #769

Closed

Description

@life1347

It will be nice to provide additional flags to create archive when creating function/pkg.

Solution 1. Add new flags

--sourcearchive value, --src value     Local path or URL for source archive
--deployarchive value, --deploy value  Local path or URL for binary archive
--sourcedir value, --srcdir value     Local path for source directory
--deploydir value, --deploydir value     Local path for deploy directory

Solution 2. Change behavior of current flag, and retired some flag alias.

--src value     Local path to source directory/archive or URL for source archive
--deploy value  Local path to deployment directory/archive or URL for deployment archive

Activity

  1. erwinvaneyk commented on Jul 3, 2018

    @erwinvaneyk
    Member

    Agree fully with solving this issue. Though I am a bit worried that we degrade user experience if we keep adding parameters to the command.

    What about allowing users to simply input a directory for --src or --deploy, and let the CLI handle both cases based on whether the input is a file, glob or a directory?

  2. erwinvaneyk commented on Jul 3, 2018

    @erwinvaneyk
    Member

    --src hello.go => build single file
    --src hello.go --src world.go or --src *.go => build package from multiple files
    --src myFnDir/ => build package from directory

  3. life1347 commented on Jul 3, 2018

    @life1347
    MemberAuthor

    @erwinvaneyk Oh! You're absolutely right! In this way, we don't need to add more flags to CLI

  4. life1347 commented on Jul 3, 2018

    @life1347
    MemberAuthor

    But looks like we need to retire sourcearchive and deployarchive as well to avoid confusion.
    And --src hello.go --src world.go is not possible for now due to pkg constraint.

  5. erwinvaneyk commented on Jul 3, 2018

    @erwinvaneyk
    Member

    I am all in favor of retiring some of the parameters, but I imagine that that is part of another discussion/issue. 😄

    And --src hello.go --src world.go is not possible for now due to pkg constraint.

    Could you explain this constraint a bit?

  6. life1347 commented on Jul 27, 2018

    @life1347
    MemberAuthor

    Sorry, I missed the thread notification. Originally, I thought that the flag can only accept one input, but I noticed we can use StringSlice to handle multiple inputs so the constraint I mentioned is no longer exists.

  7. added this to the 0.11.0 milestone on Aug 8, 2018
  8. modified the milestones: 0.11.0, 0.12.0 on Sep 26, 2018
  9. vishal-biyani commented on Oct 10, 2018

    @vishal-biyani
    Member

    While working on this, I realized a few more cases/variations and I am documenting them here for future reference:

    Following variations will work

    --src hello.go => build single file 
    --src hello.go --src world.go or --src "*.go" => build package from multiple files
    --src myFnDir/ => build package from directory
    --src pkg.zip => Source archive - should work as it works today
    
    --deploy somedir/ => deployment package from a directory
    --deploy pkg.zip => Deploy archive - should work as it works today
    
    --src/--deploy http://someurl/somefile.js - this should work but no tests  currently
    

    Following is not supported as of now:

    --src dir1/ --src dir2/ => Multiple directory combinations
    --deploy dir1/ --deploy dir2/ => Currently only single flag supported for deploy flag
    
  10. life1347 commented on Oct 15, 2018

    @life1347
    MemberAuthor

    Just wondering why --src dir1/ --src dir2/ is not support.
    Won't fetcher extracts them under the same directory like following?

    . 
    ├── dir1
    └── dir2
    

    For example,

    kind: ArchiveUploadSpec
    name: bank-go-zip
    include:
      - "functions/*.go"
      - "functions/vendor"
    

    The final directory structure will be:

    <pkg-dir-name> 
    ├── *.go
    └── vendor
    
  11. removed this from the 0.12.0 milestone on Oct 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions