Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
flux2
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
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
GitHub Mirror
fluxcd
flux2
Commits
7739d84f
Commit
7739d84f
authored
4 years ago
by
stefanprodan
Browse files
Options
Downloads
Patches
Plain Diff
Add CLI install instruction and script
parent
4c6dba2f
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+2
-0
2 additions, 0 deletions
README.md
install/README.md
+37
-0
37 additions, 0 deletions
install/README.md
install/tk.sh
+51
-0
51 additions, 0 deletions
install/tk.sh
with
90 additions
and
0 deletions
README.md
+
2
−
0
View file @
7739d84f
...
...
@@ -8,3 +8,5 @@ Components:
*
[
Toolkit CLI
](
docs/cmd/tk.md
)
*
[
Source Controller
](
https://github.com/fluxcd/source-controller
)
*
[
Kustomize Controller
](
https://github.com/fluxcd/kustomize-controller
)
To install the toolkit CLI, see these
[
instructions
](
install/README.md
)
.
This diff is collapsed.
Click to expand it.
install/README.md
0 → 100644
+
37
−
0
View file @
7739d84f
# TK CLI Installation
Binaries for macOS and Linux AMD64 are available for download on the
[
release page
](
https://github.com/fluxcd/toolkit/releases
)
.
To install the latest release run:
```
bash
curl
-s
https://raw.githubusercontent.com/fluxcd/toolkit/master/install/tk.sh |
sudo
bash
```
The install script does the following:
*
attempts to detect your OS
*
downloads and unpacks the release tar file in a temporary directory
*
copies the tk binary to
`/usr/local/bin`
*
removes the temporary directory
## Build from source
Clone the repository:
```
bash
git clone https://github.com/fluxcd/toolkit
cd
toolkit
```
Build the tk binary (requires go >= 1.14):
```
bash
make build
```
Run the binary:
```
bash
./bin/tk
-h
```
This diff is collapsed.
Click to expand it.
install/tk.sh
0 → 100755
+
51
−
0
View file @
7739d84f
#!/usr/bin/env bash
set
-e
DEFAULT_BIN_DIR
=
"/usr/local/bin"
BIN_DIR
=
${
1
:-
"
$DEFAULT_BIN_DIR
"
}
opsys
=
""
if
[[
"
$OSTYPE
"
==
linux
*
]]
;
then
opsys
=
linux
elif
[[
"
$OSTYPE
"
==
darwin
*
]]
;
then
opsys
=
darwin
fi
if
[[
"
$opsys
"
==
""
]]
;
then
echo
"OS
$OSTYPE
not supported"
exit
1
fi
if
[[
!
-x
"
$(
command
-v
curl
)
"
]]
;
then
echo
"curl not found"
exit
1
fi
tmpDir
=
`
mktemp
-d
`
if
[[
!
"
$tmpDir
"
||
!
-d
"
$tmpDir
"
]]
;
then
echo
"could not create temp dir"
exit
1
fi
function
cleanup
{
rm
-rf
"
$tmpDir
"
}
trap
cleanup EXIT
pushd
$tmpDir
>
& /dev/null
curl
-s
https://api.github.com/repos/fluxcd/toolkit/releases/latest |
\
grep
browser_download |
\
grep
$opsys
|
\
cut
-d
'"'
-f
4 |
\
xargs curl
-sL
-o
tk.tar.gz
tar
xzf ./tk.tar.gz
mv
./tk
$BIN_DIR
popd
>
& /dev/null
echo
"
$(
tk
--version
)
installed"
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