Saturday, August 8, 2015

Postgres schema

CREATE ROLE <role_name> WITH LOGIN PASSWORD 'your_password' VALID UNTIL '';
ALTER ROLE <role_name> SET search_path TO ;
CREATE SCHEMA IF NOT EXISTS  AUTHORIZATION ;
SHOW search_path;
UPDATE pg_database set datallowconn = 'false' where datname = 'xxx'

Tuesday, August 4, 2015

NPM deploying to nexus

https://books.sonatype.com/nexus-book/reference/npm-deploying-packages.html
http://jhipster.github.io/setting_up_ci_linux.html

Tuesday, June 16, 2015

SVN to GIT migration guide

1. Get list of authors
#!/usr/bin/env bash
authors=$(svn log -q svn://url/project | grep -e '^r' | awk 'BEGIN { FS = "|" } ; { print $2 }' | sort | uniq)
for author in ${authors}; do
echo "${author} = ${author} <${author}@email.mu>";
done
git svn clone --authors-file=authors.txt --no-metadata svn://url/project -s
git svn fetch
git svn create-ignore
git add .
git commit -am "Added .gitignore"
git for-each-ref refs/remotes/tags | cut -d / -f 4- | grep -v @ | while read tagname; do git tag "$tagname" "tags/$tagname"; git branch -r -d "tags/$tagname"; done
git for-each-ref refs/remotes | cut -d / -f 3- | grep -v @ | while read branchname; do git branch "$branchname" "refs/remotes/$branchname"; git branch -r -d "$branchname"; done
git config --remove-section svn-remote.svn
git config --remove-section svn
rm -rf .git/svn
Create repository with gitolite.
git remote add origin git@gitUrl:project.git
git gc
git push origin --all
git push origin --tags
ssh -i /c/Users/username/.ssh/gituser.pub git@gitUrl

Thursday, June 11, 2015

Confluece Reporting Plugin


Плагин confluence-reporting-maven-plugin позволяет публиковать страницы в confluence.

Исходный плагин спроектирован для того, чтобы публиковать сайт проекта в confluence.
http://bsorrentino.github.io/maven-confluence-plugin/usage.html

Для использования плагина в settings.xml нужно задать логин-пароль для сервера с идентфикатором

  <serverId>confluence-server-id</serverId>

Пример шаблона страницы

{details}
Ссылки на скачивание:from [artifactory|${artifactoryDownloadLink}], from [jenkins|${jenkinsDownloadLink}]
Дата сборки:${buildTimestamp}
Статус:{status:colour=Grey |title=TO TEST|subtle=true}
{details}
 
h4. Изменения
 
h4. Номера JIRA задач, исправленных в сборке
 
${gitlog.jiraIssues}
{color:grey}* _В список включены задачи, начиная с версии ${gitlog.sinceTagName}_{color}
 
h4. Скрипты для обновления БД
 
h4. Изменения в конфигурации приложения
 
h4. Замечания по тестирования

<plugin>
    <groupId>org.bsc.maven</groupId>
    <artifactId>confluence-reporting-maven-plugin</artifactId>
    <version>4.2</version>
    <configuration>
        <endPoint>http://jira-confluence.ru/confluence/rpc/xmlrpc</endPoint>
        <spaceKey>MC</spaceKey>
        <parentPageTitle>Project_name-versions</parentPageTitle>
        <title>${project.artifactId}-${project.version}</title>
        <labels>
            <label>replicator</label>
            <label>version-notes</label>
            <label>project-version-notes</label>
        </labels>
        <templateWiki>${version-notes-template-path}</templateWiki>
        <encoding>UTF-8</encoding>
        <wikiFilesExt>.confluence</wikiFilesExt>
        <serverId>confluence-server-id</serverId>
        <gitLogJiraIssuesEnable>true</gitLogJiraIssuesEnable>
        <gitLogSinceTagName>v7.0.0</gitLogSinceTagName>
        <gitLogCalculateRuleForSinceTagName>CURRENT_MINOR_VERSION</gitLogCalculateRuleForSinceTagName>
        <gitLogJiraProjectKeyList>
            <value>MC</value>
        </gitLogJiraProjectKeyList>
        <gitLogTagNamesPattern>v\d+\.\d+\.\d+.*</gitLogTagNamesPattern>
        <gitLogGroupByVersions>true</gitLogGroupByVersions>
        <properties>
            <artifactoryDownloadLink>${artifactoryDownloadUrlPrefix}/${project.version}/</artifactoryDownloadLink>
            <jenkinsDownloadLink>${jenkinsDownloadUrlPrefix}/${jenkinsBuildNumber}/artifact/target/project-with-dependencies-${project.version}-${profile.name}.zip</jenkinsDownloadLink>
            <finalName>${build.finalName}</finalName>
            <buildTimestamp>${timestamp}</buildTimestamp>
        </properties>
    </configuration>
    <executions>
        <execution>
            <id>publish-version-notes</id>
            <phase>deploy</phase>
            <goals>
                <goal>deploy</goal>
            </goals>
        </execution>
    </executions>
</plugin>