Skip to content

Commit

Permalink
Add tweaks
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Zhu <[email protected]>
  • Loading branch information
peterzhuamazon committed Nov 15, 2024
1 parent 316802a commit 156d9c4
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions .github/workflows/get-ci-image-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ on:
ci-image-version-linux:
description: The ci image version for linux build
value: ${{ jobs.Get-CI-Image-Tag.outputs.output-ci-image-version-linux }}
ci-image-mount-volumes:
description: The ci image mount volumes to set after starting the container
value: ${{ jobs.Get-CI-Image-Tag.outputs.output-ci-image-mount-volumes }}
ci-image-start-options:
description: The ci image mount volumes to set when starting the container
value: ${{ jobs.Get-CI-Image-Tag.outputs.output-ci-image-start-options }}
ci-image-start-command:
description: The ci image start commands to run after initialization
value: ${{ jobs.Get-CI-Image-Tag.outputs.output-ci-image-start-command }}
Expand All @@ -36,9 +36,9 @@ jobs:
Get-CI-Image-Tag:
runs-on: ubuntu-latest
outputs:
output-ci-image-version-linux: ${{ steps.step-ci-image-version-linux.outputs.ci-image-version-linux }}
output-ci-image-start-command: ${{ steps.step-ci-image-start-command.outputs.ci-image-start-command }}
output-ci-image-mount-volumes: ${{ steps.step-ci-image-mount-volumes.outputs.ci-image-mount-volumes }}
output-ci-image-version-linux: ${{ steps.step-ci-image-setups.outputs.ci-image-version-linux }}
output-ci-image-start-command: ${{ steps.step-ci-image-setups.outputs.ci-image-start-command }}
output-ci-image-start-options: ${{ steps.step-ci-image-setups.outputs.ci-image-start-options }}
steps:
- name: Install crane
uses: iarekylew00t/crane-installer@v1
Expand All @@ -51,7 +51,7 @@ jobs:
ref: ${{ inputs.build_ref }}
path: 'opensearch-build'
- name: Get ci image version from opensearch-build repository scripts
id: step-ci-image-version-linux
id: step-ci-image-setups
run: |
PRODUCT=${{ inputs.product }}
PLATFORM=${{ inputs.platform }}
Expand All @@ -63,18 +63,20 @@ jobs:
PLATFORM="almalinux8"
fi
fi
if [[ "$PLATFORM" = "al2" ]]; then
CI_IMAGE_CMD="cp -a /node_al2/* /node && /node/bin/node -v"
echo "ci-image-start-command=$CI_IMAGE_CMD" >> $GITHUB_OUTPUT
CI_IMAGE_OPTIONS="--user root -v /node:/node:rw,rshared -v /node:/__e/node20:ro,rshared"
echo "ci-image-start-options=$CI_IMAGE_MOUNTS" >> $GITHUB_OUTPUT
else
CI_IMAGE_CMD="echo pass"
echo "ci-image-start-command=$CI_IMAGE_CMD" >> $GITHUB_OUTPUT
CI_IMAGE_OPTIONS="--user root"
echo "ci-image-start-options=$CI_IMAGE_MOUNTS" >> $GITHUB_OUTPUT
fi
crane version
echo $PRODUCT $PLATFORM
CI_IMAGE_VERSION=`opensearch-build/docker/ci/get-ci-images.sh -p $PLATFORM -u $PRODUCT -t $TYPE | head -1`
echo $CI_IMAGE_VERSION
echo "ci-image-version-linux=$CI_IMAGE_VERSION" >> $GITHUB_OUTPUT
- name: Get ci image start command based on requirements
id: step-ci-image-start-command
run: |
CI_IMAGE_CMD="cp -a /node_al2/* /node && /node/bin/node -v"
echo "ci-image-start-command=$CI_IMAGE_CMD" >> $GITHUB_OUTPUT
- name: Get ci image mount volumes based on requirements
id: step-ci-image-mount-volumes
run: |
CI_IMAGE_MOUNTS="/node:/node:rw,rshared,/node:/__e/node20:ro,rshared"
echo "ci-image-mount-volumes=$CI_IMAGE_MOUNTS" >> $GITHUB_OUTPUT

0 comments on commit 156d9c4

Please sign in to comment.