Skip to content

Commit

Permalink
Merge branch 'release-6.5.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Andre Machado committed Jun 19, 2020
2 parents b9ee65e + 7d18f18 commit af8baaf
Show file tree
Hide file tree
Showing 3 changed files with 153 additions and 2 deletions.
151 changes: 151 additions & 0 deletions .Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
pipeline {
agent {
label 'builder'
}
stages {
stage('Resolve TAO dependencies') {
environment {
GITHUB_ORGANIZATION='oat-sa'
REPO_NAME='oat-sa/extension-tao-group'
}
steps {
sh(
label : 'Create build build directory',
script: 'mkdir -p build'
)

withCredentials([string(credentialsId: 'jenkins_github_token', variable: 'GIT_TOKEN')]) {
sh(
label : 'Run the Dependency Resolver',
script: '''
changeBranch=$CHANGE_BRANCH
TEST_BRANCH="${changeBranch:-$BRANCH_NAME}"
echo "select branch : ${TEST_BRANCH}"
docker run --rm \\
-e "GITHUB_ORGANIZATION=${GITHUB_ORGANIZATION}" \\
-e "GITHUB_SECRET=${GIT_TOKEN}" \\
tao/dependency-resolver oat:dependencies:resolve --main-branch ${TEST_BRANCH} --repository-name ${REPO_NAME} > build/dependencies.json

cat > build/composer.json <<- composerjson
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/${REPO_NAME}",
"no-api": true
}
],
composerjson
tail -n +2 build/dependencies.json >> build/composer.json
'''
)
sh(
label: 'composer.json',
script: 'cat build/composer.json'
)
}
}
}
stage('Install') {
agent {
docker {
image 'alexwijn/docker-git-php-composer'
args "-v $BUILDER_CACHE_DIR/composer:/tmp/.composer-cache -e COMPOSER_CACHE_DIR=/tmp/.composer-cache"
reuseNode true
}
}
environment {
HOME = '.'
}
options {
skipDefaultCheckout()
}
steps {
dir('build') {
sh(
label: 'Install/Update sources from Composer',
script: 'COMPOSER_DISCARD_CHANGES=true composer install --prefer-dist --no-interaction --no-ansi --no-progress --no-suggest'
)
sh(
label: 'Add phpunit',
script: 'composer require phpunit/phpunit:^8.5 --no-progress'
)
sh(
label: "Extra filesystem mocks",
script: '''
mkdir -p taoQtiItem/views/js/mathjax/ && touch taoQtiItem/views/js/mathjax/MathJax.js
mkdir -p tao/views/locales/en-US/
echo "{\\"serial\\":\\"${BUILD_ID}\\",\\"date\\":$(date +%s),\\"version\\":\\"3.3.0-${BUILD_NUMBER}\\",\\"translations\\":{}}" > tao/views/locales/en-US/messages.json
mkdir -p tao/views/locales/en-US/
'''
)
}
}
}
stage('Tests') {
parallel {
stage('Backend Tests') {
when {
expression {
fileExists('build/taoGroups/test/unit')
}
}
agent {
docker {
image 'alexwijn/docker-git-php-composer'
reuseNode true
}
}
options {
skipDefaultCheckout()
}
steps {
dir('build'){
sh(
label: 'Run backend tests',
script: './vendor/bin/phpunit taoGroups/test/unit'
)
}
}
}
stage('Frontend Tests') {
when {
expression {
fileExists('build/taoGroups/views/build/grunt/test.js')
}
}
agent {
docker {
image 'btamas/puppeteer-git'
args "-v $BUILDER_CACHE_DIR/npm:/tmp/.npm-cache -e npm_config_cache=/tmp/.npm-cache"
reuseNode true
}
}
environment {
HOME = '.'
}
options {
skipDefaultCheckout()
}
steps {
dir('build/tao/views/build') {
sh(
label: 'Install tao-core frontend extensions',
script: 'npm install'
)
sh (
label : 'Run frontend tests',
script: 'npx grunt connect:test taogroupstest'
)
}
}
}
}
}
}
post {
always {
cleanWs disableDeferredWipeout: true
}
}
}
2 changes: 1 addition & 1 deletion manifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
'label' => 'Groups core extension',
'description' => 'TAO Groups extension',
'license' => 'GPL-2.0',
'version' => '6.4.0',
'version' => '6.5.1',
'author' => 'Open Assessment Technologies, CRP Henri Tudor',
'requires' => [
'taoTestTaker' => '>=4.0.0',
Expand Down
2 changes: 1 addition & 1 deletion models/update/Updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,6 @@ public function update($initialVersion)
$this->setVersion('3.0.1');
}

$this->skip('3.0.1', '6.4.0');
$this->skip('3.0.1', '6.5.1');
}
}

0 comments on commit af8baaf

Please sign in to comment.