-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #502 from Sunbird-Knowlg/release-5.1.0
Merge Release 5.1.0 into Master
- Loading branch information
Showing
655 changed files
with
226,563 additions
and
52,627 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,42 +3,55 @@ jobs: | |
build: | ||
working_directory: ~/content-player/player | ||
docker: | ||
- image: circleci/node:6.10-browsers | ||
environment: | ||
player_version_number: $CIRCLE_BRANCH | ||
build_number: $CIRCLE_BUILD_NUM | ||
filter_plugins: false | ||
|
||
- image: circleci/node:12.0.0 | ||
steps: | ||
- checkout: | ||
path: ~/content-player | ||
- restore_cache: | ||
key: dependency-cache-{{ checksum "package.json" }} | ||
|
||
- run: | ||
name: clone plugins | ||
command: | | ||
prnumber=$(echo $CI_PULL_REQUEST | awk -F'/' '{print $NF}') | ||
prdata=$(curl -X GET -u $GITHUB_USER_TOKEN:x-oauth-basic https://api.github.com/repos/project-sunbird/sunbird-content-player/pulls/$prnumber) | ||
target_branch=$(echo "${prdata}" | jq -r '.base.ref') | ||
git clone https://github.com/project-sunbird/sunbird-content-plugins.git plugins -b $target_branch | ||
#- run: git clone https://github.com/project-sunbird/sunbird-content-plugins.git plugins -b $CIRCLE_BRANCH | ||
- run: sudo npm install -g [email protected] codacy-coverage | ||
|
||
- run: sudo npm install -g [email protected] | ||
- run: git config --global url."https://".insteadOf git:// | ||
- run: npm install | ||
- run: npm run build-preview ekstep | ||
- run: grunt compress:preview | ||
- run: grunt generate-libs | ||
- run: grunt build-jsdoc | ||
|
||
#- store_artifacts: | ||
#path: /tmp | ||
#destination: | ||
|
||
- save_cache: | ||
key: dependency-cache-{{ checksum "package.json" }} | ||
paths: ./node_modules | ||
# - run: grunt build-jsdoc | ||
|
||
# | ||
# - run: | ||
# name: running test cases | ||
# command: npm run test-player | ||
|
||
- run: | ||
name: Install NVM | ||
command: 'curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh|bash' | ||
|
||
- run: | ||
name: alter node version | ||
command: 'source ~/.nvm/nvm.sh && nvm install 8 && nvm use 8 && nvm alias default 8 && node -v' | ||
|
||
- run: | ||
name: Install sonar scanner | ||
command: 'source ~/.nvm/nvm.sh && sudo npm install -g sonarqube-scanner' | ||
|
||
- run: | ||
name: Sonar scanner | ||
command: source ~/.nvm/nvm.sh | | ||
sonar-scanner -Dsonar.projectKey=project-sunbird_sunbird-content-player -Dsonar.organization=project-sunbird -Dsonar.sources=. -Dsonar.host.url=https://sonarcloud.io -Dsonar.language=js | ||
|
||
- run: | ||
name: Publish to NPM | ||
command: | | ||
if [ -z $CIRCLE_PR_NUMBER ]; then | ||
commit_hash=$(echo $CIRCLE_SHA1 | cut -c 1-7) | ||
npm version prerelease --preid=alpha-${commit_hash} | ||
npm run build-npm-package | ||
npm set //registry.npmjs.org/:_authToken=$NPM_TOKEN | ||
npm pack ./www/preview | ||
npm publish project-sunbird-content-player-* | ||
else | ||
npm run build-npm-package | ||
fi | ||
workflows: | ||
version: 2.1 | ||
build_and_test: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# Github action configuration runs functional test cases and generate artifact's | ||
# Author: Rahul Shukla <[email protected]> | ||
|
||
|
||
name: Sunbird-Content-Player-Functional-Test | ||
|
||
# Trigger the workflow on push or pull request | ||
on: [push, pull_request] | ||
jobs: | ||
build: | ||
runs-on: macOS-latest | ||
strategy: | ||
matrix: | ||
node-version: [10.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Install player dependencies | ||
run: | | ||
(git config --global url."https://".insteadOf git:// && cd player && npm install && npm install -g forever) | ||
# - name: Build player preview | ||
# run: | | ||
# (cd player && npm run package-coreplugins -- --env.channel=sunbird && npm run build-preview sunbird) | ||
|
||
- name: Start player with fixture stories | ||
run: | | ||
(cd player && forever start app.js) | ||
|
||
- name: Install test framework dependencies | ||
run: | | ||
(cd player/public/test/functional_test && yarn install) | ||
- name: Start functional test cases | ||
run: | | ||
(cd player/public/test/functional_test && yarn test) | ||
# - name: Visual regression artifact generation | ||
# uses: actions/upload-artifact@v1 | ||
# with: | ||
# name: Visual changes on UI | ||
# path: player/public/test/functional_test/__tests__/__image_snapshots__ | ||
|
||
# - name: Screenshots artifact generation | ||
# uses: actions/upload-artifact@v1 | ||
# with: | ||
# name: Screenshots | ||
# path: player/public/test/functional_test/__tests__/screenshots | ||
|
||
- name: Report artifact generation | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: Report HTML | ||
path: player/public/test/functional_test/testReport | ||
|
||
# - name: Player preview artifact generation | ||
# uses: actions/upload-artifact@v1 | ||
# with: | ||
# name: Generated Player preview | ||
# path: player/www | ||
|
||
env: | ||
CI: true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
@Library('deploy-conf') _ | ||
node() { | ||
try { | ||
String ANSI_GREEN = "\u001B[32m" | ||
String ANSI_NORMAL = "\u001B[0m" | ||
String ANSI_BOLD = "\u001B[1m" | ||
String ANSI_RED = "\u001B[31m" | ||
String ANSI_YELLOW = "\u001B[33m" | ||
|
||
ansiColor('xterm') { | ||
stage('Checkout') { | ||
tag_name = env.JOB_NAME.split("/")[-1] | ||
pre_checks() | ||
cleanWs() | ||
def scmVars = checkout scm | ||
checkout scm: [$class: 'GitSCM', branches: [[name: "refs/tags/$tag_name"]], userRemoteConfigs: [[url: scmVars.GIT_URL]]] | ||
commit_hash = sh(script: 'git rev-parse --short HEAD', returnStdout: true).trim() | ||
artifact_version = tag_name | ||
branch_name = tag_name.split('_')[0].split('\\.')[0] + "." + tag_name.split('_')[0].split('\\.')[1] | ||
} | ||
echo "artifact_version: " + artifact_version | ||
|
||
// stage Build | ||
sh """#!/bin/bash | ||
export NVM_DIR="\$HOME/.nvm" | ||
[ -s "\$NVM_DIR/nvm.sh" ] && source "\$NVM_DIR/nvm.sh" # This loads nvm | ||
[ -s "\$NVM_DIR/bash_completion" ] && source "\$NVM_DIR/bash_completion" # This loads nvm bash_completion | ||
nvm install 10.16.3 | ||
export player_version_number=${branch_name} | ||
export build_number=${commit_hash} | ||
export filter_plugins=false # For the preview build generation dont split the plugins. | ||
cd player | ||
npm install | ||
npm run build-preview ekstep | ||
grunt compress:preview | ||
grunt generate-libs | ||
#grunt renderer-test | ||
#grunt build-jsdoc | ||
""" | ||
|
||
// stage ArchiveArtifacts | ||
sh """ | ||
mkdir CR_Preview_Artifacts | ||
cp player/preview.zip CR_Preview_Artifacts | ||
#cp player/libs.zip CR_Preview_Artifacts | ||
zip -j CR_Preview_Artifacts.zip:${artifact_version} CR_Preview_Artifacts/* | ||
""" | ||
archiveArtifacts "CR_Preview_Artifacts.zip:${artifact_version}" | ||
sh """echo {\\"artifact_name\\" : \\"CR_Preview_Artifacts.zip\\", \\"artifact_version\\" : \\"${artifact_version}\\", \\"node_name\\" : \\"${env.NODE_NAME}\\"} > metadata.json""" | ||
archiveArtifacts artifacts: 'metadata.json', onlyIfSuccessful: true | ||
currentBuild.description = "${artifact_version}" | ||
|
||
} | ||
currentBuild.result = "SUCCESS" | ||
slack_notify(currentBuild.result, tag_name) | ||
email_notify() | ||
auto_build_deploy() | ||
} | ||
catch (err) { | ||
currentBuild.result = "FAILURE" | ||
slack_notify(currentBuild.result, tag_name) | ||
email_notify() | ||
throw err | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.