Skip to content

Commit

Permalink
Copy up release channel and CRDs (#205)
Browse files Browse the repository at this point in the history
* Copy up release channel and CRDs

* copy artifacts from build tools

* Remove lines rather than contents

* copy crds and release channels
  • Loading branch information
Terry Howe authored Mar 4, 2021
1 parent b4ad9e8 commit 2a263b3
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 5 deletions.
10 changes: 9 additions & 1 deletion release/generate_crd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ RELEASE="${2?Second required argument is release for example 1}"
REPO_OWNER=${REPO_OWNER:-aws}

BASE_DIRECTORY=$(git rev-parse --show-toplevel)
DEST_DIR=${BASE_DIRECTORY}/kubernetes-${RELEASE_BRANCH}/releases/${RELEASE}/artifacts
cd ${BASE_DIRECTORY}

REPOSITORY="https://github.com/${REPO_OWNER}/eks-distro-build-tooling.git"
rm -rf ./eks-distro-build-tooling
Expand All @@ -30,3 +30,11 @@ DESTINATION="./kubernetes-${RELEASE_BRANCH}/kubernetes-${RELEASE_BRANCH}-eks-${R
./eks-distro-build-tooling/release/bin/eks-distro-release release \
--release-branch ${RELEASE_BRANCH} \
--release-number ${RELEASE} | tee ${DESTINATION}
mkdir -p releasechannels
grep -v '^#.*' eks-distro-build-tooling/release/config/${RELEASE_BRANCH}/${RELEASE_BRANCH}.yaml \
>releasechannels/${RELEASE_BRANCH}.yaml
mkdir -p crds
grep -v '^#.*' eks-distro-build-tooling/release/config/crds/releasechannels.distro.eks.amazonaws.com-v1alpha1.yaml \
>crds/releasechannels.distro.eks.amazonaws.com-v1alpha1.yaml
grep -v '^#.*' eks-distro-build-tooling/release/config/crds/releases.distro.eks.amazonaws.com-v1alpha1.yaml \
>crds/releases.distro.eks.amazonaws.com-v1alpha1.yaml
26 changes: 22 additions & 4 deletions release/s3_sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,30 @@ then
DEST_DIR=${DEST_DIR}/${REPO}
fi
aws s3 sync $DEST_DIR s3://${ARTIFACT_BUCKET}/${DEST_DIR} ${PUBLIC_READ}
if [ -z "${REPO}" ]
if [ -n "${REPO}" ]
then
exit 0
fi
cd ${PREFIX_DIR}
for CRD
in *yaml
do
aws s3 cp ${CRD} s3://${ARTIFACT_BUCKET}/${PREFIX_DIR}/${CRD} ${PUBLIC_READ}
done
cd ${BASE_DIRECTORY}
if [ -d crds ]
then
cd ${PREFIX_DIR}
for CRD
in *yaml
in crds/*yaml
do
aws s3 cp ${CRD} s3://${ARTIFACT_BUCKET}/${CRD} ${PUBLIC_READ}
done
fi
if [ -d releasechannels ]
then
for CHANNEL
in releasechannels/*yaml
do
aws s3 cp ${CRD} s3://${ARTIFACT_BUCKET}/${PREFIX_DIR}/${CRD} ${PUBLIC_READ}
aws s3 cp ${CHANNEL} s3://${ARTIFACT_BUCKET}/${CHANNEL} ${PUBLIC_READ}
done
fi

0 comments on commit 2a263b3

Please sign in to comment.