Skip to content

Commit

Permalink
test before publication
Browse files Browse the repository at this point in the history
  • Loading branch information
erdrix committed Mar 8, 2024
1 parent 18d1194 commit 7f3d726
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 21 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/terraform-modules-oci-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,11 @@ jobs:
run: |
ls -la
echo "${{ steps.prepare_tag.outputs.VERSION }}"
ls -la ${{ inputs.organization_layer_name }}/${{ inputs.team_name }}/${{ inputs.products_path }}/**/terraform
# bash -x ./publish-oci.sh ${{ steps.prepare_tag.outputs.VERSION }}
basePath="${{ inputs.organization_layer_name }}/${{ inputs.team_name }}/${{ inputs.products_path }}"
for terraformPath in $(find "$basePath" -type d -name 'terraform' -exec dirname {} \; | sed "s|^$basePath/||" | sort | uniq); do
productName=$(echo "$terraformPath" | sed 's/\//-/g')
echo "Publishing $productName"
echo ${{ steps.prepare_tag.outputs.VERSION }} "${basePath}/${terraformPath}/terraform" "${{ inputs.organization_layer_name }}-${{ inputs.team_name }}-${productName}"
# bash -x ./publish-oci.sh ${{ steps.prepare_tag.outputs.VERSION }} "${basePath}/${terraformPath}/terraform" "${{ inputs.organization_layer_name }}-${{ inputs.team_name }}-${productName}"
done
#
Original file line number Diff line number Diff line change
@@ -1,36 +1,23 @@
pushd .

REPOSITORY=konpyutaika/data-mesh

tmp_dir=$(mktemp -d -t ci-XXXXXXXXXX)
cd $tmp_dir

git clone https://github.com/${REPO}
cd aws-primitive-modules

TAG=$(git rev-parse --short HEAD)
REPOSITORY=konpyutaika/data-mesh
SOURCE="$(git config --get remote.origin.url)"
REVISION="$(git branch --show-current)/$(git rev-parse HEAD)"

rm -rf .git || true
rm -rf .github || true
rm Makefile
rm *.sh
rm $(find . -name "README.md")

flux push artifact \
oci://ghcr.io/${REPO}:$PROVIDER_VERSION-$TAG \
--path="./" \
oci://ghcr.io/${REPOSITORY}/$3:$TAG \
--path="$2" \
--source=$SOURCE \
--revision=$REVISION

flux tag artifact \
oci://ghcr.io/${REPO}:$PROVIDER_VERSION-$TAG \
oci://ghcr.io/${REPOSITORY}/$3:$TAG \
--tag latest

flux tag artifact \
oci://ghcr.io/${REPO}:$PROVIDER_VERSION-$TAG \
--tag $PROVIDER_VERSION-$1
oci://ghcr.io/${REPOSITORY}/$3:$TAG \
--tag $1

rm -rf $tmp_dir

Expand Down

0 comments on commit 7f3d726

Please sign in to comment.