Skip to content

Commit

Permalink
Merge pull request #348 from DeForce/develop
Browse files Browse the repository at this point in the history
Release 0.3.6
  • Loading branch information
DeForce authored Mar 27, 2017
2 parents 39d9d7f + 33f5a62 commit a91fe87
Show file tree
Hide file tree
Showing 105 changed files with 3,238 additions and 1,147 deletions.
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ levels.db*
/dist
/libs
/conf
*.spec
*.log
govno_rutony.py
/node_modules/
/http
/http
**/dist
**/node_modules
*.gdsl
modules/**/test*
23 changes: 6 additions & 17 deletions .travis.yml
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
26 changes: 0 additions & 26 deletions Dockerfile

This file was deleted.

13 changes: 0 additions & 13 deletions Dockerfile_test

This file was deleted.

170 changes: 170 additions & 0 deletions Jenkinsfile
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 = "jenkins@czt.lv:/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
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# LalkaChat [![Build Status](https://travis-ci.org/DeForce/LalkaChat.svg?branch=develop)](https://travis-ci.org/DeForce/LalkaChat)
# LalkaChat [![Build Status](http://jenkins.czt.lv/job/LalkaChat/job/develop/badge/icon)](http://jenkins.czt.lv/job/LalkaChat/job/develop/)

LalkaChat is a program for displaying multiple chats from services is one place.
It's cross-platform and highly configurable. You can set the style of the chat, so it can look differently and you can tweak a lot of the settings.
Expand Down
Empty file removed changelog
Empty file.
28 changes: 0 additions & 28 deletions docker/Dockerfiles/alpine-wxpython/Dockerfile

This file was deleted.

7 changes: 0 additions & 7 deletions docker/Dockerfiles/lalkachat-build-deps/Dockerfile

This file was deleted.

12 changes: 12 additions & 0 deletions docker/dockerfiles/alpine/build-deps/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM deforce/lc-alpine-wxpython

MAINTAINER CzT/DeForce <vlad@czt.lv>

# 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

1 change: 1 addition & 0 deletions docker/dockerfiles/alpine/build_order.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["wxpython", "build-deps", "testing"]
8 changes: 8 additions & 0 deletions docker/dockerfiles/alpine/testing/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM deforce/lc-alpine-build-deps

MAINTAINER CzT/DeForce <vlad@czt.lv>

# Deps for testing
RUN apk --update add curl bash nodejs-npm rsync
RUN pip install git-lint pep8 pylint
RUN npm install -g csslint
20 changes: 20 additions & 0 deletions docker/dockerfiles/alpine/wxpython/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM alpine:edge

MAINTAINER CzT/DeForce <vlad@czt.lv>

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
9 changes: 9 additions & 0 deletions docker/dockerfiles/fedora/build-deps/Dockerfile
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
1 change: 1 addition & 0 deletions docker/dockerfiles/fedora/build_order.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["build-deps", "testing"]
6 changes: 6 additions & 0 deletions docker/dockerfiles/fedora/testing/Dockerfile
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
1 change: 1 addition & 0 deletions docker/dockerfiles/ubuntu/build_order.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["builder"]
10 changes: 10 additions & 0 deletions docker/dockerfiles/ubuntu/builder/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM cdrx/pyinstaller-windows:python2

MAINTAINER CzT/DeForce <vlad@czt.lv>

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-*
Loading

0 comments on commit a91fe87

Please sign in to comment.