forked from znc/znc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into master-patched
- Loading branch information
Showing
1,169 changed files
with
85,569 additions
and
17,833 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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
// This script is run daily by https://jenkins.znc.in/ to: | ||
// * upload new English strings to https://crowdin.com/project/znc-bouncer | ||
// * download new translations | ||
// * create a pull request with results to ZNC repo | ||
// * commits results to ZNC repo | ||
|
||
import groovy.json.JsonSlurper; | ||
import groovy.json.JsonOutput; | ||
|
@@ -11,7 +11,7 @@ def upstream_user = 'znc' | |
def upstream_repo = 'znc' | ||
def my_user = 'znc-jenkins' | ||
def my_repo = 'znc' | ||
def branches = ['master', '1.7.x'] | ||
def branches = ['master', '1.9.x'] | ||
|
||
def pr_mode = false | ||
|
||
|
@@ -30,7 +30,7 @@ timestamps { | |
stage(upstream_branch) { | ||
dir(upstream_branch) { | ||
stage("Checkout ${upstream_branch}") { | ||
checkout([$class: 'GitSCM', branches: [[name: "*/${upstream_branch}"]], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'SubmoduleOption', recursiveSubmodules: true]], userRemoteConfigs: [[credentialsId: '6ef10f80-20dc-4661-af45-52a6e1e15749', name: 'upstream', url: "github.com:${upstream_user}/${upstream_repo}.git"]]]) | ||
checkout([$class: 'GitSCM', branches: [[name: "*/${upstream_branch}"]], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'SubmoduleOption', recursiveSubmodules: true]], userRemoteConfigs: [[credentialsId: '6ef10f80-20dc-4661-af45-52a6e1e15749', name: 'upstream', url: "git@github.com:${upstream_user}/${upstream_repo}.git"]]]) | ||
} | ||
stage("Prepare strings for ${upstream_branch}") { | ||
dir("build") { | ||
|
@@ -50,6 +50,13 @@ timestamps { | |
} | ||
sh 'LANG=C.UTF-8 find . -name "*.po" -exec msgfilter -i "{}" -o "{}.replacement" .ci/cleanup-po.pl ";"' | ||
sh 'find . -name "*.po" -exec mv "{}.replacement" "{}" ";"' | ||
withCredentials([string(credentialsId: 'fe727e3e-a8e0-4019-817f-6583c3c51ef7', variable: 'CROWDIN_API2_KEY')]) { | ||
def headers = [[maskValue: true, name: 'Authorization', value: "Bearer ${env.CROWDIN_API2_KEY}"], [maskValue: false, name: 'User-Agent', value: 'https://github.com/znc/znc/blob/master/.ci/Jenkinsfile.crowdin']] | ||
def contributors = httpRequest consoleLogResponseBody: true, customHeaders: headers, url: "https://crowdin.com/api/v2/projects/289533/members?limit=500" | ||
writeFile file: 'contributors.tmp', text: contributors.content | ||
} | ||
sh '.ci/crowdin-contributors.py < contributors.tmp' | ||
sh 'rm contributors.tmp' | ||
} | ||
stage("Push ${upstream_branch}") { | ||
sh 'git config user.name "ZNC-Jenkins"' | ||
|
@@ -67,24 +74,15 @@ timestamps { | |
echo 'No changes found' | ||
return | ||
} | ||
sh "git remote add my github.com:${my_user}/${my_repo}.git" | ||
// TODO simplify when https://issues.jenkins-ci.org/browse/JENKINS-28335 is fixed | ||
sh "git remote add my [email protected]:${my_user}/${my_repo}.git" | ||
if (!pr_mode) { | ||
withCredentials([sshUserPrivateKey(credentialsId: 'baf2df74-935d-40e5-b20f-076e92fa3e9f', keyFileVariable: 'GITHUB_KEY')]) { | ||
sh 'echo ssh -i $GITHUB_KEY -l git -o StrictHostKeyChecking=no \\"\\$@\\" > run_ssh.sh' | ||
sh 'chmod +x run_ssh.sh' | ||
withEnv(['GIT_SSH=run_ssh.sh']) { | ||
sh "git push upstream HEAD:refs/heads/${upstream_branch}" | ||
} | ||
sshagent(credentials: ['baf2df74-935d-40e5-b20f-076e92fa3e9f']) { | ||
sh "git push upstream HEAD:refs/heads/${upstream_branch}" | ||
} | ||
return | ||
} | ||
withCredentials([sshUserPrivateKey(credentialsId: '6ef10f80-20dc-4661-af45-52a6e1e15749', keyFileVariable: 'GITHUB_KEY')]) { | ||
sh 'echo ssh -i $GITHUB_KEY -l git -o StrictHostKeyChecking=no \\"\\$@\\" > run_ssh.sh' | ||
sh 'chmod +x run_ssh.sh' | ||
withEnv(['GIT_SSH=run_ssh.sh']) { | ||
sh "git push my HEAD:refs/heads/${my_branch} -f" | ||
} | ||
sshagent(credentials: ['6ef10f80-20dc-4661-af45-52a6e1e15749']) { | ||
sh "git push my HEAD:refs/heads/${my_branch} -f" | ||
} | ||
// Create pull request if it doesn't exist yet | ||
withCredentials([string(credentialsId: '7a2546ae-8a29-4eab-921c-6a4803456dce', variable: 'GITHUB_OAUTH_KEY')]) { | ||
|
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,25 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import json | ||
import sys | ||
|
||
array = [] | ||
|
||
data = json.load(sys.stdin) | ||
for user in data['data']: | ||
user = user['data'] | ||
if user['fullName']: | ||
array.append('* {} ({})'.format(user['username'], user['fullName'])) | ||
else: | ||
array.append('* ' + user['username']) | ||
|
||
array.sort(key=lambda x: x.lower()) | ||
|
||
sys.stdout = open('TRANSLATORS.md', 'wt', encoding='utf-8') | ||
|
||
print('These people helped translating ZNC to various languages:') | ||
print() | ||
for u in array: | ||
print(u) | ||
print() | ||
print('Generated from https://crowdin.com/project/znc-bouncer') |
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
File renamed without changes.
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,55 @@ | ||
set -x | ||
|
||
pwd | ||
ls -la | ||
|
||
cpanm --local-lib=~/perl5 local::lib | ||
eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib) | ||
cpanm --notest Devel::Cover::Report::Clover | ||
pip3 install --user coverage | ||
export ZNC_MODPERL_COVERAGE=1 | ||
#export ZNC_MODPYTHON_COVERAGE=1 | ||
|
||
case "${CC:-gcc}" in | ||
gcc) | ||
export CXXFLAGS="$CXXFLAGS --coverage" | ||
export LDFLAGS="$LDFLAGS --coverage" | ||
;; | ||
clang) | ||
export CXXFLAGS="$CXXFLAGS -fprofile-instr-generate -fcoverage-mapping" | ||
export LDFLAGS="$LDFLAGS -fprofile-instr-generate" | ||
;; | ||
esac | ||
|
||
mkdir build | ||
cd build | ||
../configure --enable-debug --enable-perl --enable-python --enable-tcl --enable-cyrus --enable-charset --enable-argon $CFGFLAGS | ||
cmake --system-information | ||
|
||
make -j2 VERBOSE=1 | ||
env LLVM_PROFILE_FILE="$PWD/unittest.profraw" make VERBOSE=1 unittest | ||
sudo make install | ||
/usr/local/bin/znc --version | ||
|
||
# TODO: use DEVEL_COVER_OPTIONS for https://metacpan.org/pod/Devel::Cover | ||
env LLVM_PROFILE_FILE="$PWD/inttest.profraw" ZNC_MODPERL_COVERAGE_OPTS="-db,$PWD/cover_db" PYTHONWARNINGS=error make VERBOSE=1 inttest | ||
ls -lRa | ||
|
||
~/perl5/bin/cover --no-gcov --report=clover | ||
|
||
case "${CC:-gcc}" in | ||
gcc) | ||
lcov --directory . --capture --output-file lcov-coverage.txt | ||
lcov --list lcov-coverage.txt | ||
;; | ||
clang) | ||
if [[ x$(uname) == xDarwin ]]; then | ||
export PATH=$PATH:/Library/Developer/CommandLineTools/usr/bin | ||
fi | ||
llvm-profdata merge unittest.profraw -o unittest.profdata | ||
llvm-profdata merge inttest.profraw -o inttest.profdata | ||
llvm-cov show -show-line-counts-or-regions -instr-profile=unittest.profdata test/unittest_bin > unittest-cmake-coverage.txt | ||
llvm-cov show -show-line-counts-or-regions -instr-profile=inttest.profdata /usr/local/bin/znc > inttest-znc-coverage.txt | ||
find /usr/local/lib/znc -name '*.so' -or -name '*.bundle' | while read f; do llvm-cov show -show-line-counts-or-regions -instr-profile=inttest.profdata $f > inttest-$(basename $f)-coverage.txt; done | ||
;; | ||
esac |
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,7 @@ | ||
--- | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "monthly" |
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,4 @@ | ||
sudo apt-get update | ||
sudo apt-get install -y tcl-dev libsasl2-dev libicu-dev swig qtbase5-dev libboost-locale-dev libperl-dev libargon2-dev cpanminus gettext clang llvm lcov | ||
sudo apt-get upgrade -y | ||
|
Oops, something went wrong.