Skip to content
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

Merged
merged 6 commits into from
Aug 31, 2018

Conversation

agrare
Copy link
Member

@agrare agrare commented Aug 31, 2018

Adds a setup script to deploy ManageIQ on minishift using a single
command.

Adds a setup script to deploy ManageIQ on minishift using a single
command.
@agrare
Copy link
Member Author

agrare commented Aug 31, 2018

@miq-bot assign @carbonin

bin/setup Outdated
@@ -0,0 +1,67 @@
#!/bin/bash

project=mynamespace
Copy link
Member Author

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

Copy link
Member

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.

Copy link
Member Author

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)
Copy link
Member Author

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

Copy link
Member

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?

Copy link
Member Author

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)
Copy link
Member

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)
Copy link
Member

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"

Copy link
Member

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?

Copy link
Member Author

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..."
Copy link
Member

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.

Copy link
Member Author

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
Copy link
Member

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.

@carbonin
Copy link
Member

Also I think the script name shouldn't be just setup as that is typically not an entrypoint, but rather pre-run tasks. (For example, bin/setup in manageiq doesn't start the server).

I also want to make to clear from the name of the script that this is only for minishift. So maybe deploy_on_minishift or minishift_quickstart?

@agrare agrare force-pushed the add_simple_minishift_setup branch from 41c6973 to a8f5c25 Compare August 31, 2018 15:33
@agrare agrare force-pushed the add_simple_minishift_setup branch from a8f5c25 to d86dd62 Compare August 31, 2018 15:36
if [ -z "$project" ];
then
project=myproject
fi
Copy link
Member

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}"

Copy link
Member Author

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 :)

@miq-bot
Copy link
Member

miq-bot commented Aug 31, 2018

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
0 files checked, 0 offenses detected
Everything looks fine. ⭐

@carbonin carbonin merged commit d40b354 into ManageIQ:master Aug 31, 2018
@carbonin carbonin added this to the Sprint 94 Ending Sept 10, 2018 milestone Aug 31, 2018
@agrare
Copy link
Member Author

agrare commented Aug 31, 2018

@carbonin I assume this will require some tweaks to work on the hammer branch?

@agrare agrare deleted the add_simple_minishift_setup branch August 31, 2018 18:14
@carbonin
Copy link
Member

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?

@agrare
Copy link
Member Author

agrare commented Aug 31, 2018

Okay cool I assumed there was some difference on the setup.

simaishi pushed a commit that referenced this pull request Sep 25, 2018
Add a simple script to deploy MIQ on minishift

(cherry picked from commit d40b354)
@simaishi
Copy link
Contributor

Hammer backport details:

$ git log -1
commit 15db993f6b05f504d3e8b56818d0bb60be508de9
Author: Nick Carboni <[email protected]>
Date:   Fri Aug 31 14:14:13 2018 -0400

    Merge pull request #303 from agrare/add_simple_minishift_setup
    
    Add a simple script to deploy MIQ on minishift
    
    (cherry picked from commit d40b35489b7038e361fda855fb255e8ad834830e)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants