Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
rabbitmq_agents
Manage
Activity
Members
Labels
Plan
Issues
14
Issue boards
Milestones
Wiki
Code
Merge requests
8
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
rc
rabbitmq_agents
Commits
86631358
Commit
86631358
authored
5 years ago
by
Bo-Chun Chen
Browse files
Options
Downloads
Patches
Plain Diff
Add debug message
parent
108d8cdc
No related branches found
Branches containing commit
No related tags found
6 merge requests
!147
Merge previous default branch feat-cod-rmq into main
,
!85
kill nginx process running under user from login node
,
!51
Fix acct create wait
,
!39
WIP:Feat cod rmq
,
!38
WIP: Feat cod rmq
,
!21
Feat git commit agent
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
git_commit.py
+33
-17
33 additions, 17 deletions
git_commit.py
with
33 additions
and
17 deletions
git_commit.py
+
33
−
17
View file @
86631358
...
@@ -27,23 +27,39 @@ def git_commit(ch, method, properties, body):
...
@@ -27,23 +27,39 @@ def git_commit(ch, method, properties, body):
try
:
try
:
git
.
checkout
(
'
master
'
)
if
DEBUG
:
git
.
pull
()
print
(
'
[{}]: git checkout master
'
.
format
(
task
))
git
.
checkout
(
'
-b
'
,
branch_name
)
print
(
'
[{}]: git pull
'
.
format
(
task
))
print
(
'
[{}]: git checkout -b {}
'
.
format
(
task
,
branch_name
))
with
open
(
cheaha_ldif
,
'
w
'
)
as
ldif_f
,
\
print
(
'
[{}]: /cm/local/apps/openldap/sbin/slapcat
\\
'
.
format
(
task
))
open
(
cheaha_ldapsearch_ldif
,
'
w
'
)
as
ldapsearch_ldif_f
:
print
(
"
\t
-f /cm/local/apps/openldap/etc/slapd.conf -b
'
dc=cm,dc=cluster
'
> {}
"
.
format
(
cheaha_ldif
))
slapcat
(
'
-f
'
,
'
/cm/local/apps/openldap/etc/slapd.conf
'
,
'
-b
'
,
"'
dc=cm,dc=cluster
'"
,
_out
=
ldif_f
)
print
(
'
[{}]: ldapsearch
\\
'
.
format
(
task
))
ldapsearch
(
'
-LLL
'
,
'
-x
'
,
'
-h
'
,
'
cheaha-master02
'
,
'
-b
'
,
"'
dc=cm,dc=cluster
'"
,
_out
=
ldapsearch_ldif_f
)
print
(
"
\t
-LLL -x -h cheaha-master02 -b
'
dc=cm,dc=cluster
'"
.
format
(
cheaha_ldapsearch_ldif
))
print
(
'
[{}]: git add {}
'
.
format
(
task
,
cheaha_ldif
))
git
.
diff
()
print
(
'
[{}]: git add {}
'
.
format
(
task
,
cheaha_ldapsearch_ldif
))
git
.
add
(
cheaha_ldif
)
print
(
'
[{}]: git commit -m
"
{}
"'
.
format
(
task
,
"
Added new cheaha user:
"
+
username
))
git
.
add
(
cheaha_ldapsearch_ldif
)
print
(
'
[{}]: git push origin
'
.
format
(
task
))
git
.
commit
(
m
=
"
Added new cheaha user:
"
+
username
)
print
(
'
[{}]: git checkout master
'
.
format
(
task
))
git
.
push
(
'
origin
'
,
branch_name
)
print
(
'
[{}]: git pull
'
.
format
(
task
))
git
.
checkout
(
'
master
'
)
time
.
sleep
(
60
)
else
:
git
.
pull
()
git
.
checkout
(
'
master
'
)
git
.
pull
()
git
.
checkout
(
'
-b
'
,
branch_name
)
with
open
(
cheaha_ldif
,
'
w
'
)
as
ldif_f
,
\
open
(
cheaha_ldapsearch_ldif
,
'
w
'
)
as
ldapsearch_ldif_f
:
slapcat
(
'
-f
'
,
'
/cm/local/apps/openldap/etc/slapd.conf
'
,
'
-b
'
,
"'
dc=cm,dc=cluster
'"
,
_out
=
ldif_f
)
ldapsearch
(
'
-LLL
'
,
'
-x
'
,
'
-h
'
,
'
cheaha-master02
'
,
'
-b
'
,
"'
dc=cm,dc=cluster
'"
,
_out
=
ldapsearch_ldif_f
)
git
.
diff
()
git
.
add
(
cheaha_ldif
)
git
.
add
(
cheaha_ldapsearch_ldif
)
git
.
commit
(
m
=
"
Added new cheaha user:
"
+
username
)
git
.
push
(
'
origin
'
,
branch_name
)
git
.
checkout
(
'
master
'
)
time
.
sleep
(
60
)
git
.
pull
()
success
=
True
success
=
True
except
:
except
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment