Skip to content

Commit 5b10044

Browse files
authoredDec 17, 2024··
Merge pull request #4432 from esl/package-publishing
Publish MIM packages
2 parents c5538fa + 594520e commit 5b10044

File tree

2 files changed

+14
-16
lines changed

2 files changed

+14
-16
lines changed
 

‎.circleci/template.yml

+4-10
Original file line numberDiff line numberDiff line change
@@ -712,16 +712,10 @@ jobs:
712712
command: |
713713
./tools/circle-install-packages.sh rpm
714714
./tools/pkg/verify_arch.sh
715-
- when:
716-
condition:
717-
matches:
718-
pattern: /^\d+\.\d+\.\d+/
719-
value: << pipeline.git.tag >>
720-
steps:
721-
- run:
722-
name: Publish package
723-
command: |
724-
./tools/pkg/publish.sh
715+
- run:
716+
name: Publish package
717+
command: |
718+
./tools/pkg/publish.sh
725719
726720
filters:
727721
- &all_tags

‎tools/pkg/publish.sh

+10-6
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,22 @@ set -e
44

55
cd tools/pkg/packages
66
PACKAGE_NAME=$(ls)
7-
PKG_PROFILE=packages
8-
prefix=${pkg_PLATFORM/_//}
7+
prefix=$(git rev-parse --short HEAD)
98

109
if which aws ; then
1110
echo "aws tool ready"
1211
else
13-
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
12+
curl "https://awscli.amazonaws.com/awscli-exe-linux-$(uname -m).zip" -o "awscliv2.zip"
1413
unzip -q awscliv2.zip
1514
sudo ./aws/install
1615
fi
1716

18-
aws configure set aws_access_key_id "$PKG_ACCESS_KEY_ID" --profile "$PKG_PROFILE"
19-
aws configure set aws_secret_access_key "$PKG_SECRET_ACCESS_KEY" --profile "$PKG_PROFILE"
17+
aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID
18+
aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY
19+
aws configure set default.region $AWS_DEFAULT_REGION
2020

21-
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"
21+
if [ -n "$CIRCLE_TAG" ]; then
22+
aws s3 cp "${PACKAGE_NAME}" "s3://mim-packages/tags/${CIRCLE_TAG}/${PACKAGE_NAME}" --acl public-read --quiet
23+
else
24+
aws s3 cp "${PACKAGE_NAME}" "s3://mim-packages/branches/${CIRCLE_BRANCH}/${prefix}/${PACKAGE_NAME}" --acl public-read --quiet
25+
fi

0 commit comments

Comments
 (0)
Please sign in to comment.