2021-03-08 19:32:46 +08:00
|
|
|
name: Publish Test Images
|
|
|
|
# TODO: do not trigger action for some document file update
|
|
|
|
|
|
|
|
# This workflow is triggered on pushes or pull request to the repository.
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
# file paths to consider in the event. Optional; defaults to all.
|
|
|
|
paths:
|
2021-04-27 19:27:50 +08:00
|
|
|
- 'tests/docker/Dockerfile'
|
2021-08-20 11:00:56 +08:00
|
|
|
- 'tests/python_client/requirements.txt'
|
2021-03-08 19:32:46 +08:00
|
|
|
- '.github/workflows/publish-test-images.yaml'
|
2021-07-09 14:08:00 +08:00
|
|
|
- '!**.md'
|
2021-03-08 19:32:46 +08:00
|
|
|
pull_request:
|
|
|
|
# file paths to consider in the event. Optional; defaults to all.
|
|
|
|
paths:
|
2021-04-27 19:27:50 +08:00
|
|
|
- 'tests/docker/Dockerfile'
|
2021-08-20 11:00:56 +08:00
|
|
|
- 'tests/python_client/requirements.txt'
|
2021-03-08 19:32:46 +08:00
|
|
|
- '.github/workflows/publish-test-images.yaml'
|
2021-07-09 14:08:00 +08:00
|
|
|
- '!**.md'
|
2021-03-08 19:32:46 +08:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
publish-pytest-images:
|
|
|
|
name: PyTest
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
timeout-minutes: 60
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Get version from system time after release step
|
|
|
|
id: extracter
|
|
|
|
run: |
|
|
|
|
echo "::set-output name=version::$(date +%Y%m%d)"
|
|
|
|
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
|
2021-07-12 22:47:08 +08:00
|
|
|
- name: Docker Pull
|
|
|
|
shell: bash
|
|
|
|
working-directory: tests/docker
|
|
|
|
run: |
|
2021-08-01 16:14:25 +08:00
|
|
|
docker-compose pull --ignore-pull-failures pytest
|
2021-03-08 19:32:46 +08:00
|
|
|
- name: Docker Build
|
|
|
|
shell: bash
|
2021-04-27 19:27:50 +08:00
|
|
|
working-directory: tests/docker
|
2021-03-08 19:32:46 +08:00
|
|
|
run: |
|
2021-06-08 17:27:58 +08:00
|
|
|
IMAGE_TAG=${{ steps.extracter.outputs.version }}-${{ steps.extracter.outputs.sha_short }} docker-compose build pytest
|
2021-08-01 16:14:25 +08:00
|
|
|
export LATEST_IMAGE_TAG=${{ steps.extracter.outputs.version }}-${{ steps.extracter.outputs.sha_short }}
|
2021-06-08 17:27:58 +08:00
|
|
|
IMAGE_TAG=latest docker-compose build pytest
|
2021-03-08 19:32:46 +08:00
|
|
|
- name: Docker Push
|
2021-04-26 13:59:28 +08:00
|
|
|
if: success() && github.event_name == 'push' && github.repository == 'milvus-io/milvus'
|
2021-03-08 19:32:46 +08:00
|
|
|
continue-on-error: true
|
|
|
|
shell: bash
|
2021-04-29 11:21:35 +08:00
|
|
|
working-directory: tests/docker
|
2021-03-08 19:32:46 +08:00
|
|
|
run: |
|
|
|
|
docker login -u ${{ secrets.DOCKERHUB_USER }} \
|
|
|
|
-p ${{ secrets.DOCKERHUB_TOKEN }}
|
2021-06-08 17:27:58 +08:00
|
|
|
IMAGE_TAG=${{ steps.extracter.outputs.version }}-${{ steps.extracter.outputs.sha_short }} docker-compose push pytest
|
|
|
|
IMAGE_TAG=latest docker-compose push pytest
|
2021-04-27 19:27:50 +08:00
|
|
|
echo "Push pytest image Succeeded"
|
2021-07-12 17:06:18 +08:00
|
|
|
- name: Update Pytest Image Changes
|
|
|
|
if: success() && github.event_name == 'push' && github.repository == 'milvus-io/milvus'
|
|
|
|
continue-on-error: true
|
|
|
|
shell: bash
|
2021-12-25 16:24:19 +08:00
|
|
|
working-directory: .
|
2021-07-12 17:06:18 +08:00
|
|
|
run: |
|
2021-12-25 16:24:19 +08:00
|
|
|
sed -i "s#^IMAGE_TAG=.*#IMAGE_TAG=${{ steps.extracter.outputs.version }}-${{ steps.extracter.outputs.sha_short }}#g" ./tests/docker/.env
|
|
|
|
sed -i "s#^LATEST_IMAGE_TAG=.*#LATEST_IMAGE_TAG=${{ steps.extracter.outputs.version }}-${{ steps.extracter.outputs.sha_short }}#g" ./tests/docker/.env
|
2022-07-28 20:26:32 +08:00
|
|
|
sed -i "s#pytest:.*#pytest:${{ steps.extracter.outputs.version }}-${{ steps.extracter.outputs.sha_short }}#g" ./ci/jenkins/pod/rte.yaml
|
2022-11-03 14:53:35 +08:00
|
|
|
sed -i "s#pytest:.*#pytest:${{ steps.extracter.outputs.version }}-${{ steps.extracter.outputs.sha_short }}#g" ./ci/jenkins/pod/e2e.yaml
|
2021-07-12 17:06:18 +08:00
|
|
|
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
|
|
git config --local user.name "github-actions[bot]"
|
2021-12-25 16:24:19 +08:00
|
|
|
git add ./tests/docker/.env
|
2022-07-28 20:26:32 +08:00
|
|
|
git add ./ci/jenkins/pod/rte.yaml
|
2022-11-03 14:53:35 +08:00
|
|
|
git add ./ci/jenkins/pod/e2e.yaml
|
2021-07-13 16:06:26 +08:00
|
|
|
git commit -m "Update Pytest image changes"
|
2021-07-13 15:12:27 +08:00
|
|
|
- name: Create Pull Request
|
|
|
|
id: cpr
|
2021-07-12 17:06:18 +08:00
|
|
|
if: success() && github.event_name == 'push' && github.repository == 'milvus-io/milvus'
|
|
|
|
continue-on-error: true
|
2021-07-13 15:22:43 +08:00
|
|
|
uses: peter-evans/create-pull-request@v3
|
2021-07-13 15:12:27 +08:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.ALL_CONTRIBUTORS_TOKEN }}
|
|
|
|
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
|
2022-11-03 14:53:35 +08:00
|
|
|
signoff: true
|
2021-07-13 15:44:48 +08:00
|
|
|
branch: update_pytest_${{ github.sha }}
|
2021-07-13 15:12:27 +08:00
|
|
|
delete-branch: true
|
2021-07-13 16:06:26 +08:00
|
|
|
title: '[automated] Update Pytest image changes'
|
2021-07-13 15:12:27 +08:00
|
|
|
body: |
|
2021-07-13 16:06:26 +08:00
|
|
|
Update Pytest image changes
|
2022-08-04 10:54:34 +08:00
|
|
|
See changes: https://github.com/milvus-io/milvus/commit/${{ github.sha }}
|
2021-07-13 15:12:27 +08:00
|
|
|
Signed-off-by: ${{ github.actor }} ${{ github.actor }}@users.noreply.github.com
|
|
|
|
- name: Check outputs
|
2021-07-13 15:22:43 +08:00
|
|
|
if: success() && github.event_name == 'push' && github.repository == 'milvus-io/milvus'
|
2021-07-12 18:11:32 +08:00
|
|
|
run: |
|
2021-07-13 15:12:27 +08:00
|
|
|
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
|
|
|
|
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
|