Skip to content

Commit

Permalink
fix: arguments parmeter expansion (#54)
Browse files Browse the repository at this point in the history
* fix: parse arguments

* test: add argument parameter to ci tests

* refactor: remove unnecessary executors
  • Loading branch information
brivu authored Jun 16, 2023
1 parent d36197f commit d199b2e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
14 changes: 4 additions & 10 deletions .circleci/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,6 @@ executors:
docker-base:
docker:
- image: cimg/base:stable
windows:
machine:
image: windows-server-2019-vs2019:stable
shell: bash.exe
resource_class: windows.medium
macos:
macos:
xcode: 13.3
jobs:
integration-test:
parameters:
Expand All @@ -43,10 +35,12 @@ jobs:
from: "bucket"
to: "s3://orb-testing-1/s3-orb"
profile_name: "OIDC-User"
arguments: --acl public-read --cache-control max-age=86400
- aws-s3/copy:
from: "bucket/build_asset.txt"
to: "s3://orb-testing-1"
profile_name: "OIDC-User"
arguments: --cache-control "public, max-age=15" --acl bucket-owner-full-control
workflows:
test-deploy:
jobs:
Expand All @@ -57,7 +51,7 @@ workflows:
filters: *filters
matrix:
parameters:
executor: ["alpine", "docker-base", "windows", "macos"]
executor: ["alpine", "docker-base"]
- aws-s3/sync:
pre-steps:
- run: cd ~/ && mkdir bucket && echo "lorem ipsum" > bucket/build_asset.txt
Expand Down Expand Up @@ -93,6 +87,6 @@ workflows:
vcs_type: << pipeline.project.type >>
pub_type: production
enable_pr_comment: true
requires: [orb-tools/pack, integration-test-alpine, integration-test-docker-base, integration-test-windows, integration-test-macos, aws-s3/copy, aws-s3/sync]
requires: [orb-tools/pack, integration-test-alpine, integration-test-docker-base, aws-s3/copy, aws-s3/sync]
context: orb-publisher
filters: *release-filters
6 changes: 5 additions & 1 deletion src/scripts/copy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ ORB_STR_ARGUMENTS="$(echo "${ORB_STR_ARGUMENTS}" | circleci env subst)"
ORB_STR_PROFILE_NAME="$(circleci env subst "${ORB_STR_PROFILE_NAME}")"

if [ -n "${ORB_STR_ARGUMENTS}" ]; then
set -- "$@" "${ORB_STR_ARGUMENTS}"
IFS=' '
set --
for arg in $(echo "${ORB_STR_ARGUMENTS}" | sed 's/,[ ]*/,/g'); do
set -- "$@" "$arg"
done
fi

set -x
Expand Down
6 changes: 5 additions & 1 deletion src/scripts/sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ ORB_STR_ARGUMENTS="$(echo "${ORB_STR_ARGUMENTS}" | circleci env subst)"
ORB_STR_PROFILE_NAME="$(circleci env subst "${ORB_STR_PROFILE_NAME}")"

if [ -n "${ORB_STR_ARGUMENTS}" ]; then
set -- "$@" "${ORB_STR_ARGUMENTS}"
IFS=' '
set --
for arg in $(echo "${ORB_STR_ARGUMENTS}" | sed 's/,[ ]*/,/g'); do
set -- "$@" "$arg"
done
fi
set -x
aws s3 sync "${ORB_EVAL_FROM}" "${ORB_EVAL_TO}" --profile "${ORB_STR_PROFILE_NAME}" "$@"
Expand Down

0 comments on commit d199b2e

Please sign in to comment.