Skip to content

Commit e16d989

Browse files
committed
close #181 scoop release as python
1 parent b3b43e5 commit e16d989

File tree

4 files changed

+51
-41
lines changed

4 files changed

+51
-41
lines changed

ci/pipeline.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,12 @@ jobs:
142142
- get: git-phlow
143143
- get: gp-version
144144
- get: phlow-artifact-windows-s3
145-
passed: [takeoff]
145+
passed: [windows-pilot-check]
146146
trigger: true
147147
- task: scoop-release
148148
file: git-phlow/ci/scoop/scoop.yml
149149
- put: scoop-bucket
150-
params: {repository: scoop-bucket}
150+
params: {repository: scoop-bucket-modified}
151151

152152

153153
resource_types:

ci/scoop/scoop.py

Lines changed: 43 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,50 @@
11
import hashlib
22
import json
3+
import subprocess
4+
35

46
version = open("gp-version/version","r").read().replace("\n","")
5-
hash = hashlib.sha256(open("phlow-artifact-windows-s3/git-phlow-"+ version +"-windows-amd64.zip","r").read()).hexdigest()
6-
7-
8-
d = {
9-
"version": version,
10-
"license": "mit",
11-
"extract_dir": "",
12-
"url": "https://github.com/Praqma/git-phlow/releases/download/v"+ version +"/git-phlow-"+version+"-windows-amd64.zip",
13-
"depends": "git",
14-
"homepage": "https://github.com/praqma/git-phlow",
15-
"hash": hash,
16-
"bin": "git-phlow.exe",
17-
"notes": "type 'git phlow' for help" ,
18-
"autoupdate": {
19-
"url": "https://github.com/Praqma/git-phlow/releases/download/v"+version+"/git-phlow-"+version+"-windows-amd64.zip"
7+
8+
def clone():
9+
output = subprocess.check_output(["git","clone","scoop-bucket","scoop-bucket-modified"])
10+
11+
def scoop_release():
12+
hash = hashlib.sha256(open("phlow-artifact-windows-s3/git-phlow-"+ version +"-windows-amd64.zip","r").read()).hexdigest()
13+
d = {
14+
"version": version,
15+
"license": "mit",
16+
"extract_dir": "",
17+
"url": "https://github.com/Praqma/git-phlow/releases/download/v"+ version +"/git-phlow-"+version+"-windows-amd64.zip",
18+
"depends": "git",
19+
"homepage": "https://github.com/praqma/git-phlow",
20+
"hash": hash,
21+
"bin": "git-phlow.exe",
22+
"notes": "type 'git phlow' for help" ,
23+
"autoupdate": {
24+
"url": "https://github.com/Praqma/git-phlow/releases/download/v"+version+"/git-phlow-"+version+"-windows-amd64.zip"
25+
}
2026
}
21-
}
2227

28+
file = open("scoop-bucket-modified/git-phlow.json","w")
29+
file.write(json.dumps(d, indent=2))
30+
31+
32+
def commit():
33+
scm = "git"
34+
folder = "scoop-bucket-modified"
35+
output = subprocess.check_output([scm,"config","--global","user.email","[email protected]"])
36+
print output
37+
output = subprocess.check_output([scm,"config","--global","user.name","concourse"])
38+
print output
39+
40+
output = subprocess.check_output([scm,"-C",folder,"add","--all"])
41+
print output
42+
output = subprocess.check_output([scm,"-C",folder,"status"])
43+
print output
44+
output = subprocess.check_output([scm,"-C",folder,"commit","-m","released " + version])
45+
print output
2346

24-
file = open("scoop-bucket/git-phlow.json","w")
25-
file.write(json.dumps(d, indent=2))
47+
clone()
48+
scoop_release()
49+
commit()
50+

ci/scoop/scoop.sh

Lines changed: 0 additions & 20 deletions
This file was deleted.

ci/scoop/scoop.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,10 @@ inputs:
1111
- name: gp-version
1212
- name: phlow-artifact-windows-s3
1313

14+
outputs:
15+
- name: scoop-bucket-modified
16+
1417
run:
15-
path: git-phlow/ci/scoop/scoop.sh
18+
path: python
19+
args:
20+
- git-phlow/ci/scoop/scoop.py

0 commit comments

Comments
 (0)