-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a simple script to deploy MIQ on minishift #303
Conversation
Adds a setup script to deploy ManageIQ on minishift using a single command.
bin/setup
Outdated
@@ -0,0 +1,67 @@ | |||
#!/bin/bash | |||
|
|||
project=mynamespace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO - take this from an ENV var or command line then default to mynamespace
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think an envvar is a good call for a first pass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 done
Get from env var first then default to myproject
bin/setup
Outdated
eval $(minishift oc-env) | ||
|
||
# Login as admin | ||
res=$(oc login -u system:admin) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason bash is trying to execute the stdout of every command unless I set to a variable...not sure if this is just my bash env
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's strange ... but I also think system:admin
was broken in a recent version of minishift. I thought we had to use the admin user addon now. Was that fixed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I meant every command it executes stdout not just this one. Logging in with system:admin works fine for me.
bin/setup
Outdated
eval $(minishift oc-env) | ||
|
||
# Login as admin | ||
res=$(oc login -u system:admin) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's strange ... but I also think system:admin
was broken in a recent version of minishift. I thought we had to use the admin user addon now. Was that fixed?
bin/setup
Outdated
# Login as admin | ||
res=$(oc login -u system:admin) | ||
|
||
res=$(oc describe scc anyuid | grep Users | awk '{print $2}' | grep miq-anyuid) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will return the result for all namespaces. I think this should be grep "$project:miq-anyuid"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also is it better to use grep -q
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 switching to that and checking the return code
bin/setup
Outdated
res=$(oc describe scc anyuid | grep Users | awk '{print $2}' | grep miq-anyuid) | ||
if [ -z "$res" ]; | ||
then | ||
echo "Creating SCC miq-anyuid..." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically this is assigning the anyuid
SCC to the service account called miq-anyuid
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 changed
bin/setup
Outdated
@@ -0,0 +1,67 @@ | |||
#!/bin/bash | |||
|
|||
project=mynamespace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think an envvar is a good call for a first pass.
Also I think the script name shouldn't be just I also want to make to clear from the name of the script that this is only for minishift. So maybe |
41c6973
to
a8f5c25
Compare
a8f5c25
to
d86dd62
Compare
bin/deploy_on_minishift
Outdated
if [ -z "$project" ]; | ||
then | ||
project=myproject | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use something like this here?
project="${PROJECT:-myproject}"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sure we can, bash isn't my first, second, or third language :)
Checked commits agrare/manageiq-pods@907c8a9~...2abe7d7 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
@carbonin I assume this will require some tweaks to work on the hammer branch? |
I don't think so... All the sccs and service accounts are named the same. Is there anything jumping out at you that won't work in hammer? |
Okay cool I assumed there was some difference on the setup. |
Add a simple script to deploy MIQ on minishift (cherry picked from commit d40b354)
Hammer backport details:
|
Adds a setup script to deploy ManageIQ on minishift using a single
command.