Compare commits
No commits in common. "bf97e83d242d54c140c868fbc309d5add16c194a" and "ae458763aec62b8fa996c6c0ba9d44d7c39a69ba" have entirely different histories.
bf97e83d24
...
ae458763ae
2 changed files with 16 additions and 39 deletions
|
@ -1,28 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
from os import getenv
|
||||
from os.path import dirname
|
||||
from re import match
|
||||
from shlex import quote
|
||||
from subprocess import run
|
||||
|
||||
commit_before_sha = getenv('CI_COMMIT_BEFORE_SHA')
|
||||
commit_sha = getenv('CI_COMMIT_SHA')
|
||||
commit_ref_name = getenv('CI_COMMIT_REF_NAME')
|
||||
directories = set()
|
||||
|
||||
cmd = 'git clone https://code.ryuslash.org/ryuslash/git-lfs-test.git .'
|
||||
print(cmd)
|
||||
run(cmd, shell=True)
|
||||
|
||||
if not match(r"^0+$", commit_before_sha):
|
||||
cmd = f"git diff --name-only {quote(commit_before_sha)} {quote(commit_sha)}"
|
||||
print(cmd)
|
||||
process = run(cmd, shell=True, capture_output=True)
|
||||
process_output = process.stdout.decode()
|
||||
print(process_output)
|
||||
for filename in process_output.strip().split('\n'):
|
||||
directories.add(dirname(filename))
|
||||
|
||||
unix_directory_list = str.join(':', directories)
|
||||
print(f'python tasks.py probe --directories={quote(unix_directory_list)}')
|
|
@ -3,21 +3,26 @@
|
|||
from shlex import quote
|
||||
from subprocess import run
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
|
||||
directories = set()
|
||||
|
||||
for line in sys.stdin:
|
||||
precommit, postcommit, refname = line.strip().split(' ')
|
||||
precommit, postcommit, refname = line.split(' ')
|
||||
|
||||
if not refname == "refs/heads/main":
|
||||
print(f"Skipping ref \"{refname}\"")
|
||||
print(f"Skipping ref {refname}")
|
||||
continue
|
||||
|
||||
os.putenv("LAMINAR_REASON", "Push to git repository")
|
||||
cmd = "laminarc queue freeloadio " \
|
||||
f"CI_COMMIT_BEFORE_SHA={quote(precommit)} " \
|
||||
f"CI_COMMIT_SHA={quote(postcommit)} " \
|
||||
f"CI_COMMIT_REF_NAME={quote(refname)}"
|
||||
print(cmd)
|
||||
process = run(cmd, shell=True, capture_output=True)
|
||||
buildname, buildrun = process.stdout.decode().strip().split(':')
|
||||
print(f"Queued build: https://laminar.ryuslash.org/jobs/{buildname}/{buildrun}")
|
||||
print(f"precommit: {precommit}; postcommit: {postcommit}; refname: {refname}")
|
||||
|
||||
if not re.match(r"^0+$", precommit):
|
||||
process = run(f"git diff --name-only {quote(precommit)} {quote(postcommit)}", shell=True, capture_output=True)
|
||||
for filename in process.stdout.strip().split(b'\n'):
|
||||
directories.add(os.path.dirname(filename).decode())
|
||||
|
||||
os.putenv("LAMINAR_REASON", "Push to git repository")
|
||||
process = run(f"laminarc queue freeloadio directories={quote(str.join(';', directories))}", shell=True, capture_output=True)
|
||||
buildname, buildrun = process.stdout.strip().split(b':')
|
||||
print(f"Queued build: https://laminar.ryuslash.org/jobs/{buildname}/{buildrun}")
|
||||
|
|
Loading…
Reference in a new issue