When tools like svn2git are not available you need to migratie a svn repository by hand to git. Git has the "git svn" option to make this work albeit not 100%. There are some manual steps needed to migratie trunk, branches and tags. It's even possible to add branches or tags later when a trunk is already migrated to Git. Here's how. Note: In the code examples is used to indicate a field that needs to be filled with one's specific set of data.
This file contains hidden or 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
#!/usr/bin/env groovy | |
package com.github.prikkeldraad.git | |
class VersionParser implements Serializable { | |
public String number | |
public String branch | |
private String _branch | |
private String _version | |
private String _build |
This file contains hidden or 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
// replace <name> with your values | |
stage("Quality Gate"){ | |
// get analysisId with the correct name of the build, this can take a while | |
timeout(time: 3, unit: 'MINUTES') { | |
waitUntil { | |
try { | |
result = httpRequest "http://<sonarqube-instance>/api/project_analyses/search?project=<project-name>:${env.BRANCH_NAME}" | |
def analyses = readJSON text: result.content | |
analysisId = analyses.analyses[0].key | |
This file contains hidden or 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
stage('Analysis') { | |
printf("Branch name: %s", "${env.BRANCH_NAME}") | |
version = pom.version | |
// replace sonar-project.properties values | |
Properties props = new Properties() | |
File propsFile = new File("${env.WORKSPACE}/sonar-project.properties") | |
props.load(propsFile.newDataInputStream()) | |
props.setProperty('sonar.branch', "${env.BRANCH_NAME}") | |
props.setProperty('sonar.projectVersion', version) |
This file contains hidden or 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
// determine version based on git branch name, supply pom info first | |
@NonCPS | |
def getVersion = { Class pom -> | |
def matches = (env.BRANCH_NAME =~ /^(master|release|develop|feature)\/?(.*)/) | |
try { | |
if (matches[0][1] in ['release', 'develop']) { | |
if (pom.version != matches[0][2]) { | |
error "Branch version ${matches[0][2]} is not the same as pom version ${pom.version}" | |
} |
This file contains hidden or 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
stage('Info') { | |
// read info from pom (see: http://maven.apache.org/components/ref/3.3.9/maven-model/apidocs/org/apache/maven/model/Model.html) | |
pom = readMavenPom file: 'pom.xml' | |
printf("Version: %s", pom.version) | |
// list modules | |
printf ("Modules: %s", pom.getModules().join(",")) | |
// set version explicit in maven pom, always add build number | |
// format of version should be: <name>-x.y.x-<branch?>-<build> |
This file contains hidden or 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
proxy_send_timeout 120; | |
proxy_read_timeout 300; | |
proxy_buffering off; | |
# keepalive_timeout 5 5; | |
tcp_nodelay on; | |
ssl_password_file /etc/ssl/global.pass; | |
server { |
This file contains hidden or 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
#!/bin/env python | |
import argparse | |
import subprocess | |
from lxml import etree | |
from pprint import pprint | |
# parse command line parameters | |
parser = argparse.ArgumentParser() | |
parser.add_argument('url', help='URL to scan') | |
parser.add_argument('zap', help='Location of zap executable') |
This file contains hidden or 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
From: https://www.digitalocean.com/community/tutorials/how-to-install-ruby-on-rails-with-rbenv-on-centos-7 | |
yum install git-core zlib zlib-devel gcc-c++ patch readline readline-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison curl sqlite-devel | |
cd | |
git clone git://github.com/sstephenson/rbenv.git .rbenv | |
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile | |
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile | |
exec $SHELL | |
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build |
This file contains hidden or 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
I am working with Oracle VirtualBox on this, so mileage may vary on "real" *nix systems | |
Get a CentOS 7 (base) from VirtualBoxes.org | |
yum update (cause it's always old) | |
Read: MSSQL server (https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-setup-red-hat) | |
Add the M$ repo of the DB | |
curl https://packages.microsoft.com/config/rhel/7/mssql-server.repo > /etc/yum.repos.d/mssql-server.repo | |
Add the MSSQL server tools (https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-setup-tools) |