Created
February 5, 2015 10:48
-
-
Save paulwellnerbou/69a03bc8915693b90f79 to your computer and use it in GitHub Desktop.
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
#!/bin/sh | |
mkdir $1 | |
cd $1 | |
git clone ~/src/fazcore | |
mv fazcore $1 | |
cd $1 | |
git filter-branch --subdirectory-filter $2 --prune-empty -- --all | |
git remote remove origin | |
git remote add origin ssh://git@git.tecfem.de/opt/git/repository/$1.git | |
echo "On server:" | |
echo "su - git" | |
echo "cd /opt/git/repository" | |
echo "mkdir $1.git" | |
echo "cd $1.git" | |
echo "git init --bare" | |
read -p "Press any key to continue... " -n1 -s | |
git push --set-upstream origin master | |
echo "TODO:" | |
echo "- adjust pom, set versions, remove parent" | |
echo "- add scm to pom:" | |
echo " | |
<scm> | |
<connection>scm:git:git@svpldev01.tecfem.de:/opt/git/repository/$1.git</connection> | |
</scm> | |
" | |
echo "- add distribution management to pom:" | |
echo " | |
<distributionManagement> | |
<repository> | |
<id>faz-releases</id> | |
<name>FAZ Releases repository</name> | |
<url>http://nexus.tecfem.de:8081/nexus/content/repositories/faz-releases</url> | |
</repository> | |
<snapshotRepository> | |
<id>faz-snapshots</id> | |
<name>FAZ Snapshots repository</name> | |
<url>http://nexus.tecfem.de:8081/nexus/content/repositories/faz-snapshots</url> | |
</snapshotRepository> | |
</distributionManagement> | |
" | |
echo "- add jgitflow configuration into pom" | |
echo " | |
<plugin> | |
<groupId>external.atlassian.jgitflow</groupId> | |
<artifactId>jgitflow-maven-plugin</artifactId> | |
<version>1.0-m2</version> | |
<configuration> | |
<flowInitContext> | |
<masterBranchName>master</masterBranchName> | |
<developBranchName>develop</developBranchName> | |
<featureBranchPrefix>feature-</featureBranchPrefix> | |
<releaseBranchPrefix>release-</releaseBranchPrefix> | |
<hotfixBranchPrefix>hotfix-</hotfixBranchPrefix> | |
<versionTagPrefix>v-</versionTagPrefix> | |
</flowInitContext> | |
</configuration> | |
</plugin> | |
" | |
echo "- add .gitignore:" | |
echo " | |
.metadata | |
.project | |
.settings | |
.classpath | |
*.iml | |
.idea | |
target | |
test-output | |
atlassian-ide-plugin.xml | |
*.gradle | |
gradle* | |
*.versionsBackup | |
*~ | |
" >> .gitignore | |
echo "- commit and push" | |
echo "- build release: mvn external.atlassian.jgitflow:jgitflow-maven-plugin:release-start; mvn external.atlassian.jgitflow:jgitflow-maven-plugin:release-finish" | |
echo "- fix dependency in fazcore" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment