-
Notifications
You must be signed in to change notification settings - Fork 6
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 #348 from DeForce/develop
Release 0.3.6
- Loading branch information
Showing
105 changed files
with
3,238 additions
and
1,147 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
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 |
---|---|---|
@@ -1,31 +1,20 @@ | ||
language: generic | ||
sudo: true | ||
|
||
addons: | ||
apt: | ||
packages: | ||
- xvfb | ||
|
||
services: | ||
- docker | ||
|
||
branches: | ||
only: | ||
- develop | ||
|
||
env: | ||
- TEST_SUITE="runtime" | ||
- TEST_SUITE="pylint" | ||
- TEST_SUITE="jslint" | ||
- TEST_SUITE="csslint" | ||
- TEST_SUITE="eslint" | ||
- TEST_SUITE="scsslint" | ||
|
||
matrix: | ||
fast_finish: true | ||
fast_finish: false | ||
allow_failures: | ||
env: | ||
- TEST_SUITE="pylint" | ||
- TEST_SUITE="jslint" | ||
- TEST_SUITE="csslint" | ||
- TEST_SUITE="eslint" | ||
- TEST_SUITE="scsslint" | ||
|
||
script: | ||
- ./travis/main.sh | ||
- ./travis.sh |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,170 @@ | ||
import groovy.json.JsonBuilder | ||
import groovy.json.JsonSlurperClassic | ||
|
||
node('docker-host') { | ||
stage('Checkout') { | ||
checkout scm | ||
sh 'mkdir -p results' | ||
sh 'rsync -avz src/jenkins/root/ ./' | ||
} | ||
def stable = true | ||
try { | ||
def containersToBuild = [] | ||
stage('Prepare Docker containers') { | ||
sh 'python src/scripts/docker_build.py' | ||
def ContainerFile = readFile('docker/build_order.json') | ||
def ContainerMap = mapToList(new JsonSlurperClassic().parseText(ContainerFile)) | ||
for (architecture in ContainerMap) { | ||
def archName = architecture.getKey() | ||
def archData = architecture.getValue() | ||
echo "Running builds for ${archName}" | ||
stage(archName) { | ||
for (image in archData) { | ||
echo "Building ${image} from ${archName}" | ||
def buildName = "deforce/lc-${archName}-${image}" | ||
buildDockerImage(archName, image, buildName) | ||
if (image.equals('testing')) { | ||
containersToBuild.add(buildName) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
stage('PreBuild') { | ||
def container = containersToBuild[0] | ||
stage(container) { | ||
echo "Running Build for ${container}" | ||
def docker_image = docker.image(container) | ||
docker_image.inside { | ||
stage('Themes') { | ||
buildThemes() | ||
junit 'results/javascript-tests/*.xml' | ||
} | ||
stage('Configuration') { | ||
sh '/bin/sh src/jenkins/prep_config.sh' | ||
} | ||
} | ||
} | ||
} | ||
stage('Testing') { | ||
def lintRun = false | ||
for (container in containersToBuild) { | ||
stage(container) { | ||
echo "Running Build for ${container}" | ||
def docker_image = docker.image(container) | ||
docker_image.inside { | ||
try { | ||
stage('Run Chat') { | ||
sh '/bin/sh src/jenkins/run_chat.sh' | ||
sh 'ps aux | grep -v grep | grep main.py' | ||
} | ||
stage('Run Tests') { | ||
stage('Chat Tests') { | ||
runTests('src/jenkins/chat_tests', 'chat', false) | ||
} | ||
} | ||
stage('Lint Tests') { | ||
try { | ||
if(!lintRun) { | ||
runTests('src/jenkins/lint_tests', 'lint', true) | ||
lintRun = true | ||
} | ||
} catch(exc) { | ||
stable = false | ||
} | ||
} | ||
} finally { | ||
sh 'cat chat.log' | ||
archive 'results/**' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
stage('Build') { | ||
if (env.BRANCH_NAME == 'develop' || env.BRANCH_NAME == 'master') { | ||
def ZipName = env.BUILD_TAG.replace('jenkins-', '') | ||
echo ZipName | ||
def container = 'deforce/ubuntu-builder' | ||
sh "cp requires_windows.txt requirements.txt" | ||
def binariesLocation = "http://repo.intra.czt.lv/lalkachat/" | ||
sh "wget -r --cut-dirs=1 -nH -np --reject index.html ${binariesLocation} " | ||
sh "docker run -v \"\$(pwd):/src/\" ${container}" | ||
sh "sh src/jenkins/build_default_themes.sh" | ||
sh "cp -r http/ dist/windows/main/http/" | ||
sh "chmod a+x -R dist/windows/main/" | ||
sh "mv dist/windows/main dist/windows/LalkaChat" | ||
dir('dist/windows/') { | ||
sh "zip -r ${ZipName}.zip LalkaChat" | ||
} | ||
archive "dist/windows/${ZipName}.zip" | ||
sh "chmod 664 dist/windows/${ZipName}.zip" | ||
def UploadPath = "[email protected]:/usr/local/nginx/html/czt.lv/lalkachat/" | ||
sh "scp dist/windows/${ZipName}.zip ${UploadPath}" | ||
} | ||
} | ||
} | ||
finally { | ||
stage('Cleanup') { | ||
if(!stable) { | ||
currentBuild.result = 'UNSTABLE' | ||
} | ||
sh 'rm -rf dist/' | ||
sh 'docker rmi -f $(docker images | grep \'^<none>\' | awk \'{print \$3}\') || true' | ||
deleteDir() | ||
} | ||
} | ||
} | ||
|
||
def buildThemes() { | ||
// Creates themes.json | ||
sh 'python src/jenkins/get_themes.py' | ||
def ThemesJson = readFile('themes.json') | ||
def ThemesList = new JsonSlurperClassic().parseText(ThemesJson) | ||
echo "${ThemesList}" | ||
for (def Theme : ThemesList) { | ||
sh "/bin/sh src/jenkins/test_theme.sh ${Theme}" | ||
sh "/bin/sh src/jenkins/build_theme.sh ${Theme}" | ||
} | ||
} | ||
|
||
def runTests(folder, name, skip) { | ||
sh "python src/jenkins/get_folder_tests.py ${folder} ${name}" | ||
def TestJson = readFile("${name}_tests.json") | ||
def TestsList = new JsonSlurperClassic().parseText(TestJson) | ||
def TestResults = [:] | ||
for (def Test : TestsList) { | ||
echo "Running ${Test} test" | ||
def result = false | ||
try { | ||
def Test_Name = Test.split('/').last().split("\\.").first() | ||
if(Test.endsWith('.py')) { | ||
sh "set -o pipefail && python ${Test} 2>&1 | tee results/${name}_${Test_Name}_results.txt" | ||
} else { | ||
sh "set -o pipefail && /bin/bash ${Test} 2>&1 | tee results/${name}_${Test_Name}_results.txt" | ||
} | ||
result = true | ||
} catch(exc) { | ||
if(!skip) { | ||
error('Test didn\'t pass') | ||
} | ||
} | ||
finally { | ||
TestResults[Test] = result | ||
} | ||
} | ||
writeFile(file: "results/${name}_test.txt", text: new JsonBuilder(TestResults).toPrettyString()) | ||
} | ||
|
||
def buildDockerImage(archName, image, buildName) { | ||
sh "docker build -t ${buildName} -f docker/dockerfiles/${archName}/${image}/Dockerfile ." | ||
} | ||
|
||
@NonCPS | ||
def mapToList(depmap) { | ||
def dlist = [] | ||
for (def entry2 in depmap) { | ||
dlist.add(new java.util.AbstractMap.SimpleImmutableEntry(entry2.key, entry2.value)) | ||
} | ||
dlist | ||
} |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,12 @@ | ||
FROM deforce/lc-alpine-wxpython | ||
|
||
MAINTAINER CzT/DeForce <[email protected]> | ||
|
||
# Misc Packages | ||
RUN apk --update add build-base bzip2 git libstdc++ openssl-dev tar wget wxgtk-dev xz | ||
|
||
# Deps for chat | ||
RUN apk --update add py2-pip python2-dev | ||
COPY requires_linux.txt /root/ | ||
RUN pip install -r /root/requires_linux.txt | ||
|
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 @@ | ||
["wxpython", "build-deps", "testing"] |
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,8 @@ | ||
FROM deforce/lc-alpine-build-deps | ||
|
||
MAINTAINER CzT/DeForce <[email protected]> | ||
|
||
# Deps for testing | ||
RUN apk --update add curl bash nodejs-npm rsync | ||
RUN pip install git-lint pep8 pylint | ||
RUN npm install -g csslint |
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,20 @@ | ||
FROM alpine:edge | ||
|
||
MAINTAINER CzT/DeForce <[email protected]> | ||
|
||
RUN echo "http://nl.alpinelinux.org/alpine/edge/main" >> /etc/apk/repositories | ||
RUN echo "http://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories | ||
RUN echo "http://nl.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories | ||
RUN apk --update add font-misc-misc libgcc mesa-gl python2 wxgtk | ||
RUN apk --update add --virtual build-deps build-base bzip2 libstdc++ python2-dev tar wget wxgtk-dev xz | ||
|
||
ENV WXPY_SRC_URL="http://nchc.dl.sourceforge.net/project/wxpython/wxPython/3.0.2.0/wxPython-src-3.0.2.0.tar.bz2" | ||
RUN wget -qO- "${WXPY_SRC_URL}" | tar xj -C /tmp/ && \ | ||
cd /tmp/wxPython-src-* && \ | ||
cd ./wxPython && \ | ||
python ./setup.py build && \ | ||
python ./setup.py install && \ | ||
|
||
apk del build-deps && \ | ||
rm -rf /var/cache/* /tmp/* /var/log/* ~/.cache && \ | ||
mkdir -p /var/cache/apk |
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,9 @@ | ||
FROM fedora | ||
|
||
# Misc packages | ||
RUN dnf -y install pwgen tar psmisc procps findutils iputils net-tools wget logrotate zip findutils git | ||
|
||
# Dependancies for LalkaChat | ||
COPY requires_linux.txt /root/ | ||
RUN dnf -y install wxPython | ||
RUN pip install -r /root/requires_linux.txt |
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 @@ | ||
["build-deps", "testing"] |
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,6 @@ | ||
FROM deforce/lc-fedora-build-deps | ||
|
||
# Dependancies for Testing | ||
RUN dnf -y install nodejs | ||
RUN pip install git-lint pep8 pylint | ||
RUN npm install -g csslint |
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 @@ | ||
["builder"] |
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,10 @@ | ||
FROM cdrx/pyinstaller-windows:python2 | ||
|
||
MAINTAINER CzT/DeForce <[email protected]> | ||
|
||
RUN apt-get install -y xvfb | ||
RUN wget -qO /root/wxpython.exe http://downloads.sourceforge.net/wxpython/wxPython3.0-win32-3.0.2.0-py27.exe | ||
RUN (Xvfb :1 -screen 0 800x600x24&) && \ | ||
sleep 3 && \ | ||
DISPLAY=:1 wine /root/wxpython.exe /SP- /VERYSILENT && \ | ||
rm -rf /tmp/.wine-* |
Oops, something went wrong.