---
platform: linux

image_resource:
  type: docker-image
  source:
    repository: busybox

inputs:
- name: pcf-pipelines-release
- name: cf-cli
- name: cliaas
- name: om
- name: version

outputs:
- name: pcf-pipelines-release-tarball

run:
  path: sh
  args:
  - -ce
  - |
    version=v$(cat version/version)

    tar --extract --file cf-cli/*.tgz

    mv cliaas/cliaas-linux .
    mv om/om-linux .

    tar \
      --exclude .git* \
      --exclude ci \
      --exclude "*.go" \
      --create \
      --gzip \
      --file pcf-pipelines-release-tarball/pcf-pipelines-$version.tgz \
      pcf-pipelines-release \
      cf \
      cliaas-linux \
      om-linux

---
platform: linux

image_resource:
  type: docker-image
  source:
    repository: busybox

inputs:
- name: pcf-pipelines-release
- name: cf-cli
- name: cliaas
- name: om
- name: version

outputs:
- name: pcf-pipelines-release-tarball

run:
  path: sh
  args:
  - -ce
  - |
    version=v$(cat version/version)

    tar --extract --file cf-cli/*.tgz

    mv cliaas/cliaas-linux .
    mv om/om-linux .

    mv pcf-pipelines-release pcf-pipelines

    tar \
      --exclude .git* \
      --exclude ci \
      --exclude "*.go" \
      --create \
      --gzip \
      --file pcf-pipelines-release-tarball/pcf-pipelines-$version.tgz \
      pcf-pipelines-release \
      cf \
      cliaas-linux \
      om-linux

Use correct pcf-pipelines dir within tarball
Use correct pcf-pipelines dir within tarball
