-
Notifications
You must be signed in to change notification settings - Fork 82
132 lines (114 loc) · 4.41 KB
/
ee_latest_snapshot_push.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: Build EE snapshot image
on:
workflow_dispatch:
inputs:
HZ_VERSION:
description: 'Version of Hazelcast to build the image for'
required: true
HZ_EE_REVISION:
description: 'Commit id of Hazelcast Enterprise snapshot jar'
required: true
env:
test_container_name_ee: hazelcast-ee-test
jobs:
jdks:
uses: ./.github/workflows/get-supported-jdks.yaml
push:
runs-on: ubuntu-latest
needs: jdks
strategy:
matrix:
jdk: ${{ fromJSON(needs.jdks.outputs.jdks) }}
variant: [ 'slim','' ]
include:
- variant: slim
- variant: ''
env:
DOCKER_ORG: hazelcast
HZ_VERSION : ${{ github.event.inputs.HZ_VERSION }}
steps:
- name: Compute Suffix
run: |
if [ -n "${{ matrix.variant }}" ]; then
SUFFIX=-${{ matrix.variant }}
else
SUFFIX=
fi
echo "SUFFIX=${SUFFIX}" >> $GITHUB_ENV
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/[email protected]
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: v0.5.1
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: 'us-east-1'
- name: Get EE dist ZIP URL
run: |
. .github/scripts/ee-build.functions.sh
echo "HAZELCAST_EE_ZIP_URL=$(get_hz_dist_zip "${{ matrix.variant }}" "${HZ_VERSION}")" >> $GITHUB_ENV
- name: Build Test EE image
run: |
docker buildx build --load \
--build-arg JDK_VERSION=${{ matrix.jdk }} \
--build-arg HZ_VERSION=${HZ_VERSION} \
--build-arg HAZELCAST_ZIP_URL=$HAZELCAST_EE_ZIP_URL \
--tag hazelcast-ee:test \
hazelcast-enterprise
- name: Run smoke test against EE image
timeout-minutes: 2
run: |
export HZ_LICENSEKEY=${{ secrets.HZ_ENTERPRISE_LICENSE }}
.github/scripts/simple-smoke-test.sh hazelcast-ee:test ${{ env.test_container_name_ee }} ee ${HZ_VERSION}
- name: Get docker logs
if: ${{ always() }}
run: |
DOCKER_LOG_FILE_EE=docker-${{ env.test_container_name_ee }}${{ env.SUFFIX }}-jdk${{ matrix.jdk }}.log
echo "DOCKER_LOG_FILE_EE=${DOCKER_LOG_FILE_EE}" >> $GITHUB_ENV
docker logs ${{ env.test_container_name_ee }} > ${DOCKER_LOG_FILE_EE}
- name: Store docker logs as artifact
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: docker-logs${{ env.SUFFIX }}-jdk${{ matrix.jdk }}
path: |
${{ env.DOCKER_LOG_FILE_EE }}
- name: Login to Docker Hub
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: Build/Push EE image
run: |
. .github/scripts/get-tags-to-push.sh
. .github/scripts/docker.functions.sh
VERSIONS=("$HZ_VERSION")
if [[ "${{ github.ref }}" == "refs/heads/master" ]]; then
VERSIONS+=(latest-snapshot)
fi
DOCKER_DIR=hazelcast-enterprise
IMAGE_NAME=${{ env.DOCKER_ORG }}/hazelcast-enterprise
DEFAULT_JDK="$(get_default_jdk $DOCKER_DIR)"
TAGS_TO_PUSH=$(augment_with_suffixed_tags "${VERSIONS[*]}" "${{ env.SUFFIX }}" "${{ matrix.jdk }}" "$DEFAULT_JDK")
echo "TAGS_TO_PUSH=$TAGS_TO_PUSH"
TAGS_ARG=""
for tag in ${TAGS_TO_PUSH[@]}
do
TAGS_ARG="${TAGS_ARG} --tag ${IMAGE_NAME}:${tag}"
done
PLATFORMS="$(get_ubi_supported_platforms "${{ matrix.jdk }}")"
docker buildx build --push \
--build-arg HZ_VERSION=${HZ_VERSION} \
--build-arg JDK_VERSION=${{ matrix.jdk }} \
--label hazelcast.ee.revision=${{ github.event.inputs.HZ_EE_REVISION }} \
--build-arg HAZELCAST_ZIP_URL=$HAZELCAST_EE_ZIP_URL \
${TAGS_ARG} \
--platform=${PLATFORMS} $DOCKER_DIR
- name: Slack notification
uses: ./.github/actions/slack-notification
if: failure()
with:
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK }}