Added CI workflow to publish CVAT images (#2766)
* Configured CI workflow for public images * updated license headers * align list item indent rule for remarklint and prettier * updated changelog Co-authored-by: Nikita Manovich <nikita.manovich@intel.com>main
parent
9a56e7edd5
commit
108947fbce
@ -0,0 +1,54 @@
|
|||||||
|
name: Publish Docker images
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build_and_push_to_registry:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: 12
|
||||||
|
|
||||||
|
- name: Build images
|
||||||
|
run: |
|
||||||
|
CLAM_AV=yes INSTALL_SOURCES=yes docker-compose -f docker-compose.yml -f docker-compose.dev.yml -f docker-compose.ci.yml build
|
||||||
|
|
||||||
|
- name: Run unit tests
|
||||||
|
env:
|
||||||
|
HOST_COVERAGE_DATA_DIR: ${{ github.workspace }}
|
||||||
|
CONTAINER_COVERAGE_DATA_DIR: '/coverage_data'
|
||||||
|
DJANGO_SU_NAME: 'admin'
|
||||||
|
DJANGO_SU_EMAIL: 'admin@localhost.company'
|
||||||
|
DJANGO_SU_PASSWORD: '12qwaszx'
|
||||||
|
run: |
|
||||||
|
docker-compose -f docker-compose.yml -f docker-compose.dev.yml -f docker-compose.ci.yml run cvat_ci /bin/bash -c 'coverage run -a manage.py test cvat/apps utils/cli'
|
||||||
|
docker-compose -f docker-compose.yml -f docker-compose.dev.yml -f docker-compose.ci.yml run cvat_ci /bin/bash -c 'cd cvat-data && npm ci && cd ../cvat-core && npm ci && npm run test'
|
||||||
|
docker-compose up -d
|
||||||
|
docker exec -i cvat /bin/bash -c "echo \"from django.contrib.auth.models import User; User.objects.create_superuser('${DJANGO_SU_NAME}', '${DJANGO_SU_EMAIL}', '${DJANGO_SU_PASSWORD}')\" | python3 ~/manage.py shell"
|
||||||
|
|
||||||
|
- name: Run end-to-end tests
|
||||||
|
run: |
|
||||||
|
cd ./tests
|
||||||
|
npm ci
|
||||||
|
npx cypress run --headless --browser chrome
|
||||||
|
- name: Login to Docker Hub
|
||||||
|
uses: docker/login-action@v1
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
- name: Push to Docker Hub
|
||||||
|
env:
|
||||||
|
DOCKERHUB_WORKSPACE: 'openvino'
|
||||||
|
SERVER_IMAGE_REPO: 'cvat_server'
|
||||||
|
UI_IMAGE_REPO: 'cvat_ui'
|
||||||
|
run: |
|
||||||
|
docker tag "${DOCKERHUB_WORKSPACE}/${SERVER_IMAGE_REPO}:latest" "${DOCKERHUB_WORKSPACE}/${SERVER_IMAGE_REPO}:${{ github.event.release.tag_name }}"
|
||||||
|
docker push "${DOCKERHUB_WORKSPACE}/${SERVER_IMAGE_REPO}:${{ github.event.release.tag_name }}"
|
||||||
|
docker push "${DOCKERHUB_WORKSPACE}/${SERVER_IMAGE_REPO}:latest"
|
||||||
|
|
||||||
|
docker tag "${DOCKERHUB_WORKSPACE}/${UI_IMAGE_REPO}:latest" "${DOCKERHUB_WORKSPACE}/${UI_IMAGE_REPO}:${{ github.event.release.tag_name }}"
|
||||||
|
docker push "${DOCKERHUB_WORKSPACE}/${UI_IMAGE_REPO}:${{ github.event.release.tag_name }}"
|
||||||
|
docker push "${DOCKERHUB_WORKSPACE}/${UI_IMAGE_REPO}:latest"
|
||||||
@ -0,0 +1,31 @@
|
|||||||
|
#
|
||||||
|
# Copyright (C) 2021 Intel Corporation
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: MIT
|
||||||
|
#
|
||||||
|
version: '3.3'
|
||||||
|
|
||||||
|
services:
|
||||||
|
cvat:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
args:
|
||||||
|
http_proxy:
|
||||||
|
https_proxy:
|
||||||
|
no_proxy: nuclio,${no_proxy}
|
||||||
|
socks_proxy:
|
||||||
|
USER: 'django'
|
||||||
|
DJANGO_CONFIGURATION: 'production'
|
||||||
|
TZ: 'Etc/UTC'
|
||||||
|
CLAM_AV:
|
||||||
|
INSTALL_SOURCES:
|
||||||
|
|
||||||
|
cvat_ui:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
args:
|
||||||
|
http_proxy:
|
||||||
|
https_proxy:
|
||||||
|
no_proxy:
|
||||||
|
socks_proxy:
|
||||||
|
dockerfile: Dockerfile.ui
|
||||||
Loading…
Reference in New Issue