Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
f141942
ENH: add permission handling to ioc-deploy
ZLLentz Aug 28, 2024
0538fb9
ENH/REF: add a full path override for convenience/testing and refacto…
ZLLentz Aug 29, 2024
1786fa9
DOC: nitpick error message
ZLLentz Aug 29, 2024
8a4cabf
FIX: future style annotations fix
ZLLentz Aug 29, 2024
51dcbe1
DOC: nitpick help text
ZLLentz Aug 29, 2024
15e239a
MAINT: py36 compat
ZLLentz Aug 29, 2024
1e3370b
ENH: implement dry run on permissions changes
ZLLentz Aug 29, 2024
a42de3f
MAINT: move up dry-run no dir catch
ZLLentz Aug 29, 2024
3e1a6ca
DOC: typo in docstring
ZLLentz Aug 30, 2024
9b30387
ENH: tell the user that we're applying write permissions and when we'…
ZLLentz Aug 30, 2024
998c790
ENH: fix various issues and improve text output
ZLLentz Aug 30, 2024
05c0c0c
MAINT: add basic python gitignore
ZLLentz Aug 30, 2024
d96aa5a
ENH: avoid modifying permissions in .git
ZLLentz Aug 31, 2024
4a6bca3
REF: simplify user-facing write protection options and internal name …
ZLLentz Aug 31, 2024
c9e17be
ENH: add shortening for path override option
ZLLentz Aug 31, 2024
c71d6b7
DOC: nitpick spacing and clarity in help text
ZLLentz Aug 31, 2024
8be731c
MAINT: this is the only dry-run print with a period, remove the period
ZLLentz Aug 31, 2024
399386b
DOC: paste new help text into readme and maintain preformatted spacing
ZLLentz Aug 31, 2024
b37037b
NIT: why is there a newline here
ZLLentz Aug 31, 2024
ec990b5
REF: use dataclasses instead of tuple passing for clarity
ZLLentz Sep 3, 2024
3bc8313
STY: apply ruff formatting
ZLLentz Sep 3, 2024
8e36d20
MNT: address merge conflicts
ZLLentz Sep 4, 2024
fe9bad4
STY: ruff format
ZLLentz Sep 4, 2024
9c238d0
ENH: enshrine a typo I keep making
ZLLentz Sep 4, 2024
e371f47
MNT: simplify permission handling
ZLLentz Sep 4, 2024
541356f
STY: ruff format
ZLLentz Sep 4, 2024
64754da
FIX: handle symbolic links properly
ZLLentz Sep 4, 2024
4d7cd49
DOC: update readme and help text with updated information about write…
ZLLentz Sep 4, 2024
339bfc1
Consolidate yes/no handling and return code logging
ZLLentz Sep 4, 2024
6451d8a
ENH: remove git from permissions change, consolidate input handling
ZLLentz Sep 4, 2024
7ebf657
MNT: nitpick message
ZLLentz Sep 4, 2024
b254a6d
ENH: advise follow-up actions if there is an error changing file perm…
ZLLentz Sep 5, 2024
0d16e59
STY: win the battle against ruff
ZLLentz Sep 5, 2024
66b91e2
ENH: rework permissions update to be a separate subcommand for clarity
ZLLentz Sep 6, 2024
7658dbc
DOC: update help text based on PR review and subparser addition
ZLLentz Sep 6, 2024
42d2429
DOC: add a helper function and use it to update the readme
ZLLentz Sep 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*.swp
__pycache__
build
*.pyc
*~
103 changes: 94 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,17 +342,57 @@ usage: grep_more_ioc [-h] [-d] patt hutch {print,search} <br/>
<td>ioc-deploy</td>
<td><pre>
usage: ioc-deploy [-h] [--version] [--name NAME] [--release RELEASE]
&nbsp; [--ioc-dir IOC_DIR] [--github_org GITHUB_ORG]
&nbsp; [--ioc-dir IOC_DIR] [--path-override PATH_OVERRIDE]
&nbsp; [--auto-confirm] [--dry-run] [--verbose]
&nbsp; [--github_org GITHUB_ORG]
&nbsp; {update-perms} ...
&nbsp;
ioc-deploy is a script for building and deploying ioc tags from github. It
will create a shallow clone of your IOC in the standard release area at the
correct path and "make" it. If the tag directory already exists, the script
will exit. Example command: "ioc-deploy -n ioc-foo-bar -r R1.0.0" This will
clone the repository to the default ioc directory and run make using the
currently set EPICS environment variables. With default settings this will
clone from https://github.com/pcdshub/ioc-foo-bar to
/cds/group/pcds/epics/ioc/foo/bar/R1.0.0 then cd and make.
ioc-deploy is a script for building and deploying ioc tags from github.
&nbsp;
It will take one of two different actions: the normal deploy action,
or a write permissions change on an existing deployed release.
&nbsp;
The normal deploy action will create a shallow clone of your IOC in the
standard release area at the correct path and "make" it.
If the tag directory already exists, the script will exit.
&nbsp;
In the deploy action, after making the IOC, we'll write-protect all files
and all directories.
We'll also write-protect the top-level directory to help indicate completion.
&nbsp;
Note that this means you'll need to restore write permissions if you'd like
to rebuild an existing release on a new architecture or remove it entirely.
&nbsp;
Example command:
&nbsp;
"ioc-deploy -n ioc-foo-bar -r R1.0.0"
&nbsp;
This will clone the repository to the default ioc directory and run make using the
currently set EPICS environment variables, then apply write protection.
&nbsp;
With default settings, this will clone
from https://github.com/pcdshub/ioc-foo-bar
to /cds/group/pcds/epics/ioc/foo/bar/R1.0.0
then cd and make and chmod as appropriate.
&nbsp;
The second action will not do any git or make actions, it will only find the
release directory and change the file and directory permissions.
This can be done with similar commands as above, adding the subparser command,
and it can be done by passing the specific path you'd like to modify
if this is more convenient for you.
&nbsp;
Example commands:
&nbsp;
"ioc-deploy update-perms rw -n ioc-foo-bar -r R1.0.0"
"ioc-deploy update-perms ro -n ioc-foo-bar -r R1.0.0"
"ioc-deploy update-perms rw -p /cds/group/pcds/epics/ioc/foo/bar/R1.0.0"
"ioc-deploy update-perms ro -p /cds/group/pcds/epics/ioc/foo/bar/R1.0.0"
&nbsp;
positional arguments:
&nbsp; {update-perms} Subcommands (will not deploy):
&nbsp; update-perms Use 'ioc-deploy update-perms' to update the write
&nbsp; permissions of a deployment. See 'ioc-deploy update-
&nbsp; perms --help' for more information.
&nbsp;
optional arguments:
&nbsp; -h, --help show this help message and exit
Expand All @@ -369,11 +409,56 @@ optional arguments:
&nbsp; the environment variable is not set. With your current
&nbsp; environment variables, this defaults to
&nbsp; /reg/g/pcds/epics/ioc.
&nbsp; --path-override PATH_OVERRIDE, -p PATH_OVERRIDE
&nbsp; If provided, ignore all normal path-selection rules in
&nbsp; favor of the specific provided path. This will let you
&nbsp; deploy IOCs or apply protection rules to arbitrary
&nbsp; specific paths.
&nbsp; --auto-confirm, --confirm, --yes, -y
&nbsp; Skip the confirmation promps, automatically saying yes
&nbsp; to each one.
&nbsp; --dry-run Do not deploy anything, just print what would have
&nbsp; been done.
&nbsp; --verbose, -v, --debug
&nbsp; Display additional debug information.
&nbsp; --github_org GITHUB_ORG, --org GITHUB_ORG
&nbsp; The github org to deploy IOCs from. This defaults to
&nbsp; $GITHUB_ORG, or pcdshub if the environment variable is
&nbsp; not set. With your current environment variables, this
&nbsp; defaults to pcdshub.
&nbsp;
usage: ioc-deploy update-perms [-h] [--name NAME] [--release RELEASE]
&nbsp; [--ioc-dir IOC_DIR]
&nbsp; [--path-override PATH_OVERRIDE]
&nbsp; [--auto-confirm] [--dry-run] [--verbose]
&nbsp; {ro,rw}
&nbsp;
Update the write permissions of a deployment. This will make all the files
read-only (ro), or owner and group writable (rw).
&nbsp;
positional arguments:
&nbsp; {ro,rw} Select whether to make the deployment permissions
&nbsp; read-only (ro) or read-write (rw).
&nbsp;
optional arguments:
&nbsp; -h, --help show this help message and exit
&nbsp; --name NAME, -n NAME The name of the repository to deploy. This is a
&nbsp; required argument. If it does not exist on github,
&nbsp; we'll also try prepending with 'ioc-common-'.
&nbsp; --release RELEASE, -r RELEASE
&nbsp; The version of the IOC to deploy. This is a required
&nbsp; argument.
&nbsp; --ioc-dir IOC_DIR, -i IOC_DIR
&nbsp; The directory to deploy IOCs in. This defaults to
&nbsp; $EPICS_SITE_TOP/ioc, or /cds/group/pcds/epics/ioc if
&nbsp; the environment variable is not set. With your current
&nbsp; environment variables, this defaults to
&nbsp; /reg/g/pcds/epics/ioc.
&nbsp; --path-override PATH_OVERRIDE, -p PATH_OVERRIDE
&nbsp; If provided, ignore all normal path-selection rules in
&nbsp; favor of the specific provided path. This will let you
&nbsp; deploy IOCs or apply protection rules to arbitrary
&nbsp; specific paths.
&nbsp; --auto-confirm, --confirm, --yes, -y
&nbsp; Skip the confirmation promps, automatically saying yes
&nbsp; to each one.
Expand Down
Loading