woodpecker-ci / woodpecker

Woodpecker is a simple, yet powerful CI/CD engine with great extensibility.
https://woodpecker-ci.org
Apache License 2.0
4.07k stars 353 forks source link

Share Data across Steps / Get latest Git Tag #1042

Closed Tert0 closed 2 years ago

Tert0 commented 2 years ago

Is there currently a way to share data(e.g. Environment Variables) across steps, if not is this a planned feature? Or is there an other way to get the latest Git Tag of a Repo and use it in an other step as e.g. Environment Variable? My simplest Idea how to achive that:

pipeline:
  get-tag:
    image: alpine
    export: GIT_TAG # not implemented
    commands:
      - apk add --no-cache git
      - export GIT_TAG=$(git tag | sort -V | tail -1)
  build-docker-image:
    image: woodpeckerci/plugin-docker-buildx
    privileged: true
    import: get-tag.GIT_TAG  # not implemented
    settings:
      registry: docker.example.org
      repo: docker.example.org/myimage
      tags: latest
      dockerfile: Dockerfile
      username:
        from_secret: DOCKER_USERNAME
      password:
        from_secret: DOCKER_PASSWORD
      platforms: 
        - amd64
      pull_image: true
      build_args:
        - VERSION=${GIT_TAG}
qwerty287 commented 2 years ago

I'd say this is a duplicate of https://github.com/woodpecker-ci/woodpecker/issues/913.

Tert0 commented 2 years ago

Sorry, did not see the issue