forked from opensearch-project/opensearch-build
-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (61 loc) · 1.93 KB
/
get-ci-image-tag.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
---
name: Get CI Image Tag
on:
workflow_call:
inputs:
product:
required: false
type: string
default: 'opensearch'
platform:
required: false
type: string
build_ref:
required: false
type: string
default: 'main'
version:
required: false
type: string
type:
required: false
type: string
default: 'build'
outputs:
ci-image-version-linux:
description: The ci image version for linux build
value: ${{ jobs.Get-CI-Image-Tag.outputs.output-ci-image-version-linux }}
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 }}
steps:
- name: Install crane
uses: iarekylew00t/crane-installer@v1
with:
crane-release: v0.15.2
- name: Checkout opensearch-build repository
uses: actions/checkout@v3
with:
repository: 'opensearch-project/opensearch-build'
ref: ${{ inputs.build_ref }}
path: 'opensearch-build'
- name: Get ci image version from opensearch-build repository scripts
id: step-ci-image-version-linux
run: |
PRODUCT=${{ inputs.product }}
PLATFORM=${{ inputs.platform }}
TYPE=${{ inputs.type }}
if [[ -z "$PLATFORM" ]]; then
if [[ "$PRODUCT" = "opensearch" ]]; then
PLATFORM="al2" # Temp measure before al2 deprecation on opensearch for k-NN
else
PLATFORM="almalinux8"
fi
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