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

[oc new-build] is there a way to copy mutiple directories using oc new-build with source-image-path flag #22600

Closed
der-ali opened this issue Apr 18, 2019 · 8 comments
Labels
area/usability component/build component/cli lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. sig/developer-experience

Comments

@der-ali
Copy link

der-ali commented Apr 18, 2019

when writing a build config in openshift, i can copy multiple
directories from one container to another like this

source:
    images:
      - from:
          kind: ImageStreamTag
          name: 'buildervscv:latest'
        paths:
          - destinationDir: .
            sourcePath: /opt/app-root/src/dist/.
          - destinationDir: .
            sourcePath: /opt/app-root/src/openshift/conf/.

how can i do the same thing using oc new-build ?

I tried

oc new-build --source-image=builder
--source-image-path=/opt/app-root/src/dist/.:.
--source-image-path=/opt/app-root/src/openshift/conf/.:.
--image-stream=openshift/nginx
oc new-build  --source-image=builder --source-image-path
/opt/app-root/src/dist/.:.  /opt/app-root/src/openshift/conf/.:.
--image-stream=openshift/nginx
oc new-build  --source-image=builder
--source-image-path=[/opt/app-root/src/dist/.:. ,
/opt/app-root/src/openshift/conf/.:.] --image-stream=openshift/nginx

with the fist one only one directory is being copied! and the rest are
throwing an error.
The documentation is only mentioning --source-image-path='': Specify the file or directory to copy from the source image and its destination in the build directory. Format: [source]:[destination-dir]

@adambkaplan
Copy link
Contributor

It seems oc new-build is only using the first value if --source-image-path is set multiple times. You can add additional paths to the BuildConfig once it has been created via oc edit bc <build-name>

fyi @openshift/sig-developer-experience @bparees

@der-ali
Copy link
Author

der-ali commented Apr 20, 2019

@adambkaplan i used oc patch to add the second sourcePath instead of oc edit because i am using a gitlab pipeline to deploy.

oc patch buildconfig $APP --type=json -p='[{"op":"add","path":"/spec/source/images/0/paths/1","value":{"destinationDir":".","sourcePath":"/opt/app-root/src/openshift/."}}]

it will be though much cleaner to have this done in one command :)

@der-ali
Copy link
Author

der-ali commented Jun 26, 2019

any news if this feature gonna be implemented?

@adambkaplan
Copy link
Contributor

We have no immediate plans to add this feature, but are more than happy to review a PR.

I'd recommend waiting a bit, since origin is currently being refactored so that oc (and other okd binaries) are hosted in their own repositories.

@openshift-bot
Copy link
Contributor

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci-robot openshift-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 24, 2019
@openshift-bot
Copy link
Contributor

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten
/remove-lifecycle stale

@openshift-ci-robot openshift-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Oct 24, 2019
@openshift-bot
Copy link
Contributor

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.

/close

@openshift-ci-robot
Copy link

@openshift-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/usability component/build component/cli lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. sig/developer-experience
Projects
None yet
Development

No branches or pull requests

4 participants