Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/deployment adjustments #4041

Merged
merged 4 commits into from
Sep 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: deploy

on:
workflow_call:
inputs:
envname:
required: true
type: string
deploy_path:
required: true
type: string
secrets:
host:
required: true
user:
required: true
private_key:
required: true

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: "14.x"
- name: Install dependencies
run: npm install
- name: Run build
run: npm run build
- name: Find and Replace
uses: jacobtomlinson/gha-find-replace@v2
env:
replacement_string: ${{ format('{0} - commit <a href="https://github.com/Dash-Industry-Forum/dash.js/commit/{1}">{2}</a>', github.ref_name, github.sha, github.sha)}}
with:
find: "<!-- commit-info -->"
replace: ${{env.replacement_string}}
include: "samples/dash-if-reference-player/index.html"
- name: Copy to deploy directory for deployment
run: |
mkdir ${{inputs.envname}}
cp -R contrib dist samples test/functional/config test/functional/tests ${{inputs.envname}}
- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.private_key }}
known_hosts: unnecessary

- name: Deploy with rsync
run: rsync -av -e "ssh -o StrictHostKeyChecking=no -oHostKeyAlgorithms=+ssh-dss" ${{inputs.envname}} ${{ secrets.user }}@${{ secrets.host }}:${{ inputs.deploy_path }}
17 changes: 17 additions & 0 deletions .github/workflows/deploy_latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: deploy

on:
push:
branches:
- 'master'

jobs:
deploy_staging:
uses: ./.github/workflows/deploy.yml
with:
envname: latest
deploy_path: '/377335/dash.js'
secrets:
host: ${{secrets.HOST}}
user: ${{secrets.USER}}
private_key: ${{secrets.PRIVATE_KEY}}
17 changes: 17 additions & 0 deletions .github/workflows/deploy_nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: deploy

on:
push:
branches:
- 'development'

jobs:
deploy_staging:
uses: ./.github/workflows/deploy.yml
with:
envname: nightly
deploy_path: '/377335/dash.js'
secrets:
host: ${{secrets.HOST}}
user: ${{secrets.USER}}
private_key: ${{secrets.PRIVATE_KEY}}
8 changes: 4 additions & 4 deletions src/dash/controllers/ContentSteeringController.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ function ContentSteeringController() {
}

function loadSteeringData() {
return new Promise((resolve, reject) => {
return new Promise((resolve) => {
try {
const steeringDataFromManifest = getSteeringDataFromManifest();
if (!steeringDataFromManifest || !steeringDataFromManifest.serverUrl) {
Expand All @@ -158,11 +158,11 @@ function ContentSteeringController() {
},
error: (e) => {
_handleSteeringResponseError(e);
reject(e);
resolve(e);
}
});
} catch (e) {
reject(e);
resolve(e);
}
})
}
Expand Down Expand Up @@ -232,7 +232,7 @@ function ContentSteeringController() {

function _startSteeringRequestTimer() {
// Start timer for next request
if (currentSteeringResponseData.ttl && !isNaN(currentSteeringResponseData.ttl)) {
if (currentSteeringResponseData && currentSteeringResponseData.ttl && !isNaN(currentSteeringResponseData.ttl)) {
if (nextRequestTimer) {
clearTimeout(nextRequestTimer);
}
Expand Down