Skip to content

Commit

Permalink
close #181 scoop release as python
Browse files Browse the repository at this point in the history
  • Loading branch information
groenborg committed Aug 1, 2017
1 parent b3b43e5 commit e16d989
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 41 deletions.
4 changes: 2 additions & 2 deletions ci/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,12 @@ jobs:
- get: git-phlow
- get: gp-version
- get: phlow-artifact-windows-s3
passed: [takeoff]
passed: [windows-pilot-check]
trigger: true
- task: scoop-release
file: git-phlow/ci/scoop/scoop.yml
- put: scoop-bucket
params: {repository: scoop-bucket}
params: {repository: scoop-bucket-modified}


resource_types:
Expand Down
61 changes: 43 additions & 18 deletions ci/scoop/scoop.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,50 @@
import hashlib
import json
import subprocess


version = open("gp-version/version","r").read().replace("\n","")
hash = hashlib.sha256(open("phlow-artifact-windows-s3/git-phlow-"+ version +"-windows-amd64.zip","r").read()).hexdigest()


d = {
"version": version,
"license": "mit",
"extract_dir": "",
"url": "https://github.com/Praqma/git-phlow/releases/download/v"+ version +"/git-phlow-"+version+"-windows-amd64.zip",
"depends": "git",
"homepage": "https://github.com/praqma/git-phlow",
"hash": hash,
"bin": "git-phlow.exe",
"notes": "type 'git phlow' for help" ,
"autoupdate": {
"url": "https://github.com/Praqma/git-phlow/releases/download/v"+version+"/git-phlow-"+version+"-windows-amd64.zip"

def clone():
output = subprocess.check_output(["git","clone","scoop-bucket","scoop-bucket-modified"])

def scoop_release():
hash = hashlib.sha256(open("phlow-artifact-windows-s3/git-phlow-"+ version +"-windows-amd64.zip","r").read()).hexdigest()
d = {
"version": version,
"license": "mit",
"extract_dir": "",
"url": "https://github.com/Praqma/git-phlow/releases/download/v"+ version +"/git-phlow-"+version+"-windows-amd64.zip",
"depends": "git",
"homepage": "https://github.com/praqma/git-phlow",
"hash": hash,
"bin": "git-phlow.exe",
"notes": "type 'git phlow' for help" ,
"autoupdate": {
"url": "https://github.com/Praqma/git-phlow/releases/download/v"+version+"/git-phlow-"+version+"-windows-amd64.zip"
}
}
}

file = open("scoop-bucket-modified/git-phlow.json","w")
file.write(json.dumps(d, indent=2))


def commit():
scm = "git"
folder = "scoop-bucket-modified"
output = subprocess.check_output([scm,"config","--global","user.email","concourse@praqma.net"])
print output
output = subprocess.check_output([scm,"config","--global","user.name","concourse"])
print output

output = subprocess.check_output([scm,"-C",folder,"add","--all"])
print output
output = subprocess.check_output([scm,"-C",folder,"status"])
print output
output = subprocess.check_output([scm,"-C",folder,"commit","-m","released " + version])
print output

file = open("scoop-bucket/git-phlow.json","w")
file.write(json.dumps(d, indent=2))
clone()
scoop_release()
commit()

20 changes: 0 additions & 20 deletions ci/scoop/scoop.sh

This file was deleted.

7 changes: 6 additions & 1 deletion ci/scoop/scoop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,10 @@ inputs:
- name: gp-version
- name: phlow-artifact-windows-s3

outputs:
- name: scoop-bucket-modified

run:
path: git-phlow/ci/scoop/scoop.sh
path: python
args:
- git-phlow/ci/scoop/scoop.py

0 comments on commit e16d989

Please sign in to comment.