You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/10/08 20:24:30 UTC
svn commit: r1811503 - in /sling/trunk/tooling/scm/scripts:
create-gitbox-repo.sh migrate-to-git.sh
Author: rombert
Date: Sun Oct 8 20:24:29 2017
New Revision: 1811503
URL: http://svn.apache.org/viewvc?rev=1811503&view=rev
Log:
SLING-3987 - move from Subversion to Git
Scripts now use the final Github destinations and interact
with the GitBox provisioning scripts.
Added:
sling/trunk/tooling/scm/scripts/create-gitbox-repo.sh (with props)
Modified:
sling/trunk/tooling/scm/scripts/migrate-to-git.sh
Added: sling/trunk/tooling/scm/scripts/create-gitbox-repo.sh
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/scm/scripts/create-gitbox-repo.sh?rev=1811503&view=auto
==============================================================================
--- sling/trunk/tooling/scm/scripts/create-gitbox-repo.sh (added)
+++ sling/trunk/tooling/scm/scripts/create-gitbox-repo.sh Sun Oct 8 20:24:29 2017
@@ -0,0 +1,21 @@
+#!/bin/sh -e
+
+# validation
+if [ $# -ne 2 ]; then
+ echo "Usage: $0 repo-name repo-description"
+ exit 1
+fi
+
+repo_name=$1
+repo_desc=$2
+
+# will fail if wrong credentials are passed
+status=$(curl --netrc -s -o /dev/null -I -w "%{http_code}" https://gitbox.apache.org/setup/newrepo.cgi?action=pmcs)
+if [ $status != "200" ]; then
+ echo "Got status ${status} for validation curl call, aborting."
+ echo "Please check ~/.netrc for a login entry for gitbox.apache.org"
+ exit 2
+fi
+
+echo "curl --netrc --data=\"action=create&pmc=sling&name=${repo_name}&description=${repo_desc}¬ify=commits@sling.apache.org&ghnotify=dev@sling.apache.org&ispodling=false\" https://gitbox.apache.org/setup/newrepo.cgi"
+
Propchange: sling/trunk/tooling/scm/scripts/create-gitbox-repo.sh
------------------------------------------------------------------------------
svn:executable = *
Modified: sling/trunk/tooling/scm/scripts/migrate-to-git.sh
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/scm/scripts/migrate-to-git.sh?rev=1811503&r1=1811502&r2=1811503&view=diff
==============================================================================
--- sling/trunk/tooling/scm/scripts/migrate-to-git.sh (original)
+++ sling/trunk/tooling/scm/scripts/migrate-to-git.sh Sun Oct 8 20:24:29 2017
@@ -55,7 +55,7 @@ fi
case "$1" in
"-r") echo "Provisioning remote repositories" ;;
"-c") echo "Converting local repositories";;
- "-p") echo "Pushing local repositories to remove";;
+ "-p") echo "Pushing local repositories to remote";;
*)
usage
exit -1
@@ -72,6 +72,11 @@ while read -r module; do
if [ -e ${module_orig}/pom.xml ]; then
artifactId=$(xmllint --xpath "/*[local-name()='project']/*[local-name()='artifactId']/text()" ${module_orig}/pom.xml)
+ short_desc=$(xmllint --xpath "/*[local-name()='project']/*[local-name()='name']/text()" ${module_orig}/pom.xml)
+ if [ -z "${short_desc}" ]; then
+ echo "No name for ${module_orig}, aborting"
+ exit 3
+ fi
# some overrides where it does not make sense to switch the artifact id
case $artifactId in
@@ -130,8 +135,7 @@ while read -r module; do
fi
elif [ $1 == "-r" ]; then
- # TODO - switch to ASF for the final run
- status=$(curl -s -o /dev/null -I -w "%{http_code}" https://github.com/not-sling/${repo_name})
+ status=$(curl -s -o /dev/null -I -w "%{http_code}" https://github.com/apache/${repo_name})
if [ $status = "404" ]; then
echo "Repository not found, will create";
@@ -143,21 +147,16 @@ while read -r module; do
exit 1
fi
- if [ -z "$GITHUB_AUTH" ]; then
- echo "Please export GITHUB_AUTH='your-github-username your-github-token'"
- exit 2
- fi
-
echo "Creating GIT repository ..."
# TODO - create the repository using the ASF self-service tool
- ./tooling/scm/scripts/create-gh-repo.sh ${GITHUB_AUTH} ${repo_name}
+ ./tooling/scm/scripts/create-gitbox-repo.sh ${repo_name} "${short_desc}"
else # -p
pushd ${git_repo_location}/${repo_name}
# TODO - use the ASF remotes for the final run
if [ $(git remote show | grep origin | wc -l) -eq 0 ]; then
- git remote add origin https://github.com/not-sling/${repo_name}.git
+ git remote add origin https://github.com/apache/${repo_name}.git
git push -u origin master
else
echo "Remote origin already exists, skipping"