Giter Club home page Giter Club logo

Comments (16)

meatballhat avatar meatballhat commented on May 18, 2024

@mfornasa Thanks for the report! Fixing...

from artifacts.

meatballhat avatar meatballhat commented on May 18, 2024

@mfornasa (now that I've checked) If you're looking for a literal --target-paths, you won't find it. Instead, the codegangsta/cli library expects a string of comma-delimited flag "names", which are automatically prepended with -- or - depending on the number of characters in the name, e.g.:

artifacts/artifacts.go

Lines 96 to 101 in 970821d

cli.StringFlag{
Name: "target-paths, t",
EnvVar: "ARTIFACTS_TARGET_PATHS",
Usage: fmt.Sprintf("artifact target paths (':'-delimited) (default %#v)",
strings.Join(env.Slice("ARTIFACTS_TARGET_PATHS", ":", upload.DefaultTargetPaths), ":")),
},

Are you experiencing a specific error at runtime?

from artifacts.

mfornasa avatar mfornasa commented on May 18, 2024

Wihtout specifying the target:

$ ./artifacts  upload --key [...] --secret [...] --bucket test  /home/developer/p.sh
INFO[0000] uploading with settings                       bucket=test cache_control=private permissions=private
INFO[0000] uploading: /home/developer/p.sh (size: 39B)   download_url=https://test.s3.amazonaws.com/artifacts/home/developer/p.sh

Using env var (works):

$ ARTIFACTS_TARGET_PATHS=PP  ./artifacts  upload --key [...] --secret [...] --bucket test  /home/developer/p.sh
INFO[0000] uploading with settings                       bucket=test cache_control=private permissions=private
INFO[0000] uploading: /home/developer/p.sh (size: 39B)   download_url=https://test.s3.amazonaws.com/PP/home/developer/p.sh

Using --target-paths (doesn't work)

$ ./artifacts  upload --key [...] --secret [...] --bucket test --target-paths "PP" /home/developer/p.sh
INFO[0000] uploading with settings                       bucket=ct-build-cleverhire cache_control=private permissions=private
INFO[0000] uploading: /home/developer/p.sh (size: 39B)   download_url=https://test.s3.amazonaws.com/artifacts/home/developer/p.sh

from artifacts.

meatballhat avatar meatballhat commented on May 18, 2024

@mfornasa got it. I'll take a look! Thank you so much for the details ๐Ÿ˜บ

from artifacts.

mfornasa avatar mfornasa commented on May 18, 2024

Thanks. A related question (I think). I'm using artifacts as travis addon as shown here and I'm having problems with --target-paths. Is this the same issue as above? (That is, are the .travis.yml directives translated to command line parameters?)

from artifacts.

meatballhat avatar meatballhat commented on May 18, 2024

@mfornasa do you have an example build I can see? If it's a private build, would you be willing to gist up a sanitized version of the log?

from artifacts.

mfornasa avatar mfornasa commented on May 18, 2024

Here three examples using:

  • target-paths: test
  • target_paths: test
  • env: ARTIFACTS_TARGET_PATHS=test

from artifacts.

mfornasa avatar mfornasa commented on May 18, 2024

On this last issue I had an answer from Travis support:

At this point it's not possible to choose the destination paths. We're working on a better integration of these files in our user interface and having unique means of recognizing and linking to the files uploaded is part of this.

If you need better configurability, maybe the S3 deployment would work better? http://docs.travis-ci.com/user/deployment/s3/

from artifacts.

meatballhat avatar meatballhat commented on May 18, 2024

@mfornasa Ah, so I'm guessing this is due to target_paths being a "controlled param" (https://github.com/travis-ci/travis-build/blob/1d6ded37cf22d798a0c3c2642e4d0ec646670df1/lib/travis/build/script/addons/artifacts.rb#L93-L100)
The suggestion to use the S3 deployer is valid, or you could choose to use the artifacts executable directly, e.g.:

# ...
env:
  global:
  # secure ARTIFACTS_KEY definition
  - secure: ...
  # secure ARTIFACTS_SECRET definition
  - secure: ...
  # other ARTIFACTS_* vars
  - ARTIFACTS_TARGET_PATHS=test
  - ARTIFACTS_DEBUG=1
after_success:
- curl -sL https://raw.githubusercontent.com/travis-ci/artifacts/master/install | bash
- ~/bin/artifacts upload

from artifacts.

meatballhat avatar meatballhat commented on May 18, 2024

@mfornasa in one of your comments above you have some invocations that look you're running ./artifacts directly, but later on you reference build logs that are using the .travis.yml integration. Are you experiencing issues with target paths in both cases?

from artifacts.

meatballhat avatar meatballhat commented on May 18, 2024

@mfornasa bump ๐Ÿ˜ƒ

from artifacts.

0x6e6562 avatar 0x6e6562 commented on May 18, 2024

Is this issue still current? I'm in the process of porting from the artifacts gem to the addon and I'm trying to specify a particular target path, but it seems that this is just getting ignored and there are no useable diagnostics to see where this might be going.

from artifacts.

meatballhat avatar meatballhat commented on May 18, 2024

@0x6e6562 I believe this is "fixed" now in the addons.artifacts implementation via travis-ci/travis-build@aa34739. Pretty please can you confirm?

from artifacts.

0x6e6562 avatar 0x6e6562 commented on May 18, 2024

@meatballhat Sorry for the radio silence :-(

I can confirm that this issue is now fixed on Travis CI, so thank you very much for patching this :-)

For anybody else reading this thread, here is the relevant part of my descriptor:

addons:
  artifacts:
    debug: true
    paths:
      - PATH_TO_MY_ARTIFACT
    target_paths: PATH_WITH_MY_S3_BUCKET/$TRAVIS_BUILD_NUMBER
    working_dir: WORKING_DIR
    bucket: MY_S3_BUCKET
    s3_region: eu-west-1

Note that I am using the repository creds for this, as set using the travis gem:

$ travis env set AWS_SECRET_KEY fmAQd46zn2euqA827da3nb89c9 -r owner/repo

To check the creds for a repo:

$ travis env list -r owner/repo       
# environment variables for owner/repo
AWS_ACCESS_KEY=[secure]
AWS_SECRET_KEY=[secure]

from artifacts.

0x6e6562 avatar 0x6e6562 commented on May 18, 2024

Given that it works now, I would suggest that we close this issue now?

from artifacts.

meatballhat avatar meatballhat commented on May 18, 2024

@0x6e6562 Thanks so much! ๐Ÿ˜ป

from artifacts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.