Skip to content

Commit

Permalink
[cicd][SRE-362]: pipeline action on develop branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Pattarapont committed Dec 13, 2023
1 parent 705a36e commit d7d93e7
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 175 deletions.
11 changes: 0 additions & 11 deletions .deployment/.env.development

This file was deleted.

31 changes: 20 additions & 11 deletions .deployment/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,42 @@ networks:

volumes:
ome_config:
name: ome-config
name: ome_config
ome_edge:
name: ome-edge
ome-logs:
name: ome-logs
name: ome_edge
ome_logs:
name: ome_logs

services:
${SERVICE_NAME}:
image: ${IMAGE_NAME}:${IMAGE_TAG}
container_name: ${SERVICE_NAME}
volumes:
- ome_config:/opt/ovenmediaengine/bin/origin_conf
- ome_dege:/opt/ovenmediaengine/bin/edge_conf
- ome_edge:/opt/ovenmediaengine/bin/edge_conf
- ome_logs:/var/log/ovenmediaengine
ports:
- "9999:9999/udp"
- "3478:3478"
- "10000-10009:10000-10009/udp"
- "1935:1935" # RTMP
- "4000-4999:4000-4999/udp" # WebRTC, MPEG-TS, SRT
- "4000-4999:4000-4999/tcp" # WebRTC, MPEG-TS, SRT
- "8081:8081"
- "8080:8080" # HTTP
- "39000:9000" # HTTPS
#- "39000:9000" # HTTPS
- "8081:8081"
- "3333:3333" # OVT
#- "9999:9999/udp"
#- "10000-10009:10000-10009/udp"
# - "4000-4999:4000-4999/udp" # WebRTC, MPEG-TS, SRT
# - "4000-4999:4000-4999/tcp" # WebRTC, MPEG-TS, SRT
env_file:
- ./.env.compose
restart: unless-stopped
networks:
- proxy
deploy:
resources:
reservations:
cpus: '1.5'
memory: 2048M
limits:
cpus: '2'
memory: 3072M

137 changes: 0 additions & 137 deletions .github/workflows/development.yaml

This file was deleted.

37 changes: 21 additions & 16 deletions .github/workflows/sandbox.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ on:
push:
branches:
- develop
- feature/SRE-362-github-actions

env:
# Manage your service
Expand All @@ -13,13 +12,14 @@ env:
ENVIRONMENT_NAME: sandbox
DOCKERFILE: ./Dockerfile
DOCKER_COMPOSE: .deployment/docker-compose.yaml
COMPOSE_ENV_FILE: .deployment/.env.sandbox
DOCKER_COMPOSE_DEPLOY: .deployment/compose-deploy.yaml
COMPOSE_ENV_FILE: .deployment/.env
COMPOSE_APP_ENV_FILE: .deployment/.env.compose

jobs:
dockerize:
name: Build and Push Docker image to Registry
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
environment: sandbox
steps:
-
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:
deploy:
name: Deploy Sandbox Service
runs-on: [self-hosted, linux, x64, staging, hybiot, internal]
runs-on: [self-hosted, linux, x64, ome-poc, hybiot, internal]
environment: sandbox
needs:
- dockerize
Expand Down Expand Up @@ -100,22 +100,27 @@ jobs:
-
name: Create env Docker-Compose
run: |
touch ${{ env.COMPOSE_ENV_FILE }}
echo '' > ${{ env.COMPOSE_ENV_FILE }}
echo IMAGE_NAME=ghcr.io/${{ steps.repository.outputs.lowercase }} >> ${{ env.COMPOSE_ENV_FILE }}
echo IMAGE_TAG=${{ env.sha_short }} >> ${{ env.COMPOSE_ENV_FILE }}
echo SERVICE_NAME=${{ env.SERVICE_NAME }} >> ${{ env.COMPOSE_ENV_FILE }}
touch ${{ env.COMPOSE_APP_ENV_FILE }}
cat .deployment/.env.${{ env.COMPOSE_ENV_FILE }} >> ${{ env.COMPOSE_APP_ENV_FILE }}
cat .deployment/.env.${{ env.ENVIRONMENT_NAME }} >> ${{ env.COMPOSE_APP_ENV_FILE }}
envsubst < ${{ env.DOCKER_COMPOSE }} > ${{ env.DOCKER_COMPOSE_DEPLOY }}
env:
IMAGE_NAME: ghcr.io/${{ steps.repository.outputs.lowercase }}
IMAGE_TAG: ${{ env.sha_short }}
SERVICE_NAME: ${{ env.SERVICE_NAME }}
-
name: Docker-Compose Deploy
uses: alex-ac/github-action-ssh-docker-compose@master
with:
ssh_host: "10.100.100.12"
ssh_user: "root"
ssh_port: "22"
ssh_private_key: ${{ secrets.PIPELINE_DEPLOY_KEY }}
docker_compose_prefix: ${{ env.SERVICE_NAME }}
docker_compose_filename: ${{ env.DOCKER_COMPOSE }}
-
name: Starting docker compose services
run: |
docker compose -f ${{ env.DOCKER_COMPOSE_DEPLOY }} pull
docker compose -f ${{ env.DOCKER_COMPOSE_DEPLOY }} up -d
docker ps -a
env:
COMPOSE_HTTP_TIMEOUT: 600
SERVICE_NAME: ${{ env.SERVICE_NAME }}

notify:
name: Discord Notification
Expand All @@ -135,4 +140,4 @@ jobs:
include-details: 'true'
color-success: '#1a7f37'
color-failure: '#cf222e'
color-cancelled: '#7c848d'
color-cancelled: '#7c848d'

0 comments on commit d7d93e7

Please sign in to comment.