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

be able to specify the console version we want #63

Merged
merged 3 commits into from Feb 23, 2018

Conversation

@jmazzitelli
Copy link
Contributor

commented Feb 22, 2018

related to PR #61

…ng builds and we want to fix on a particular console version
@jmazzitelli

This comment has been minimized.

Copy link
Contributor Author

commented Feb 22, 2018

this was a suggestion from @josejulio

@jmazzitelli

This comment has been minimized.

Copy link
Contributor Author

commented Feb 22, 2018

this also adds the feature suggested by @pilhuhn - if the console version is "local" we don't download it from the npm repo but instead we just copy the /build/* files from your locally build swsui project.

CONSOLE_VERSION=local make docker

By default it assumes swsui is located as a peer directory to the directory that is the root of your swscore GOPATH. So it assumes a file structure:

/some-root-dir-like-swift-sunshine/swsui/build/...the build files here...
/some-root-dir-like-swift-sunshine/swscore/src/github.com/swift-sunshine/swscore/...git repo of source here...

If your SWSUI is somewhere that doesn't match that relationship with swscore, then you set CONSOLE_LOCAL_DIR to point to your local git repo for swsui like this:

CONSOLE_VERSION=local CONSOLE_LOCAL_DIR=/my/git/repo/for/swsui make docker

The only requirement for the value of that local_dir env var is that it has a subdirectory "build" which is where the swsui build files are (i.e. ${CONSOLE_LOCAL_DIR}/build)

@jmazzitelli

This comment has been minimized.

Copy link
Contributor Author

commented Feb 22, 2018

To pull in the latest UI console from npm repo, nothing extra needs to be specified - its just make docker

To pull in a specific version it is: CONSOLE_VERSION=0.2.3 make docker

@jmazzitelli jmazzitelli requested a review from pilhuhn Feb 22, 2018
echo "Copying local console files from ${CONSOLE_LOCAL_DIR}"
rm -rf _output/docker/console && mkdir _output/docker/console
cp -r ${CONSOLE_LOCAL_DIR}/build/* _output/docker/console
else
@if [ ! -d "_output/docker/console" ]; then \

This comment has been minimized.

Copy link
@josejulio

josejulio Feb 22, 2018

Member

I think this is to cache the previous download, but we will need something to know if _output/docker/console holds the value of specified ${CONSOLE_VERSION} or some old value (local code, previous version, etc).

# Make docker with local
CONSOLE_VERSION=local make docker
# Try to make docker with version=0.2.3  In reality we are using our old _output/docker/console dir
CONSOLE_VERSION=0.2.3 make docker

This comment has been minimized.

Copy link
@jmazzitelli

jmazzitelli Feb 22, 2018

Author Contributor

yeah, that is a shortcoming. You have to make clean if you want to switch versions. I didn't bother - I assume the user will know when he is switching between versions and will know to clean. For now, I thought this was good enough. I didn't want to have to code up everything to figure out automatically if the versions matched -- as heiko says, don't let the perfect get in the way of the good. :)

This comment has been minimized.

Copy link
@josejulio

josejulio Feb 22, 2018

Member

I ok with that, but warning on the comments above CONSOLE_VERSION ?= latest would be great.

This comment has been minimized.

Copy link
@jmazzitelli

jmazzitelli Feb 23, 2018

Author Contributor

comment added - see the commit #7565c41

Copy link
Member

left a comment

LGTM

@josejulio

This comment has been minimized.

Copy link
Member

commented Feb 23, 2018

Can’t merge, I don’t have permissions :)

Copy link
Contributor

left a comment

This great and very helpful.
Just ran
$ CONSOLE_LOCAL_DIR=../swsui CONSOLE_VERSION=local make clean build docker and this took 8sec to get a new image into openshift.

@pilhuhn pilhuhn merged commit 239e326 into kiali:master Feb 23, 2018
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@jmazzitelli jmazzitelli deleted the jmazzitelli:npm-version branch Feb 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.