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

Add Jib tagPolicy #2098

Closed
dkirrane opened this issue May 9, 2019 · 2 comments
Closed

Add Jib tagPolicy #2098

dkirrane opened this issue May 9, 2019 · 2 comments

Comments

@dkirrane
Copy link

dkirrane commented May 9, 2019

Allow using pom.xml as the version for the Docker Image tag. Maybe Jib can provide this?

For example:

apiVersion: skaffold/v1beta9
kind: Config

build:
  tagPolicy:
    # jibMaven HERE!!!!!
  artifacts:
    - image: my-repo.com/my-app
      context: .
      jibMaven:

The Jib equivalent would be

                <plugin>
                    <groupId>com.google.cloud.tools</groupId>
                    <artifactId>jib-maven-plugin</artifactId>
                    <version>1.2.0</version>
                    <configuration>
                        <to>
                            <tags>
                                <tag>${project.version}</tag>
                            </tags>
                        </to>
                    </configuration>
                </plugin>
@balopat
Copy link
Contributor

balopat commented Jun 4, 2019

thanks for opening this! In general this flow would break the contract between how Skaffold works with Builders: skaffold creates a tag based on the tagpolicy for each of the artifacts and asks the builders (e.g. jib) to build an image and tag it/push it under that tag. Maybe we could think about a command based tagPolicy? If there is enough interest we can think more about this. For now I don't think we'd go down this path.

What I could recommend doing in a single-artifact project to run a command to extract the version and set it as an env var and then you can use it in envTemplate tagpolicy similar to this comment: #1937 (comment)

Would this work for you?

@dkirrane
Copy link
Author

Makes sense thanks. Closing

@dgageot dgageot closed this as completed Jul 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants