Skip to content
Permalink
Browse files

Renaming ocdev to odo

Resolves #336.
I didn't change bintray repo name yet. Others, almost all references are changed to odo.
  • Loading branch information...
surajnarwade authored and kadel committed Apr 11, 2018
1 parent f806f15 commit 73f61487806294ba99d34e296a20a1d186207f61
@@ -3,7 +3,7 @@
#

# Ignore compiled files
ocdev
odo
dist
bin

@@ -12,7 +12,7 @@ jobs:
# YAML alias, for settings shared across the tests
- &base-test
stage: test
go_import_path: github.com/redhat-developer/ocdev
go_import_path: github.com/redhat-developer/odo
go: 1.8
install:
- make goget-tools
@@ -38,7 +38,7 @@ jobs:
script:
- ./scripts/oc-cluster.sh
- make bin
- sudo cp ocdev /usr/bin
- sudo cp odo /usr/bin
- oc login -u developer
- make test-e2e

@@ -60,7 +60,7 @@ jobs:
./scripts/install.sh

- stage: deploy
go_import_path: github.com/redhat-developer/ocdev
go_import_path: github.com/redhat-developer/odo
go: 1.9
install:
- make goget-tools
@@ -76,7 +76,7 @@ jobs:
deploy:
# upload binaries to bintray
- provider: bintray
repo: ocdev/ocdev
repo: odo/odo
file: ./.bintray.json
user: $BINTRAY_USER
key: $BINTRAY_KEY
@@ -94,7 +94,7 @@ jobs:
skip_cleanup: true
on:
tags: true
repo: redhat-developer/ocdev
repo: redhat-developer/odo
# upload packages to bintray repositories
- provider: script
skip_cleanup: true
@@ -1,4 +1,4 @@
PROJECT := github.com/redhat-developer/ocdev
PROJECT := github.com/redhat-developer/odo
GITCOMMIT := $(shell git rev-parse --short HEAD 2>/dev/null)
PKGS := $(shell go list ./... | grep -v $(PROJECT)/vendor)
BUILD_FLAGS := -ldflags="-w -X $(PROJECT)/cmd.GITCOMMIT=$(GITCOMMIT)"
@@ -7,7 +7,7 @@ default: bin

.PHONY: bin
bin:
go build ${BUILD_FLAGS} -o ocdev main.go
go build ${BUILD_FLAGS} -o odo main.go

.PHONY: install
install:
@@ -49,7 +49,7 @@ test-coverage:
# compile for multiple platforms
.PHONY: cross
cross:
gox -osarch="darwin/amd64 linux/amd64 linux/arm windows/amd64" -output="dist/bin/{{.OS}}-{{.Arch}}/ocdev" $(BUILD_FLAGS)
gox -osarch="darwin/amd64 linux/amd64 linux/arm windows/amd64" -output="dist/bin/{{.OS}}-{{.Arch}}/odo" $(BUILD_FLAGS)

.PHONY: generate-cli-docs
generate-cli-docs:
@@ -69,7 +69,7 @@ test:
# Run e2e tests
.PHONY: test-e2e
test-e2e:
go test github.com/redhat-developer/ocdev/tests/e2e
go test github.com/redhat-developer/odo/tests/e2e

# create deb and rpm packages using fpm in ./dist/pkgs/
# run make cross before this!
@@ -1,46 +1,46 @@
# ocdev
[![Build Status](https://travis-ci.org/redhat-developer/ocdev.svg?branch=master)](https://travis-ci.org/redhat-developer/ocdev) [![codecov](https://codecov.io/gh/redhat-developer/ocdev/branch/master/graph/badge.svg)](https://codecov.io/gh/redhat-developer/ocdev)
# odo
[![Build Status](https://travis-ci.org/redhat-developer/odo.svg?branch=master)](https://travis-ci.org/redhat-developer/odo) [![codecov](https://codecov.io/gh/redhat-developer/odo/branch/master/graph/badge.svg)](https://codecov.io/gh/redhat-developer/odo)

## What is ocdev?
## What is odo?
OpenShift Command line for Developers

## Pre-requisites
- OpenShift version 3.7.0 and up

To use ocdev you need access to an OpenShift instance and have OpenShift CLI installed on your local machine (`oc` should be in your $PATH).
To use odo you need access to an OpenShift instance and have OpenShift CLI installed on your local machine (`oc` should be in your $PATH).

### OpenShift instance
You can use [Minishift](https://docs.openshift.org/latest/minishift/index.html) to get a local instance of OpenShift. However ocdev can be used with any instance of OpenShift.
You can use [Minishift](https://docs.openshift.org/latest/minishift/index.html) to get a local instance of OpenShift. However odo can be used with any instance of OpenShift.

### OpenShift CLI
There are different ways to install OpenShift CLI.
Please follow [OpenShift documentation](https://docs.openshift.org/latest/cli_reference/get_started_cli.html#installing-the-cli).

## Installation
To install `ocdev` on your system, you can use the fully automated [install.sh](./scripts/install.sh) script.
This script will enable ocdev repository on your system and install ocdev using package manager depending on your system.
To install `odo` on your system, you can use the fully automated [install.sh](./scripts/install.sh) script.
This script will enable odo repository on your system and install odo using package manager depending on your system.
Supported systems are Debian, Ubuntu, Fedora, CentOS and macOS. You can find more information about package repositories in
[Advanced installation guide](./docs/advanced-installation-guide.md)

```
curl -L https://github.com/redhat-developer/ocdev/raw/master/scripts/install.sh | bash
curl -L https://github.com/redhat-developer/odo/raw/master/scripts/install.sh | bash
```


If you don't want to add extra package repositories to your system you can just extract `ocdev` binary from [GitHub releases page](https://github.com/redhat-developer/ocdev/releases) to one of the directories that are in your `$PATH`.
If you don't want to add extra package repositories to your system you can just extract `odo` binary from [GitHub releases page](https://github.com/redhat-developer/odo/releases) to one of the directories that are in your `$PATH`.

For macOS:

```
sudo curl -L "https://github.com/redhat-developer/ocdev/releases/download/v0.0.3/ocdev-darwin-amd64.gz" | gzip -d > /usr/local/bin/ocdev; chmod +x /usr/local/bin/ocdev
sudo curl -L "https://github.com/redhat-developer/odo/releases/download/v0.0.3/odo-darwin-amd64.gz" | gzip -d > /usr/local/bin/odo; chmod +x /usr/local/bin/odo
```

For Linux:
```
sudo curl -L "https://github.com/redhat-developer/ocdev/releases/download/v0.0.3/ocdev-linux-amd64.gz" | gzip -d > /usr/local/bin/ocdev; chmod +x /usr/local/bin/ocdev
sudo curl -L "https://github.com/redhat-developer/odo/releases/download/v0.0.3/odo-linux-amd64.gz" | gzip -d > /usr/local/bin/odo; chmod +x /usr/local/bin/odo
```

You can also download latest master builds from [Bintray](https://dl.bintray.com/ocdev/ocdev/latest/). This is updated every time there is a change in master git branch.
You can also download latest master builds from [Bintray](https://dl.bintray.com/odo/odo/latest/). This is updated every time there is a change in master git branch.



@@ -50,16 +50,16 @@ You can also download latest master builds from [Bintray](https://dl.bintray.com
Multiple component types are currently supported, like nodejs, perl, php, python, ruby, etc.

## Getting Started
Developing applications using ocdev is as simple as -
- `ocdev application create <name>`
- `ocdev create <name>`
- `ocdev push`
Developing applications using odo is as simple as -
- `odo application create <name>`
- `odo create <name>`
- `odo push`

Check out our [Getting Started](docs/getting-started.md) guide and get going!

## CLI Structure
```
ocdev --verbose : OpenShift CLI for Developers
odo --verbose : OpenShift CLI for Developers
application --short : Perform application operations
create : create an application
delete --force : delete the given application
@@ -91,7 +91,7 @@ ocdev --verbose : OpenShift CLI for Developers
create : Create a URL for a component
delete : Delete a URL
list --application --component : List URLs
version : Print the version of ocdev
version : Print the version of odo
watch : Watch for changes, update component on change
```
*_autogenerated_
@@ -6,7 +6,7 @@ import (

"strings"

"github.com/redhat-developer/ocdev/pkg/application"
"github.com/redhat-developer/odo/pkg/application"
"github.com/spf13/cobra"
)

@@ -20,7 +20,7 @@ var applicationCmd = &cobra.Command{
Use: "application",
Short: "Perform application operations",
Aliases: []string{"app"},
// 'ocdev application' is the same as 'ocdev application get'
// 'odo application' is the same as 'odo application get'
Run: applicationGetCmd.Run,
}

@@ -54,7 +54,7 @@ var applicationGetCmd = &cobra.Command{
return
}
if app == "" {
fmt.Printf("There's no active application.\nYou can create one by running 'ocdev application create <name>'.")
fmt.Printf("There's no active application.\nYou can create one by running 'odo application create <name>'.")
return
}
fmt.Printf("The current application is: %v\n", app)
@@ -2,7 +2,7 @@ package cmd

import (
"fmt"
"github.com/redhat-developer/ocdev/pkg/catalog"
"github.com/redhat-developer/odo/pkg/catalog"
"github.com/spf13/cobra"
)

@@ -17,7 +17,7 @@ var catalogListCmd = &cobra.Command{
Long: "List all available component types.",
Example: `
# Get the supported components
ocdev catalog list
odo catalog list
`,
Args: cobra.ExactArgs(0),
Run: func(cmd *cobra.Command, args []string) {
@@ -45,7 +45,7 @@ This searches for a partial match for the given search term in all the available
components.
`,
Example: `# Search for a component
ocdev catalog search pyt
odo catalog search pyt
`,
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
@@ -16,8 +16,8 @@ var completionCmd = &cobra.Command{
Auto completion supports both bash and zsh. Output is to STDOUT.
source <(ocdev completion bash)
source <(ocdev completion zsh)
source <(odo completion bash)
source <(odo completion zsh)
Will load the shell completion code.
`,
@@ -36,10 +36,10 @@ func Generate(cmd *cobra.Command, args []string) error {

// Check the passed in arguments
if len(args) == 0 {
return fmt.Errorf("Shell not specified. ex. ocdev completion [bash|zsh]")
return fmt.Errorf("Shell not specified. ex. odo completion [bash|zsh]")
}
if len(args) > 1 {
return fmt.Errorf("Too many arguments. Expected only the shell type. ex. ocdev completion [bash|zsh]")
return fmt.Errorf("Too many arguments. Expected only the shell type. ex. odo completion [bash|zsh]")
}
shell := args[0]

@@ -66,33 +66,33 @@ func init() {
https://github.com/kubernetes/kubernetes/blob/ea18d5c32ee7c320fe96dda6b0c757476908e696/pkg/kubectl/cmd/completion.go
in order to generate ZSH completion support.
*/
func runCompletionZsh(out io.Writer, ocdev *cobra.Command) error {
func runCompletionZsh(out io.Writer, odo *cobra.Command) error {

zshInitialization := `
__ocdev_bash_source() {
__odo_bash_source() {
alias shopt=':'
alias _expand=_bash_expand
alias _complete=_bash_comp
emulate -L sh
setopt kshglob noshglob braceexpand
source "$@"
}
__ocdev_type() {
__odo_type() {
# -t is not supported by zsh
if [ "$1" == "-t" ]; then
shift
# fake Bash 4 to disable "complete -o nospace". Instead
# "compopt +-o nospace" is used in the code to toggle trailing
# spaces. We don't support that, but leave trailing spaces on
# all the time
if [ "$1" = "__ocdev_compopt" ]; then
if [ "$1" = "__odo_compopt" ]; then
echo builtin
return 0
fi
fi
type "$@"
}
__ocdev_compgen() {
__odo_compgen() {
local completions w
completions=( $(compgen "$@") ) || return $?
# filter by given word as prefix
@@ -109,17 +109,17 @@ __ocdev_compgen() {
fi
done
}
__ocdev_compopt() {
__odo_compopt() {
true # don't do anything. Not supported by bashcompinit in zsh
}
__ocdev_declare() {
__odo_declare() {
if [ "$1" == "-F" ]; then
whence -w "$@"
else
builtin declare "$@"
fi
}
__ocdev_ltrim_colon_completions()
__odo_ltrim_colon_completions()
{
if [[ "$1" == *:* && "$COMP_WORDBREAKS" == *:* ]]; then
# Remove colon-word prefix from COMPREPLY items
@@ -130,13 +130,13 @@ __ocdev_ltrim_colon_completions()
done
fi
}
__ocdev_get_comp_words_by_ref() {
__odo_get_comp_words_by_ref() {
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[${COMP_CWORD}-1]}"
words=("${COMP_WORDS[@]}")
cword=("${COMP_CWORD[@]}")
}
__ocdev_filedir() {
__odo_filedir() {
local RET OLD_IFS w qw
__debug "_filedir $@ cur=$cur"
if [[ "$1" = \~* ]]; then
@@ -159,7 +159,7 @@ __ocdev_filedir() {
continue
fi
if eval "[[ \"\${w}\" = *.$1 || -d \"\${w}\" ]]"; then
qw="$(__ocdev_quote "${w}")"
qw="$(__odo_quote "${w}")"
if [ -d "${w}" ]; then
COMPREPLY+=("${qw}/")
else
@@ -168,7 +168,7 @@ __ocdev_filedir() {
fi
done
}
__ocdev_quote() {
__odo_quote() {
if [[ $1 == \'* || $1 == \"* ]]; then
# Leave out first character
printf %q "${1:1}"
@@ -184,31 +184,31 @@ if sed --help 2>&1 | grep -q GNU; then
LWORD='\<'
RWORD='\>'
fi
__ocdev_convert_bash_to_zsh() {
__odo_convert_bash_to_zsh() {
sed \
-e 's/declare -F/whence -w/' \
-e 's/local \([a-zA-Z0-9_]*\)=/local \1; \1=/' \
-e 's/flags+=("\(--.*\)=")/flags+=("\1"); two_word_flags+=("\1")/' \
-e 's/must_have_one_flag+=("\(--.*\)=")/must_have_one_flag+=("\1")/' \
-e "s/${LWORD}_filedir${RWORD}/__ocdev_filedir/g" \
-e "s/${LWORD}_get_comp_words_by_ref${RWORD}/__ocdev_get_comp_words_by_ref/g" \
-e "s/${LWORD}__ltrim_colon_completions${RWORD}/__ocdev_ltrim_colon_completions/g" \
-e "s/${LWORD}compgen${RWORD}/__ocdev_compgen/g" \
-e "s/${LWORD}compopt${RWORD}/__ocdev_compopt/g" \
-e "s/${LWORD}declare${RWORD}/__ocdev_declare/g" \
-e "s/\\\$(type${RWORD}/\$(__ocdev_type/g" \
-e "s/${LWORD}_filedir${RWORD}/__odo_filedir/g" \
-e "s/${LWORD}_get_comp_words_by_ref${RWORD}/__odo_get_comp_words_by_ref/g" \
-e "s/${LWORD}__ltrim_colon_completions${RWORD}/__odo_ltrim_colon_completions/g" \
-e "s/${LWORD}compgen${RWORD}/__odo_compgen/g" \
-e "s/${LWORD}compopt${RWORD}/__odo_compopt/g" \
-e "s/${LWORD}declare${RWORD}/__odo_declare/g" \
-e "s/\\\$(type${RWORD}/\$(__odo_type/g" \
<<'BASH_COMPLETION_EOF'
`
out.Write([]byte(zshInitialization))

buf := new(bytes.Buffer)
ocdev.GenBashCompletion(buf)
odo.GenBashCompletion(buf)
out.Write(buf.Bytes())

zshTail := `
BASH_COMPLETION_EOF
}
__ocdev_bash_source <(__ocdev_convert_bash_to_zsh)
__odo_bash_source <(__odo_convert_bash_to_zsh)
`
out.Write([]byte(zshTail))
return nil

0 comments on commit 73f6148

Please sign in to comment.
You can’t perform that action at this time.