Migrate from github to ungleich gitlab
This commit is contained in:
		
					parent
					
						
							
								3ca337dfe0
							
						
					
				
			
			
				commit
				
					
						8b93bf0218
					
				
			
		
					 9 changed files with 112 additions and 78 deletions
				
			
		
							
								
								
									
										50
									
								
								docs/dev/github-gitlab-migration/release
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										50
									
								
								docs/dev/github-gitlab-migration/release
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,50 @@
 | 
			
		|||
#!/bin/sh -e
 | 
			
		||||
 | 
			
		||||
set -x
 | 
			
		||||
 | 
			
		||||
printf "Enter tag name: "
 | 
			
		||||
read tag
 | 
			
		||||
printf "Enter repository authentication token: "
 | 
			
		||||
read token
 | 
			
		||||
 | 
			
		||||
git tag -d "${tag}" || :
 | 
			
		||||
 | 
			
		||||
git tag "${tag}" -m "Release ${tag}"
 | 
			
		||||
git push origin "${tag}"
 | 
			
		||||
 | 
			
		||||
echo 'foo' > foo
 | 
			
		||||
echo 'foo signature' > foo.asc
 | 
			
		||||
 | 
			
		||||
archivename="foo"
 | 
			
		||||
 | 
			
		||||
project="poljakowski%2Fmy-cdist-testing"
 | 
			
		||||
sed_cmd='s/^.*"markdown":"\([^"]*\)".*$/\1/'
 | 
			
		||||
 | 
			
		||||
# upload archive
 | 
			
		||||
response_archive=$(curl -f -X POST \
 | 
			
		||||
     -H "PRIVATE-TOKEN: ${token}" \
 | 
			
		||||
     -F "file=@${archivename}" \
 | 
			
		||||
     "https://code.ungleich.ch/api/v4/projects/${project}/uploads" \
 | 
			
		||||
     | sed "${sed_cmd}") || exit 1
 | 
			
		||||
 | 
			
		||||
# upload archive signature
 | 
			
		||||
response_archive_sig=$(curl -f -X POST \
 | 
			
		||||
     -H "PRIVATE-TOKEN: ${token}" \
 | 
			
		||||
     -F "file=@${archivename}.asc" \
 | 
			
		||||
    "https://code.ungleich.ch/api/v4/projects/${project}/uploads" \
 | 
			
		||||
     | sed "${sed_cmd}") || exit 1
 | 
			
		||||
 | 
			
		||||
# make release
 | 
			
		||||
curl -f -X POST \
 | 
			
		||||
     -H "PRIVATE-TOKEN: ${token}" \
 | 
			
		||||
     -F "description=Release ${tag}<br/>${response_archive}<br/>${response_archive_sig}" \
 | 
			
		||||
    "https://code.ungleich.ch/api/v4/projects/${project}/repository/tags/${tag}/release" \
 | 
			
		||||
    || exit 1
 | 
			
		||||
 | 
			
		||||
# get tag
 | 
			
		||||
curl -f -X GET \
 | 
			
		||||
     -H "PRIVATE-TOKEN: ${token}" \
 | 
			
		||||
    "https://code.ungleich.ch/api/v4/projects/${project}/repository/tags/${tag}" \
 | 
			
		||||
    || exit 1
 | 
			
		||||
 | 
			
		||||
rm -f foo foo.asc
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue