diff --git a/.expeditor/hab-export-pipeline.yml b/.expeditor/hab-export-pipeline.yml index 9b285f6..b80334e 100644 --- a/.expeditor/hab-export-pipeline.yml +++ b/.expeditor/hab-export-pipeline.yml @@ -40,6 +40,21 @@ steps: - chef/habitat#2a479e94e3dec3d2def59f6a7d831d9ab9ee336a export: chef-demo/hello-omnibus-harmony format: docker + command: + - echo "--- Executing commands/export.sh from habitat-plugin" + - bash commands/export.sh + expeditor: + accounts: + - aws/chef-cd + executor: + linux: + privileged: true + single-use: true + + - label: ":habitat: execute export script" + command: + - echo "--- Executing commands/export.sh from habitat-plugin" + - bash commands/export.sh expeditor: accounts: - aws/chef-cd @@ -57,4 +72,4 @@ steps: # host_os: windows # environment: # - BUILD_PKG_TARGET=x86_64-windows - # - BUILDKITE_AGENT_ACCESS_TOKEN \ No newline at end of file + # - BUILDKITE_AGENT_ACCESS_TOKEN diff --git a/.expeditor/scripts/exports.sh b/.expeditor/scripts/exports.sh new file mode 100644 index 0000000..360ae6d --- /dev/null +++ b/.expeditor/scripts/exports.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +export_format=$(plugin_read_config FORMAT) + +if [[ "${export_format:-}" = "docker" ]]; then + # shellcheck source=../lib/export_docker.sh + . "$DIR/../lib/export_docker.sh" +elif [[ "${export_format:-}" = "tar" ]]; then + # shellcheck source=../lib/export_tarball.sh + . "$DIR/../lib/export_tarball.sh" +else + echo "Unsupported export format: ${export_format:-}. It should be docker or tar. Exiting." + exit 1 +fi