Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.devtools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
bob
bob.devtools
Commits
01fa869b
Commit
01fa869b
authored
6 years ago
by
André Anjos
Browse files
Options
Downloads
Patches
Plain Diff
[init] Minimize impact of (global, silent) environment variables being set
parent
9df9da0e
No related branches found
No related tags found
No related merge requests found
Pipeline
#26062
passed
6 years ago
Stage: build
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bob/devtools/__init__.py
+0
-17
0 additions, 17 deletions
bob/devtools/__init__.py
bob/devtools/scripts/bdt.py
+14
-1
14 additions, 1 deletion
bob/devtools/scripts/bdt.py
with
14 additions
and
18 deletions
bob/devtools/__init__.py
+
0
−
17
View file @
01fa869b
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Environment variable initialization
'''
import
os
from
.constants
import
CACERT
from
.bootstrap
import
set_environment
# must set LANG and LC_ALL before using click
set_environment
(
'
LANG
'
,
'
en_US.UTF-8
'
,
os
.
environ
)
set_environment
(
'
LC_ALL
'
,
os
.
environ
[
'
LANG
'
],
os
.
environ
)
# we need the right certificates setup as well
set_environment
(
'
SSL_CERT_FILE
'
,
CACERT
,
os
.
environ
)
set_environment
(
'
REQUESTS_CA_BUNDLE
'
,
CACERT
,
os
.
environ
)
This diff is collapsed.
Click to expand it.
bob/devtools/scripts/bdt.py
+
14
−
1
View file @
01fa869b
...
@@ -48,9 +48,22 @@ def raise_on_error(view_func):
...
@@ -48,9 +48,22 @@ def raise_on_error(view_func):
return
wraps
(
view_func
)(
_decorator
)
return
wraps
(
view_func
)(
_decorator
)
# warning: must set LANG and LC_ALL before using click
# see: https://click.palletsprojects.com/en/7.x/python3/
if
'
LANG
'
not
in
os
.
environ
:
os
.
environ
[
'
LANG
'
]
=
'
en_US.UTF-8
'
if
'
LC_ALL
'
not
in
os
.
environ
:
os
.
environ
[
'
LC_ALL
'
]
=
'
en_US.UTF-8
'
@with_plugins
(
pkg_resources
.
iter_entry_points
(
'
bdt.cli
'
))
@with_plugins
(
pkg_resources
.
iter_entry_points
(
'
bdt.cli
'
))
@click.group
(
cls
=
AliasedGroup
,
@click.group
(
cls
=
AliasedGroup
,
context_settings
=
dict
(
help_option_names
=
[
'
-?
'
,
'
-h
'
,
'
--help
'
]))
context_settings
=
dict
(
help_option_names
=
[
'
-?
'
,
'
-h
'
,
'
--help
'
]))
def
main
():
def
main
():
"""
Bob Development Tools - see available commands below
"""
"""
Bob Development Tools - see available commands below
"""
pass
from
..constants
import
CACERT
from
..bootstrap
import
set_environment
# certificate setup: required for gitlab API interaction
set_environment
(
'
SSL_CERT_FILE
'
,
CACERT
,
os
.
environ
)
set_environment
(
'
REQUESTS_CA_BUNDLE
'
,
CACERT
,
os
.
environ
)
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