Skip to content

Commit

Permalink
Merge pull request #4432 from esl/package-publishing
Browse files Browse the repository at this point in the history
Publish MIM packages
  • Loading branch information
chrzaszcz authored Dec 17, 2024
2 parents c5538fa + 594520e commit 5b10044
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
14 changes: 4 additions & 10 deletions .circleci/template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -712,16 +712,10 @@ jobs:
command: |
./tools/circle-install-packages.sh rpm
./tools/pkg/verify_arch.sh
- when:
condition:
matches:
pattern: /^\d+\.\d+\.\d+/
value: << pipeline.git.tag >>
steps:
- run:
name: Publish package
command: |
./tools/pkg/publish.sh
- run:
name: Publish package
command: |
./tools/pkg/publish.sh
filters:
- &all_tags
Expand Down
16 changes: 10 additions & 6 deletions tools/pkg/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,22 @@ set -e

cd tools/pkg/packages
PACKAGE_NAME=$(ls)
PKG_PROFILE=packages
prefix=${pkg_PLATFORM/_//}
prefix=$(git rev-parse --short HEAD)

if which aws ; then
echo "aws tool ready"
else
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
curl "https://awscli.amazonaws.com/awscli-exe-linux-$(uname -m).zip" -o "awscliv2.zip"
unzip -q awscliv2.zip
sudo ./aws/install
fi

aws configure set aws_access_key_id "$PKG_ACCESS_KEY_ID" --profile "$PKG_PROFILE"
aws configure set aws_secret_access_key "$PKG_SECRET_ACCESS_KEY" --profile "$PKG_PROFILE"
aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID
aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY
aws configure set default.region $AWS_DEFAULT_REGION

aws s3 cp "$PACKAGE_NAME" "s3://arn:aws:s3:$PKG_AWS_REGION:$PKG_USER_ID:accesspoint/mim-packages/$prefix/$PACKAGE_NAME" --acl public-read --profile "$PKG_PROFILE" --region "$PKG_AWS_REGION"
if [ -n "$CIRCLE_TAG" ]; then
aws s3 cp "${PACKAGE_NAME}" "s3://mim-packages/tags/${CIRCLE_TAG}/${PACKAGE_NAME}" --acl public-read --quiet
else
aws s3 cp "${PACKAGE_NAME}" "s3://mim-packages/branches/${CIRCLE_BRANCH}/${prefix}/${PACKAGE_NAME}" --acl public-read --quiet
fi

0 comments on commit 5b10044

Please sign in to comment.