mirror of
https://github.com/redhat-developer/odo.git
synced 2025-10-19 03:06:19 +03:00
Renaming ocdev to odo
Resolves #336. I didn't change bintray repo name yet. Others, almost all references are changed to odo.
This commit is contained in:
committed by
Tomas Kral
parent
f806f152c6
commit
73f6148780
2
.gitignore
vendored
2
.gitignore
vendored
@@ -3,7 +3,7 @@
|
||||
#
|
||||
|
||||
# Ignore compiled files
|
||||
ocdev
|
||||
odo
|
||||
dist
|
||||
bin
|
||||
|
||||
|
||||
10
.travis.yml
10
.travis.yml
@@ -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
|
||||
|
||||
8
Makefile
8
Makefile
@@ -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!
|
||||
|
||||
36
README.md
36
README.md
@@ -1,46 +1,46 @@
|
||||
# ocdev
|
||||
[](https://travis-ci.org/redhat-developer/ocdev) [](https://codecov.io/gh/redhat-developer/ocdev)
|
||||
# odo
|
||||
[](https://travis-ci.org/redhat-developer/odo) [](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,10 +66,10 @@ 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
|
||||
@@ -77,7 +77,7 @@ __ocdev_bash_source() {
|
||||
setopt kshglob noshglob braceexpand
|
||||
source "$@"
|
||||
}
|
||||
__ocdev_type() {
|
||||
__odo_type() {
|
||||
# -t is not supported by zsh
|
||||
if [ "$1" == "-t" ]; then
|
||||
shift
|
||||
@@ -85,14 +85,14 @@ __ocdev_type() {
|
||||
# "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
|
||||
|
||||
@@ -2,7 +2,7 @@ package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/redhat-developer/ocdev/pkg/component"
|
||||
"github.com/redhat-developer/odo/pkg/component"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
var componentCmd = &cobra.Command{
|
||||
Use: "component",
|
||||
Short: "Components of application.",
|
||||
// 'ocdev component' is the same as 'ocdev component get'
|
||||
// 'odo component' is the same as 'odo component get'
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
if len(args) > 0 && args[0] != "get" && args[0] != "set" {
|
||||
componentSetCmd.Run(cmd, args)
|
||||
@@ -48,7 +48,7 @@ var componentSetCmd = &cobra.Command{
|
||||
Short: "Set active component.",
|
||||
Long: "Set component as active.",
|
||||
Example: ` # Set component named 'frontend' as active
|
||||
ocdev set component frontend
|
||||
odo set component frontend
|
||||
`,
|
||||
Args: cobra.ExactArgs(1),
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/redhat-developer/ocdev/pkg/component"
|
||||
"github.com/redhat-developer/odo/pkg/component"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
@@ -24,13 +24,13 @@ var componentCreateCmd = &cobra.Command{
|
||||
If component name is not provided, component type value will be used for name.
|
||||
`,
|
||||
Example: ` # Create new nodejs component with the source in current directory.
|
||||
ocdev create nodejs
|
||||
odo create nodejs
|
||||
|
||||
# Create new nodejs component named 'frontend' with the source in './frontend' directory
|
||||
ocdev create nodejs frontend --local ./frontend
|
||||
odo create nodejs frontend --local ./frontend
|
||||
|
||||
# Create new nodejs component with source from remote git repository.
|
||||
ocdev create nodejs --git https://github.com/openshift/nodejs-ex.git
|
||||
odo create nodejs --git https://github.com/openshift/nodejs-ex.git
|
||||
`,
|
||||
Args: cobra.RangeArgs(1, 2),
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
|
||||
@@ -4,8 +4,8 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/redhat-developer/ocdev/pkg/application"
|
||||
"github.com/redhat-developer/ocdev/pkg/component"
|
||||
"github.com/redhat-developer/odo/pkg/application"
|
||||
"github.com/redhat-developer/odo/pkg/component"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
@@ -20,7 +20,7 @@ var componentDeleteCmd = &cobra.Command{
|
||||
Short: "Delete existing component",
|
||||
Long: "Delete existing component.",
|
||||
Example: ` # Delete component named 'frontend'.
|
||||
ocdev delete frontend
|
||||
odo delete frontend
|
||||
`,
|
||||
Args: cobra.ExactArgs(1),
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
|
||||
@@ -2,7 +2,7 @@ package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/redhat-developer/ocdev/pkg/component"
|
||||
"github.com/redhat-developer/odo/pkg/component"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package cmd
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/redhat-developer/ocdev/pkg/project"
|
||||
"github.com/redhat-developer/odo/pkg/project"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
|
||||
14
cmd/push.go
14
cmd/push.go
@@ -5,9 +5,9 @@ import (
|
||||
"net/url"
|
||||
"os"
|
||||
|
||||
"github.com/redhat-developer/ocdev/pkg/application"
|
||||
"github.com/redhat-developer/ocdev/pkg/component"
|
||||
"github.com/redhat-developer/ocdev/pkg/project"
|
||||
"github.com/redhat-developer/odo/pkg/application"
|
||||
"github.com/redhat-developer/odo/pkg/component"
|
||||
"github.com/redhat-developer/odo/pkg/project"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cobra"
|
||||
@@ -18,13 +18,13 @@ var pushCmd = &cobra.Command{
|
||||
Short: "Push source code to component",
|
||||
Long: `Push source code to component.`,
|
||||
Example: ` # Push source code to the to the current component
|
||||
ocdev push
|
||||
odo push
|
||||
|
||||
# Push data to the current component from original source.
|
||||
ocdev push
|
||||
odo push
|
||||
|
||||
# Push source code in ~/home/mycode to component called my-component
|
||||
ocdev push my-component --local ~/home/mycode
|
||||
odo push my-component --local ~/home/mycode
|
||||
`,
|
||||
Args: cobra.MaximumNArgs(1),
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
@@ -41,7 +41,7 @@ var pushCmd = &cobra.Command{
|
||||
checkError(err, "unable to get current component")
|
||||
if componentName == "" {
|
||||
fmt.Println("No component is set as active.")
|
||||
fmt.Println("Use 'ocdev component set <component name> to set and existing component as active or call this command with component name as and argument.")
|
||||
fmt.Println("Use 'odo component set <component name> to set and existing component as active or call this command with component name as and argument.")
|
||||
os.Exit(1)
|
||||
}
|
||||
} else {
|
||||
|
||||
14
cmd/root.go
14
cmd/root.go
@@ -5,8 +5,8 @@ import (
|
||||
"os"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/redhat-developer/ocdev/pkg/notify"
|
||||
"github.com/redhat-developer/ocdev/pkg/occlient"
|
||||
"github.com/redhat-developer/odo/pkg/notify"
|
||||
"github.com/redhat-developer/odo/pkg/occlient"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
@@ -18,7 +18,7 @@ var (
|
||||
|
||||
// rootCmd represents the base command when called without any subcommands
|
||||
var rootCmd = &cobra.Command{
|
||||
Use: "ocdev",
|
||||
Use: "odo",
|
||||
Short: "OpenShift CLI for Developers",
|
||||
Long: `OpenShift CLI for Developers`,
|
||||
PersistentPreRun: func(cmd *cobra.Command, args []string) {
|
||||
@@ -53,7 +53,7 @@ func init() {
|
||||
// Here you will define your flags and configuration settings.
|
||||
// Cobra supports persistent flags, which, if defined here,
|
||||
// will be global for your application.
|
||||
// rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.ocdev.yaml)")
|
||||
// rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.odo.yaml)")
|
||||
|
||||
rootCmd.PersistentFlags().BoolVarP(&GlobalVerbose, "verbose", "v", false, "Verbose output")
|
||||
}
|
||||
@@ -63,14 +63,14 @@ func getLatestReleaseInfo(info chan<- string) {
|
||||
if err != nil {
|
||||
// The error is intentionally not being handled because we don't want
|
||||
// to stop the execution of the program because of this failure
|
||||
log.Debugf("Error checking if newer ocdev release is available: %v", err)
|
||||
log.Debugf("Error checking if newer odo release is available: %v", err)
|
||||
}
|
||||
if len(newTag) > 0 {
|
||||
info <- "---\n" +
|
||||
"A newer version of ocdev (version: " + fmt.Sprint(newTag) + ") is available.\n" +
|
||||
"A newer version of odo (version: " + fmt.Sprint(newTag) + ") is available.\n" +
|
||||
"Update using your package manager, or run\n" +
|
||||
"curl " + notify.InstallScriptURL + " | sh\n" +
|
||||
"to update manually, or visit https://github.com/redhat-developer/ocdev/releases\n" +
|
||||
"to update manually, or visit https://github.com/redhat-developer/odo/releases\n" +
|
||||
"---\n"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,10 +3,10 @@ package cmd
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/redhat-developer/ocdev/pkg/application"
|
||||
"github.com/redhat-developer/ocdev/pkg/component"
|
||||
"github.com/redhat-developer/ocdev/pkg/occlient"
|
||||
"github.com/redhat-developer/ocdev/pkg/storage"
|
||||
"github.com/redhat-developer/odo/pkg/application"
|
||||
"github.com/redhat-developer/odo/pkg/component"
|
||||
"github.com/redhat-developer/odo/pkg/occlient"
|
||||
"github.com/redhat-developer/odo/pkg/storage"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/redhat-developer/ocdev/pkg/component"
|
||||
"github.com/redhat-developer/odo/pkg/component"
|
||||
"github.com/spf13/cobra"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@@ -12,16 +12,16 @@ var updateCmd = &cobra.Command{
|
||||
Use: "update",
|
||||
Args: cobra.MaximumNArgs(1),
|
||||
Example: ` # Change the source of a currently active component to local (use the current directory as a source)
|
||||
ocdev update --local
|
||||
odo update --local
|
||||
|
||||
# Change the source of the frontend component to local with source in ./frontend directory
|
||||
ocdev update frontend --local ./frontend
|
||||
odo update frontend --local ./frontend
|
||||
|
||||
# Change the source of a currently active component to git
|
||||
ocdev update --git https://github.com/openshift/nodejs-ex.git
|
||||
odo update --git https://github.com/openshift/nodejs-ex.git
|
||||
|
||||
# Change the source of the component named node-ex to git
|
||||
ocdev update node-ex --git https://github.com/openshift/nodejs-ex.git
|
||||
odo update node-ex --git https://github.com/openshift/nodejs-ex.git
|
||||
`,
|
||||
Short: "Change the source of a component",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
|
||||
14
cmd/url.go
14
cmd/url.go
@@ -4,9 +4,9 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/redhat-developer/ocdev/pkg/application"
|
||||
"github.com/redhat-developer/ocdev/pkg/component"
|
||||
"github.com/redhat-developer/ocdev/pkg/url"
|
||||
"github.com/redhat-developer/odo/pkg/application"
|
||||
"github.com/redhat-developer/odo/pkg/component"
|
||||
"github.com/redhat-developer/odo/pkg/url"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
@@ -32,10 +32,10 @@ The created URL can be used to access the specified component from outside the
|
||||
OpenShift cluster.
|
||||
`,
|
||||
Example: `# Create a URL for the current component.
|
||||
ocdev url create
|
||||
odo url create
|
||||
|
||||
# Create a URL for a specific component
|
||||
ocdev url create <component name>
|
||||
odo url create <component name>
|
||||
`,
|
||||
Args: cobra.MaximumNArgs(1),
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
@@ -69,7 +69,7 @@ var urlDeleteCmd = &cobra.Command{
|
||||
Deleted the given URL, hence making the service inaccessible.
|
||||
`,
|
||||
Example: `# Delete a URL to a component
|
||||
ocdev url delete <URL>
|
||||
odo url delete <URL>
|
||||
`,
|
||||
Args: cobra.ExactArgs(1),
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
@@ -87,7 +87,7 @@ var urlListCmd = &cobra.Command{
|
||||
Long: `List URLs.
|
||||
Lists all the available URLs which can be used to access the components.`,
|
||||
Example: ` # List the available URLs
|
||||
ocdev url list
|
||||
odo url list
|
||||
`,
|
||||
Args: cobra.ExactArgs(0),
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
|
||||
@@ -9,11 +9,11 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
// VERSION is version number that will be displayed when running ./ocdev version
|
||||
// VERSION is version number that will be displayed when running ./odo version
|
||||
VERSION = "v0.0.3"
|
||||
|
||||
// GITCOMMIT is hash of the commit that wil be displayed when running ./ocdev version
|
||||
// this will be overwritten when running build like this: go build -ldflags="-X github.com/redhat-developer/ocdev/cmd.GITCOMMIT=$(GITCOMMIT)"
|
||||
// GITCOMMIT is hash of the commit that wil be displayed when running ./odo version
|
||||
// this will be overwritten when running build like this: go build -ldflags="-X github.com/redhat-developer/odo/cmd.GITCOMMIT=$(GITCOMMIT)"
|
||||
// HEAD is default indicating that this was not set during build
|
||||
GITCOMMIT = "HEAD"
|
||||
)
|
||||
@@ -21,7 +21,7 @@ var (
|
||||
// versionCmd represents the version command
|
||||
var versionCmd = &cobra.Command{
|
||||
Use: "version",
|
||||
Short: "Print the version of ocdev",
|
||||
Short: "Print the version of odo",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
|
||||
// If verbose mode is enabled, dump all KUBECLT_* env variables
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
|
||||
# Advanced Installation Guide
|
||||
|
||||
Latest binaries build from git master are available at https://dl.bintray.com/ocdev/ocdev/latest/.
|
||||
Latest binaries build from git master are available at https://dl.bintray.com/odo/odo/latest/.
|
||||
|
||||
Builds for latest released versions are at [GitHub releases page](https://github.com/redhat-developer/ocdev/releases/latest).
|
||||
Builds for latest released versions are at [GitHub releases page](https://github.com/redhat-developer/odo/releases/latest).
|
||||
|
||||
## macOS
|
||||
1. First, you need to enable `kadel/ocdev` Homebrew Tap:
|
||||
1. First, you need to enable `kadel/odo` Homebrew Tap:
|
||||
```sh
|
||||
brew tap kadel/ocdev
|
||||
brew tap kadel/odo
|
||||
```
|
||||
2.
|
||||
- If you want to install latest master build
|
||||
```sh
|
||||
brew install kadel/ocdev/ocdev -- HEAD
|
||||
brew install kadel/odo/odo -- HEAD
|
||||
```
|
||||
- If you want to install latest released version
|
||||
```sh
|
||||
brew install kadel/ocdev/ocdev
|
||||
brew install kadel/odo/odo
|
||||
```
|
||||
|
||||
## Linux
|
||||
@@ -26,58 +26,58 @@ Builds for latest released versions are at [GitHub releases page](https://github
|
||||
```sh
|
||||
curl -L https://bintray.com/user/downloadSubjectPublicKey?username=bintray | apt-key add -
|
||||
```
|
||||
2. Add ocdev repository to your `/etc/apt/sources.list`
|
||||
- If you want to use latest master builds add `deb https://dl.bintray.com/ocdev/ocdev-deb-dev stretch main` repository.
|
||||
2. Add odo repository to your `/etc/apt/sources.list`
|
||||
- If you want to use latest master builds add `deb https://dl.bintray.com/odo/odo-deb-dev stretch main` repository.
|
||||
```sh
|
||||
echo "deb https://dl.bintray.com/ocdev/ocdev-deb-dev stretch main" | sudo tee -a /etc/apt/sources.list
|
||||
echo "deb https://dl.bintray.com/odo/odo-deb-dev stretch main" | sudo tee -a /etc/apt/sources.list
|
||||
```
|
||||
- If you want to use latest released version add `deb https://dl.bintray.com/ocdev/ocdev-deb-releases stretch main` repository.
|
||||
- If you want to use latest released version add `deb https://dl.bintray.com/odo/odo-deb-releases stretch main` repository.
|
||||
```sh
|
||||
echo "deb https://dl.bintray.com/ocdev/ocdev-deb-releases stretch main" | sudo tee -a /etc/apt/sources.list
|
||||
echo "deb https://dl.bintray.com/odo/odo-deb-releases stretch main" | sudo tee -a /etc/apt/sources.list
|
||||
```
|
||||
3. Now you can install `ocdev` and you would install any other package.
|
||||
3. Now you can install `odo` and you would install any other package.
|
||||
```sh
|
||||
apt-get update
|
||||
apt-get install ocdev
|
||||
apt-get install odo
|
||||
```
|
||||
|
||||
|
||||
### Fedora/Centos/RHEL and other distribution using rpm
|
||||
1. Add ocdev repository to your `/etc/yum.repos.d/`
|
||||
- If you want to use latest master builds save following text to `/etc/yum.repos.d/bintray-ocdev-ocdev-rpm-dev.repo`
|
||||
1. Add odo repository to your `/etc/yum.repos.d/`
|
||||
- If you want to use latest master builds save following text to `/etc/yum.repos.d/bintray-odo-odo-rpm-dev.repo`
|
||||
```
|
||||
# /etc/yum.repos.d/bintray-ocdev-ocdev-rpm-dev.repo
|
||||
[bintraybintray-ocdev-ocdev-rpm-dev]
|
||||
name=bintray-ocdev-ocdev-rpm-dev
|
||||
baseurl=https://dl.bintray.com/ocdev/ocdev-rpm-dev
|
||||
# /etc/yum.repos.d/bintray-odo-odo-rpm-dev.repo
|
||||
[bintraybintray-odo-odo-rpm-dev]
|
||||
name=bintray-odo-odo-rpm-dev
|
||||
baseurl=https://dl.bintray.com/odo/odo-rpm-dev
|
||||
gpgcheck=0
|
||||
repo_gpgcheck=0
|
||||
enabled=1
|
||||
```
|
||||
Or you can download it using following command:
|
||||
```sh
|
||||
sudo curl -L https://bintray.com/ocdev/ocdev-rpm-dev/rpm -o /etc/yum.repos.d/bintray-ocdev-ocdev-rpm-dev.repo
|
||||
sudo curl -L https://bintray.com/odo/odo-rpm-dev/rpm -o /etc/yum.repos.d/bintray-odo-odo-rpm-dev.repo
|
||||
```
|
||||
- If you want to use latest released version save following text to `/etc/yum.repos.d/bintray-ocdev-ocdev-rpm-releases.repo`
|
||||
- If you want to use latest released version save following text to `/etc/yum.repos.d/bintray-odo-odo-rpm-releases.repo`
|
||||
```
|
||||
# /etc/yum.repos.d/bintray-ocdev-ocdev-rpm-releases.repo
|
||||
[bintraybintray-ocdev-ocdev-rpm-releases]
|
||||
name=bintray-ocdev-ocdev-rpm-releases
|
||||
baseurl=https://dl.bintray.com/ocdev/ocdev-rpm-releases
|
||||
# /etc/yum.repos.d/bintray-odo-odo-rpm-releases.repo
|
||||
[bintraybintray-odo-odo-rpm-releases]
|
||||
name=bintray-odo-odo-rpm-releases
|
||||
baseurl=https://dl.bintray.com/odo/odo-rpm-releases
|
||||
gpgcheck=0
|
||||
repo_gpgcheck=0
|
||||
enabled=1
|
||||
```
|
||||
Or you can download it using following command:
|
||||
```sh
|
||||
sudo curl -L https://bintray.com/ocdev/ocdev-rpm-releases/rpm -o /etc/yum.repos.d/bintray-ocdev-ocdev-rpm-releases.repo
|
||||
sudo curl -L https://bintray.com/odo/odo-rpm-releases/rpm -o /etc/yum.repos.d/bintray-odo-odo-rpm-releases.repo
|
||||
```
|
||||
3. Now you can install `ocdev` and you would install any other package.
|
||||
3. Now you can install `odo` and you would install any other package.
|
||||
```sh
|
||||
yum install ocdev
|
||||
# or 'dnf install ocdev'
|
||||
yum install odo
|
||||
# or 'dnf install odo'
|
||||
```
|
||||
|
||||
## Windows
|
||||
Download latest master builds from Bintray [ocdev.exe](https://dl.bintray.com/ocdev/ocdev/latest/windows-amd64/:ocdev.exe) or
|
||||
builds for released versions from [GitHub releases page](https://github.com/kadel/ocdev/releases).
|
||||
Download latest master builds from Bintray [odo.exe](https://dl.bintray.com/odo/odo/latest/windows-amd64/:odo.exe) or
|
||||
builds for released versions from [GitHub releases page](https://github.com/kadel/odo/releases).
|
||||
@@ -11,9 +11,9 @@ When new git tag is created, Travis-ci deploy job automatically builds binaries
|
||||
- [cmd/version.go](/cmd/version.go)
|
||||
- [scripts/install.sh](/scripts/install.sh)
|
||||
- [README.md](/README.md)
|
||||
- [ocdev.rb](https://github.com/kadel/homebrew-ocdev/blob/master/Formula/ocdev.rb) in [kadel/homebrew-ocdev](https://github.com/kadel/homebrew-ocdev)
|
||||
- [odo.rb](https://github.com/kadel/homebrew-odo/blob/master/Formula/odo.rb) in [kadel/homebrew-odo](https://github.com/kadel/homebrew-odo)
|
||||
|
||||
There is a helper script [scripts/bump-version.sh](/scripts/bump-version.sh) that should change version number in all files listed above (expect ocdev.rb).
|
||||
There is a helper script [scripts/bump-version.sh](/scripts/bump-version.sh) that should change version number in all files listed above (expect odo.rb).
|
||||
2. When PR is merged create and push new git tag for version.
|
||||
```
|
||||
git tag v0.0.1
|
||||
@@ -22,14 +22,14 @@ When new git tag is created, Travis-ci deploy job automatically builds binaries
|
||||
Or create new release using GitHub site (this has to be a proper release, not just draft).
|
||||
Do not upload any binaries for release
|
||||
When new tag is created Travis-CI starts a special deploy job.
|
||||
This job builds binaries automatically (via `make prepare-release`) and then uploads it to GitHub release page (done using ocdev-bot user).
|
||||
This job builds binaries automatically (via `make prepare-release`) and then uploads it to GitHub release page (done using odo-bot user).
|
||||
3. When job fishes you should see binaries on GitHub release page. Release is now marked as a draft. Update descriptions and publish release.
|
||||
4. Verify that packages have been uploaded to rpm and deb repositories.
|
||||
|
||||
## ocdev-bot
|
||||
## odo-bot
|
||||
This is GitHub user that does all the automation.
|
||||
|
||||
### Scripts using ocdev-bot
|
||||
### Scripts using odo-bot
|
||||
|
||||
| script | what it is doing | access via |
|
||||
|-|-|-|
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
# Getting Started
|
||||
|
||||
This guide will get you started with developing your microservices iteratively on OpenShift using `ocdev`.
|
||||
This guide will get you started with developing your microservices iteratively on OpenShift using `odo`.
|
||||
|
||||
We will be developing a nodejs application in this guide, you can try along by getting the code for the application by running: `git clone https://github.com/kadel/nodejs-ex`
|
||||
|
||||
#### Running OpenShift
|
||||
|
||||
The easiest way to get a single node OpenShift cluster is by using [minishift](https://docs.openshift.org/latest/minishift/index.html), but `ocdev` will work with any other OpenShift instance you are logged in to.
|
||||
The easiest way to get a single node OpenShift cluster is by using [minishift](https://docs.openshift.org/latest/minishift/index.html), but `odo` will work with any other OpenShift instance you are logged in to.
|
||||
|
||||
- Install minishift using this [installation guide](https://docs.openshift.org/latest/minishift/getting-started/installing.html)
|
||||
- The `oc` binary can be installed `minishift oc-env` command as described [here](https://docs.openshift.org/latest/minishift/getting-started/quickstart.html#starting-minishift)
|
||||
- Install ocdev using this [installation guide](/README.md#installation)
|
||||
- Install odo using this [installation guide](/README.md#installation)
|
||||
|
||||
Make sure that the commands exist by running -
|
||||
- `minishift version`
|
||||
- `oc version`
|
||||
- `ocdev version`
|
||||
- `odo version`
|
||||
|
||||
The output should look something like -
|
||||
```console
|
||||
@@ -29,7 +29,7 @@ features: Basic-Auth GSSAPI Kerberos SPNEGO
|
||||
|
||||
error: server took too long to respond with version information.
|
||||
|
||||
$ ocdev version
|
||||
$ odo version
|
||||
v0.0.1 (HEAD)
|
||||
```
|
||||
|
||||
@@ -81,7 +81,7 @@ Using project "myproject".
|
||||
|
||||
Make sure you are logged in to the cluster by running `oc whoami` command.
|
||||
|
||||
Now we can move on to creating our application using `ocdev`.
|
||||
Now we can move on to creating our application using `odo`.
|
||||
|
||||
#### Create an application
|
||||
|
||||
@@ -90,7 +90,7 @@ An application is an umbrella under which you will build all the components (mic
|
||||
Let's create an application -
|
||||
|
||||
```console
|
||||
$ ocdev application create nodeapp
|
||||
$ odo application create nodeapp
|
||||
Creating application: nodeapp
|
||||
Switched to application: nodeapp
|
||||
```
|
||||
@@ -100,7 +100,7 @@ Switched to application: nodeapp
|
||||
Now that you have created an application, now add a component of type _nodejs_ to the application, from the current directory where our code lies.
|
||||
|
||||
```console
|
||||
$ ocdev create nodejs --local=.
|
||||
$ odo create nodejs --local=.
|
||||
--> Found image 2809a54 (3 weeks old) in image stream "openshift/nodejs" under tag "6" for "nodejs"
|
||||
--> Creating resources with label app=nodeapp,app.kubernetes.io/component-name=nodejs,app.kubernetes.io/name=nodeapp ...
|
||||
imagestream "nodejs" created
|
||||
@@ -126,7 +126,7 @@ Great news! Your component has been deployed on OpenShift now. Let's quickly che
|
||||
|
||||
We need create the URL so we can connect to it our application.
|
||||
```
|
||||
$ ocdev url create
|
||||
$ odo url create
|
||||
Adding URL to component: nodejs
|
||||
URL created for component: nodejs
|
||||
|
||||
@@ -139,24 +139,24 @@ Now just open the URL `nodejs-myproject.192.168.42.147.nip.io` in the browser an
|
||||
|
||||
Well, your application looks great, but now you've made some changes in the code. Let's deploy these changes and see how it looks.
|
||||
|
||||
The current component is already set to nodejs, which can confirm from `ocdev component get`, so all we need to do is -
|
||||
The current component is already set to nodejs, which can confirm from `odo component get`, so all we need to do is -
|
||||
|
||||
```console
|
||||
$ ocdev push
|
||||
$ odo push
|
||||
pushing changes to component: nodejs
|
||||
changes successfully pushed to component: nodejs
|
||||
```
|
||||
|
||||
And now simply refresh your application in the browser, and you'll be able to see the changes.
|
||||
|
||||
Now you can repeat this cycle over and over again. Keep on making changes and keep pushing using `$ ocdev push nodejs`
|
||||
Now you can repeat this cycle over and over again. Keep on making changes and keep pushing using `$ odo push nodejs`
|
||||
|
||||
#### Add storage to a component
|
||||
|
||||
You need to add storage to your component, `ocdev` makes it very easy for you to do this.
|
||||
You need to add storage to your component, `odo` makes it very easy for you to do this.
|
||||
|
||||
```console
|
||||
$ ocdev storage create nodestorage --path=/opt/app-root/src/storage/ --size=1Gi
|
||||
$ odo storage add nodestorage --path=/opt/app-root/src/storage/ --size=1Gi
|
||||
Added storage nodestorage to nodejs
|
||||
```
|
||||
That just added 1Gi of storage to your nodejs component on the given path. Now your data will persist over application restarts.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package: github.com/redhat-developer/ocdev
|
||||
package: github.com/redhat-developer/odo
|
||||
import:
|
||||
- package: github.com/blang/semver
|
||||
version: v3.5.1
|
||||
|
||||
2
main.go
2
main.go
@@ -1,6 +1,6 @@
|
||||
package main
|
||||
|
||||
import "github.com/redhat-developer/ocdev/cmd"
|
||||
import "github.com/redhat-developer/odo/cmd"
|
||||
|
||||
func main() {
|
||||
cmd.Execute()
|
||||
|
||||
@@ -6,9 +6,9 @@ import (
|
||||
"github.com/pkg/errors"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/redhat-developer/ocdev/pkg/config"
|
||||
"github.com/redhat-developer/ocdev/pkg/occlient"
|
||||
"github.com/redhat-developer/ocdev/pkg/project"
|
||||
"github.com/redhat-developer/odo/pkg/config"
|
||||
"github.com/redhat-developer/odo/pkg/occlient"
|
||||
"github.com/redhat-developer/odo/pkg/project"
|
||||
)
|
||||
|
||||
// ApplicationLabel is label key that is used to group all object that belong to one application
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/redhat-developer/ocdev/pkg/occlient"
|
||||
"github.com/redhat-developer/odo/pkg/occlient"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
|
||||
@@ -9,11 +9,11 @@ import (
|
||||
"github.com/pkg/errors"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/redhat-developer/ocdev/pkg/application"
|
||||
"github.com/redhat-developer/ocdev/pkg/config"
|
||||
"github.com/redhat-developer/ocdev/pkg/occlient"
|
||||
"github.com/redhat-developer/ocdev/pkg/project"
|
||||
"github.com/redhat-developer/ocdev/pkg/util"
|
||||
"github.com/redhat-developer/odo/pkg/application"
|
||||
"github.com/redhat-developer/odo/pkg/config"
|
||||
"github.com/redhat-developer/odo/pkg/occlient"
|
||||
"github.com/redhat-developer/odo/pkg/project"
|
||||
"github.com/redhat-developer/odo/pkg/util"
|
||||
)
|
||||
|
||||
// ComponentLabel is a label key used to identify component
|
||||
@@ -44,8 +44,8 @@ func GetLabels(componentName string, applicationName string, additional bool) ma
|
||||
|
||||
func CreateFromGit(client *occlient.Client, name string, ctype string, url string) error {
|
||||
// if current application doesn't exist, create it
|
||||
// this can happen when ocdev is started form clean state
|
||||
// and default application is used (first command run is ocdev create)
|
||||
// this can happen when odo is started form clean state
|
||||
// and default application is used (first command run is odo create)
|
||||
currentApplication, err := application.GetCurrentOrGetAndSetDefault(client)
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "unable to create git component %s", name)
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
|
||||
const (
|
||||
configEnvName = "OCDEVCONFIG"
|
||||
configFileName = "ocdev"
|
||||
configFileName = "odo"
|
||||
)
|
||||
|
||||
// ApplicationInfo holds all important information about one application
|
||||
@@ -66,7 +66,7 @@ func getOcdevConfigFile() (string, error) {
|
||||
func New() (*ConfigInfo, error) {
|
||||
configFile, err := getOcdevConfigFile()
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "unable to get ocdev config file")
|
||||
return nil, errors.Wrap(err, "unable to get odo config file")
|
||||
}
|
||||
|
||||
_, err = os.Stat(configFile)
|
||||
@@ -92,7 +92,7 @@ func (c *ConfigInfo) get() error {
|
||||
|
||||
err = yaml.Unmarshal(configData, &c)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "unable to unmarshal ocdev config file")
|
||||
return errors.Wrap(err, "unable to unmarshal odo config file")
|
||||
}
|
||||
|
||||
return nil
|
||||
@@ -101,7 +101,7 @@ func (c *ConfigInfo) get() error {
|
||||
func (c *ConfigInfo) writeToFile() error {
|
||||
data, err := yaml.Marshal(&c.Config)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "unable to marshal ocdev config data")
|
||||
return errors.Wrap(err, "unable to marshal odo config data")
|
||||
}
|
||||
|
||||
err = ioutil.WriteFile(c.Filename, data, 0600)
|
||||
|
||||
@@ -14,7 +14,7 @@ func TestGetOcDevConfigFile(t *testing.T) {
|
||||
|
||||
func TestNew(t *testing.T) {
|
||||
|
||||
tempConfigFile, err := ioutil.TempFile("", "ocdevconfig")
|
||||
tempConfigFile, err := ioutil.TempFile("", "odoconfig")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -57,7 +57,7 @@ func TestNew(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSetActiveComponent(t *testing.T) {
|
||||
tempConfigFile, err := ioutil.TempFile("", "ocdevconfig")
|
||||
tempConfigFile, err := ioutil.TempFile("", "odoconfig")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -243,7 +243,7 @@ func TestSetActiveComponent(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestGetActiveComponent(t *testing.T) {
|
||||
tempConfigFile, err := ioutil.TempFile("", "ocdevconfig")
|
||||
tempConfigFile, err := ioutil.TempFile("", "odoconfig")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -678,7 +678,7 @@ func TestAddApplication(t *testing.T) {
|
||||
|
||||
func TestGetActiveApplication(t *testing.T) {
|
||||
|
||||
tempConfigFile, err := ioutil.TempFile("", "ocdevconfig")
|
||||
tempConfigFile, err := ioutil.TempFile("", "odoconfig")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -779,7 +779,7 @@ func TestGetActiveApplication(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestDeleteApplication(t *testing.T) {
|
||||
tempConfigFile, err := ioutil.TempFile("", "ocdevconfig")
|
||||
tempConfigFile, err := ioutil.TempFile("", "odoconfig")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -13,12 +13,12 @@ const (
|
||||
// project GitHub organization name
|
||||
ghorg = "redhat-developer"
|
||||
// project GitHub repository name
|
||||
ghrepo = "ocdev"
|
||||
ghrepo = "odo"
|
||||
// URL of the installation shell script
|
||||
InstallScriptURL = "https://raw.githubusercontent.com/redhat-developer/ocdev/master/scripts/install.sh"
|
||||
InstallScriptURL = "https://raw.githubusercontent.com/redhat-developer/odo/master/scripts/install.sh"
|
||||
)
|
||||
|
||||
// getLatestReleaseTag polls ocdev's upstream GitHub repository to get the
|
||||
// getLatestReleaseTag polls odo's upstream GitHub repository to get the
|
||||
// tag of the latest release
|
||||
func getLatestReleaseTag() (string, error) {
|
||||
client := github.NewClient(nil)
|
||||
|
||||
@@ -41,7 +41,7 @@ import (
|
||||
s2ifs "github.com/openshift/source-to-image/pkg/util/fs"
|
||||
|
||||
dockerapiv10 "github.com/openshift/api/image/docker10"
|
||||
"github.com/redhat-developer/ocdev/pkg/util"
|
||||
"github.com/redhat-developer/odo/pkg/util"
|
||||
"k8s.io/apimachinery/pkg/api/resource"
|
||||
"k8s.io/client-go/util/retry"
|
||||
)
|
||||
|
||||
@@ -2,7 +2,7 @@ package project
|
||||
|
||||
import (
|
||||
"github.com/pkg/errors"
|
||||
"github.com/redhat-developer/ocdev/pkg/occlient"
|
||||
"github.com/redhat-developer/odo/pkg/occlient"
|
||||
)
|
||||
|
||||
// ApplicationInfo holds information about one project
|
||||
|
||||
@@ -2,10 +2,11 @@ package storage
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/redhat-developer/ocdev/pkg/component"
|
||||
"github.com/redhat-developer/ocdev/pkg/occlient"
|
||||
"github.com/redhat-developer/ocdev/pkg/util"
|
||||
"github.com/redhat-developer/odo/pkg/component"
|
||||
"github.com/redhat-developer/odo/pkg/occlient"
|
||||
"github.com/redhat-developer/odo/pkg/util"
|
||||
log "github.com/sirupsen/logrus"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
)
|
||||
|
||||
@@ -4,9 +4,9 @@ import (
|
||||
"fmt"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/redhat-developer/ocdev/pkg/application"
|
||||
"github.com/redhat-developer/ocdev/pkg/component"
|
||||
"github.com/redhat-developer/ocdev/pkg/occlient"
|
||||
"github.com/redhat-developer/odo/pkg/application"
|
||||
"github.com/redhat-developer/odo/pkg/component"
|
||||
"github.com/redhat-developer/odo/pkg/occlient"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
name: "dev"
|
||||
shortDesc: "ocdev plugin"
|
||||
longDesc: "ocdev plugin to use ocdev as a plugin in OpenShift"
|
||||
command: "ocdev"
|
||||
shortDesc: "odo plugin"
|
||||
longDesc: "odo plugin to use odo as a plugin in OpenShift"
|
||||
command: "odo"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
# this scripts updates version number in ocdev source code
|
||||
# this scripts updates version number in odo source code
|
||||
# run this script from source root with new version as an argument (./scripts/bump-version.sh v0.0.2 )
|
||||
|
||||
NEW_VERSION=$1
|
||||
@@ -33,6 +33,6 @@ sed -i "s/\(LATEST_VERSION=\)\"v[0-9]*\.[0-9]*\.[0-9]*\"/\1\"${NEW_VERSION}\"/g"
|
||||
check_version scripts/install.sh
|
||||
|
||||
echo "****************************************************************************************"
|
||||
echo "* Don't forget to update homebrew package at https://github.com/kadel/homebrew-ocdev ! *"
|
||||
echo "* Don't forget to update homebrew package at https://github.com/kadel/homebrew-odo ! *"
|
||||
echo "****************************************************************************************"
|
||||
|
||||
|
||||
@@ -12,13 +12,13 @@ PKG_VERSION=$(date "+%Y%m%d%H%M%S")
|
||||
|
||||
# if this is run on travis make sure that binary was build with corrent version
|
||||
if [[ -n $TRAVIS_TAG ]]; then
|
||||
echo "Checking if ocdev version was set to the same version as current tag"
|
||||
echo "Checking if odo version was set to the same version as current tag"
|
||||
# use sed to get only semver part
|
||||
bin_version=$(${BIN_DIR}/linux-amd64/ocdev version | sed 's/ .*//g')
|
||||
bin_version=$(${BIN_DIR}/linux-amd64/odo version | sed 's/ .*//g')
|
||||
if [ "$TRAVIS_TAG" == "${bin_version}" ]; then
|
||||
echo "OK: ocdev version output is matching current tag"
|
||||
echo "OK: odo version output is matching current tag"
|
||||
else
|
||||
echo "ERR: TRAVIS_TAG ($TRAVIS_TAG) is not matching 'ocdev version' (v${bin_version})"
|
||||
echo "ERR: TRAVIS_TAG ($TRAVIS_TAG) is not matching 'odo version' (v${bin_version})"
|
||||
exit 1
|
||||
fi
|
||||
# this is build from tag, that means it is proper relase, use version for PKG_VERSION
|
||||
@@ -33,13 +33,13 @@ fpm -h >/dev/null 2>&1 || {
|
||||
|
||||
TMP_DIR=$(mktemp -d)
|
||||
mkdir -p $TMP_DIR/usr/local/bin/
|
||||
cp $BIN_DIR/linux-amd64/ocdev $TMP_DIR/usr/local/bin/
|
||||
cp $BIN_DIR/linux-amd64/odo $TMP_DIR/usr/local/bin/
|
||||
|
||||
echo "creating DEB package"
|
||||
fpm \
|
||||
--input-type dir --output-type deb \
|
||||
--chdir $TMP_DIR \
|
||||
--name ocdev --version $PKG_VERSION \
|
||||
--name odo --version $PKG_VERSION \
|
||||
--architecture amd64 \
|
||||
--maintainer "Tomas Kral <tkral@redhat.com>" \
|
||||
--package $PKG_DIR
|
||||
@@ -48,7 +48,7 @@ echo "creating RPM package"
|
||||
fpm \
|
||||
--input-type dir --output-type rpm \
|
||||
--chdir $TMP_DIR \
|
||||
--name ocdev --version $PKG_VERSION \
|
||||
--name odo --version $PKG_VERSION \
|
||||
--architecture x86_64 --rpm-os linux \
|
||||
--maintainer "Tomas Kral <tkral@redhat.com>" \
|
||||
--package $PKG_DIR
|
||||
@@ -36,13 +36,13 @@ done
|
||||
cat > "./.bintray.json" <<EOF
|
||||
{
|
||||
"package": {
|
||||
"name": "ocdev",
|
||||
"repo": "ocdev",
|
||||
"subject": "ocdev",
|
||||
"name": "odo",
|
||||
"repo": "odo",
|
||||
"subject": "odo",
|
||||
"desc": "OpenShift Command line for Developers",
|
||||
"website_url": "https://github.com/redhat-developer/ocdev",
|
||||
"issue_tracker_url": "https://github.com/redhat-developer/ocdev/issues",
|
||||
"vcs_url": "https://github.com/redhat-developer/ocdev.git",
|
||||
"website_url": "https://github.com/redhat-developer/odo",
|
||||
"issue_tracker_url": "https://github.com/redhat-developer/odo/issues",
|
||||
"vcs_url": "https://github.com/redhat-developer/odo.git",
|
||||
"licenses": ["Apache-2.0"],
|
||||
"public_download_numbers": false,
|
||||
"public_stats": false
|
||||
@@ -50,7 +50,7 @@ cat > "./.bintray.json" <<EOF
|
||||
|
||||
"version": {
|
||||
"name": "latest",
|
||||
"desc": "ocdev build from master branch",
|
||||
"desc": "odo build from master branch",
|
||||
"released": "${DATE}",
|
||||
"vcs_tag": "${TRAVIS_COMMIT}",
|
||||
"attributes": [{"name": "TRAVIS_JOB_NUMBER", "values" : ["${TRAVIS_JOB_NUMBER}"], "type": "string"},
|
||||
|
||||
@@ -3,7 +3,7 @@ package main
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/redhat-developer/ocdev/cmd"
|
||||
"github.com/redhat-developer/odo/cmd"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# The version of ocdev to install. Possible values - "master" and "latest"
|
||||
# The version of odo to install. Possible values - "master" and "latest"
|
||||
# master - builds from git master branch
|
||||
# latest - released versions specified by LATEST_VERSION variable
|
||||
OCDEV_VERSION="latest"
|
||||
|
||||
# Latest released ocdev version
|
||||
# Latest released odo version
|
||||
LATEST_VERSION="v0.0.3"
|
||||
|
||||
GITHUB_RELEASES_URL="https://github.com/redhat-developer/ocdev/releases/download/${LATEST_VERSION}"
|
||||
BINTRAY_URL="https://dl.bintray.com/ocdev/ocdev/latest"
|
||||
GITHUB_RELEASES_URL="https://github.com/redhat-developer/odo/releases/download/${LATEST_VERSION}"
|
||||
BINTRAY_URL="https://dl.bintray.com/odo/odo/latest"
|
||||
|
||||
INSTALLATION_PATH="/usr/local/bin/"
|
||||
PRIVILEGED_EXECUTION="sh -c"
|
||||
|
||||
DEBIAN_GPG_PUBLIC_KEY="https://bintray.com/user/downloadSubjectPublicKey?username=bintray"
|
||||
DEBIAN_MASTER_REPOSITORY="https://dl.bintray.com/ocdev/ocdev-deb-dev"
|
||||
DEBIAN_LATEST_REPOSITORY="https://dl.bintray.com/ocdev/ocdev-deb-releases"
|
||||
DEBIAN_MASTER_REPOSITORY="https://dl.bintray.com/odo/odo-deb-dev"
|
||||
DEBIAN_LATEST_REPOSITORY="https://dl.bintray.com/odo/odo-deb-releases"
|
||||
|
||||
RPM_MASTER_YUM_REPO="https://bintray.com/ocdev/ocdev-rpm-dev/rpm"
|
||||
RPM_LATEST_YUM_REPO="https://bintray.com/ocdev/ocdev-rpm-releases/rpm"
|
||||
RPM_MASTER_YUM_REPO="https://bintray.com/odo/odo-rpm-dev/rpm"
|
||||
RPM_LATEST_YUM_REPO="https://bintray.com/odo/odo-rpm-releases/rpm"
|
||||
|
||||
SUPPORTED_PLATFORMS="
|
||||
darwin-amd64
|
||||
@@ -51,7 +51,7 @@ check_platform() {
|
||||
# currently not supported by this installer script.
|
||||
|
||||
# Please visit the following URL for detailed installation steps:
|
||||
# https://github.com/redhat-developer/ocdev/#installation
|
||||
# https://github.com/redhat-developer/odo/#installation
|
||||
|
||||
"
|
||||
exit 1
|
||||
@@ -85,21 +85,21 @@ This installer needs to run as root. The current user is not root, and we could
|
||||
fi
|
||||
}
|
||||
|
||||
invalid_ocdev_version_error() {
|
||||
echo_stderr "# Invalid value of ocdev version provided, provide master or latest."
|
||||
invalid_odo_version_error() {
|
||||
echo_stderr "# Invalid value of odo version provided, provide master or latest."
|
||||
exit 1
|
||||
}
|
||||
|
||||
install_ocdev() {
|
||||
echo "# Starting ocdev installation..."
|
||||
install_odo() {
|
||||
echo "# Starting odo installation..."
|
||||
echo "# Detecting distribution..."
|
||||
|
||||
platform="$(check_platform)"
|
||||
echo "# Detected platform: $platform"
|
||||
|
||||
if command_exists ocdev; then
|
||||
if command_exists odo; then
|
||||
echo_stderr "#
|
||||
ocdev version \"$(ocdev version)\" is already installed on your system, running this installer script might case issues with your current installation. If you want to install ocdev using this script, please remove the current installation of ocdev from you system.
|
||||
odo version \"$(odo version)\" is already installed on your system, running this installer script might case issues with your current installation. If you want to install odo using this script, please remove the current installation of odo from you system.
|
||||
Aborting now!
|
||||
"
|
||||
exit 1
|
||||
@@ -111,16 +111,16 @@ Aborting now!
|
||||
echo_stderr "# brew command does not exist. Please install and run the installer again."
|
||||
fi
|
||||
|
||||
echo "# Enabling kadel/ocdev... "
|
||||
brew tap kadel/ocdev
|
||||
echo "# Enabling kadel/odo... "
|
||||
brew tap kadel/odo
|
||||
|
||||
echo "Installing ocdev..."
|
||||
echo "Installing odo..."
|
||||
case "$OCDEV_VERSION" in
|
||||
master)
|
||||
brew install kadel/ocdev/ocdev -- HEAD
|
||||
brew install kadel/odo/odo -- HEAD
|
||||
;;
|
||||
latest)
|
||||
brew install kadel/ocdev/ocdev
|
||||
brew install kadel/odo/odo
|
||||
esac
|
||||
|
||||
return 0
|
||||
@@ -130,7 +130,7 @@ Aborting now!
|
||||
|
||||
distribution=$(get_distribution)
|
||||
echo "# Detected distribution: $distribution"
|
||||
echo "# Installing ocdev version: $OCDEV_VERSION"
|
||||
echo "# Installing odo version: $OCDEV_VERSION"
|
||||
|
||||
case "$distribution" in
|
||||
|
||||
@@ -151,11 +151,11 @@ Aborting now!
|
||||
$PRIVILEGED_EXECUTION "echo \"deb $DEBIAN_LATEST_REPOSITORY stretch main\" | tee -a /etc/apt/sources.list"
|
||||
;;
|
||||
*)
|
||||
invalid_ocdev_version_error
|
||||
invalid_odo_version_error
|
||||
esac
|
||||
|
||||
$PRIVILEGED_EXECUTION "apt-get update"
|
||||
$PRIVILEGED_EXECUTION "apt-get install -y ocdev"
|
||||
$PRIVILEGED_EXECUTION "apt-get install -y odo"
|
||||
;;
|
||||
|
||||
centos|fedora)
|
||||
@@ -169,20 +169,20 @@ Aborting now!
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "# Adding ocdev repo under /etc/yum.repos.d/"
|
||||
echo "# Adding odo repo under /etc/yum.repos.d/"
|
||||
case "$OCDEV_VERSION" in
|
||||
|
||||
master)
|
||||
$PRIVILEGED_EXECUTION "curl -L $RPM_MASTER_YUM_REPO -o /etc/yum.repos.d/bintray-ocdev-ocdev-rpm-dev.repo"
|
||||
$PRIVILEGED_EXECUTION "curl -L $RPM_MASTER_YUM_REPO -o /etc/yum.repos.d/bintray-odo-odo-rpm-dev.repo"
|
||||
;;
|
||||
latest)
|
||||
$PRIVILEGED_EXECUTION "curl -L $RPM_LATEST_YUM_REPO -o /etc/yum.repos.d/bintray-ocdev-ocdev-rpm-releases.repo"
|
||||
$PRIVILEGED_EXECUTION "curl -L $RPM_LATEST_YUM_REPO -o /etc/yum.repos.d/bintray-odo-odo-rpm-releases.repo"
|
||||
;;
|
||||
*)
|
||||
invalid_ocdev_version_error
|
||||
invalid_odo_version_error
|
||||
esac
|
||||
|
||||
$PRIVILEGED_EXECUTION "$package_manager install -y ocdev"
|
||||
$PRIVILEGED_EXECUTION "$package_manager install -y odo"
|
||||
;;
|
||||
|
||||
*)
|
||||
@@ -192,43 +192,43 @@ Aborting now!
|
||||
TMP_DIR=$(mktemp -d)
|
||||
case "$OCDEV_VERSION" in
|
||||
master)
|
||||
BINARY_URL="$BINTRAY_URL/$platform/ocdev"
|
||||
echo "# Downloading ocdev from $BINARY_URL"
|
||||
curl -Lo $TMP_DIR/ocdev "$BINARY_URL"
|
||||
BINARY_URL="$BINTRAY_URL/$platform/odo"
|
||||
echo "# Downloading odo from $BINARY_URL"
|
||||
curl -Lo $TMP_DIR/odo "$BINARY_URL"
|
||||
;;
|
||||
latest)
|
||||
BINARY_URL="$GITHUB_RELEASES_URL/ocdev-$platform.gz"
|
||||
echo "# Downloading ocdev from $BINARY_URL"
|
||||
curl -Lo $TMP_DIR/ocdev.gz "$BINARY_URL"
|
||||
echo "# Extracting ocdev.gz"
|
||||
gunzip -d $TMP_DIR/ocdev.gz
|
||||
BINARY_URL="$GITHUB_RELEASES_URL/odo-$platform.gz"
|
||||
echo "# Downloading odo from $BINARY_URL"
|
||||
curl -Lo $TMP_DIR/odo.gz "$BINARY_URL"
|
||||
echo "# Extracting odo.gz"
|
||||
gunzip -d $TMP_DIR/odo.gz
|
||||
;;
|
||||
*)
|
||||
invalid_ocdev_version_error
|
||||
invalid_odo_version_error
|
||||
esac
|
||||
|
||||
echo "# Setting execute permissions on ocdev"
|
||||
chmod +x $TMP_DIR/ocdev
|
||||
echo "# Moving ocdev binary to $INSTALLATION_PATH"
|
||||
$PRIVILEGED_EXECUTION "mv $TMP_DIR/ocdev $INSTALLATION_PATH"
|
||||
echo "# ocdev has been successfully installed on your machine"
|
||||
echo "# Setting execute permissions on odo"
|
||||
chmod +x $TMP_DIR/odo
|
||||
echo "# Moving odo binary to $INSTALLATION_PATH"
|
||||
$PRIVILEGED_EXECUTION "mv $TMP_DIR/odo $INSTALLATION_PATH"
|
||||
echo "# odo has been successfully installed on your machine"
|
||||
rm -r $TMP_DIR
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
verify_ocdev() {
|
||||
if command_exists ocdev; then
|
||||
verify_odo() {
|
||||
if command_exists odo; then
|
||||
echo "
|
||||
# Verification complete!
|
||||
# ocdev version \"$(ocdev version)\" has been installed at $(type -P ocdev)
|
||||
# odo version \"$(odo version)\" has been installed at $(type -P odo)
|
||||
"
|
||||
else
|
||||
echo_stderr "
|
||||
# Something is wrong with ocdev installation, please run the installaer script again. If the issue persists, please create an issue at https://github.com/redhat-developer/ocdev/issues"
|
||||
# Something is wrong with odo installation, please run the installaer script again. If the issue persists, please create an issue at https://github.com/redhat-developer/odo/issues"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
install_ocdev
|
||||
verify_ocdev
|
||||
install_odo
|
||||
verify_odo
|
||||
@@ -9,13 +9,13 @@ mkdir -p $RELEASE_DIR
|
||||
|
||||
# if this is run on travis make sure that binary was build with corrent version
|
||||
if [[ -n $TRAVIS_TAG ]]; then
|
||||
echo "Checking if ocdev version was set to the same version as current tag"
|
||||
echo "Checking if odo version was set to the same version as current tag"
|
||||
# use sed to get only semver part
|
||||
bin_version=$(${BIN_DIR}/linux-amd64/ocdev version | sed 's/ .*//g')
|
||||
bin_version=$(${BIN_DIR}/linux-amd64/odo version | sed 's/ .*//g')
|
||||
if [ "$TRAVIS_TAG" == "${bin_version}" ]; then
|
||||
echo "OK: ocdev version output is matching current tag"
|
||||
echo "OK: odo version output is matching current tag"
|
||||
else
|
||||
echo "ERR: TRAVIS_TAG ($TRAVIS_TAG) is not matching 'ocdev version' (v${bin_version})"
|
||||
echo "ERR: TRAVIS_TAG ($TRAVIS_TAG) is not matching 'odo version' (v${bin_version})"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
@@ -26,8 +26,8 @@ for arch in `ls -1 $BIN_DIR/`;do
|
||||
if [[ $arch == windows-* ]]; then
|
||||
suffix=".exe"
|
||||
fi
|
||||
source_file=$BIN_DIR/$arch/ocdev$suffix
|
||||
target_file=$RELEASE_DIR/ocdev-$arch$suffix.gz
|
||||
source_file=$BIN_DIR/$arch/odo$suffix
|
||||
target_file=$RELEASE_DIR/odo-$arch$suffix.gz
|
||||
|
||||
echo "gzipping binary $source_file as $target_file"
|
||||
gzip --keep --to-stdout $source_file > $target_file
|
||||
|
||||
@@ -13,7 +13,7 @@ for image in $DOCKER_IMAGES; do
|
||||
echo "*** Testing install.sh in $image"
|
||||
echo "******************************************************"
|
||||
|
||||
docker run -it --rm -v `pwd`:/opt/ocdev $image /opt/ocdev/scripts/install.sh
|
||||
docker run -it --rm -v `pwd`:/opt/odo $image /opt/odo/scripts/install.sh
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "******************************************************"
|
||||
echo "**** PASSED for $image"
|
||||
|
||||
@@ -18,15 +18,15 @@ for pkg in `ls -1 $PKG_DIR/*.deb`; do
|
||||
# get version from filename
|
||||
version=$(expr "$filename" : '.*_\([^_]*\)_.*')
|
||||
|
||||
repo="ocdev-deb-dev"
|
||||
repo="odo-deb-dev"
|
||||
# if version is semver format upload to releases
|
||||
if [[ $version =~ [0-9]+\.[0-9]+\.[0-9]+ ]] ; then
|
||||
repo="ocdev-deb-releases"
|
||||
repo="odo-deb-releases"
|
||||
fi
|
||||
|
||||
echo "Uploading DEB package $pkg version $version to Bintray $repo"
|
||||
|
||||
curl -T $pkg -u $BINTRAY_USER:$BINTRAY_KEY "https://api.bintray.com/content/ocdev/${repo}/ocdev/${version}/${filename};deb_distribution=stretch;deb_component=main;deb_architecture=amd64;publish=1"
|
||||
curl -T $pkg -u $BINTRAY_USER:$BINTRAY_KEY "https://api.bintray.com/content/odo/${repo}/odo/${version}/${filename};deb_distribution=stretch;deb_component=main;deb_architecture=amd64;publish=1"
|
||||
echo ""
|
||||
echo ""
|
||||
done
|
||||
@@ -37,14 +37,14 @@ for pkg in `ls -1 $PKG_DIR/*.rpm`; do
|
||||
# get version from filename
|
||||
version=$(expr "$filename" : '.*-\(.*-[0-9]*\)\.x86_64.*')
|
||||
|
||||
repo="ocdev-rpm-dev"
|
||||
repo="odo-rpm-dev"
|
||||
# if version is semver format upload to releases
|
||||
if [[ $version =~ [0-9]+\.[0-9]+\.[0-9]+ ]] ; then
|
||||
repo="ocdev-rpm-releases"
|
||||
repo="odo-rpm-releases"
|
||||
fi
|
||||
|
||||
echo "Uploading RPM package $pkg version $version to Bintray $repo"
|
||||
curl -T $pkg -u $BINTRAY_USER:$BINTRAY_KEY "https://api.bintray.com/content/ocdev/${repo}/ocdev/${version}/${filename};publish=1"
|
||||
curl -T $pkg -u $BINTRAY_USER:$BINTRAY_KEY "https://api.bintray.com/content/odo/${repo}/odo/${version}/${filename};publish=1"
|
||||
echo ""
|
||||
echo ""
|
||||
done
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
# ocdev e2e tests
|
||||
# odo e2e tests
|
||||
|
||||
### Pre-requisites
|
||||
|
||||
1. To run e2e tests, you need to have an OpenShift cluster running. You could either use [minishift](https://github.com/minishift/minishift) or [oc cluster up](https://github.com/openshift/origin/blob/master/docs/cluster_up_down.md) for the same.
|
||||
|
||||
1. You need to have `ocdev` and `oc` binaries in $PATH
|
||||
1. You need to have `odo` and `oc` binaries in $PATH
|
||||
|
||||
### Running tests
|
||||
|
||||
@@ -12,7 +12,7 @@ Run `make test-e2e` to execute the tests.
|
||||
|
||||
### Test coverage
|
||||
|
||||
| `ocdev` command | Coverage (Y/N) |
|
||||
| `odo` command | Coverage (Y/N) |
|
||||
| ------------- | ------------- |
|
||||
| `project create` | Y |
|
||||
| `project get` | Y |
|
||||
|
||||
@@ -18,11 +18,11 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// TODO: A neater way to provide ocdev path. Currently we assume \
|
||||
// ocdev and oc in $PATH already.
|
||||
// TODO: A neater way to provide odo path. Currently we assume \
|
||||
// odo and oc in $PATH already.
|
||||
|
||||
var t = strconv.FormatInt(time.Now().Unix(), 10)
|
||||
var projName = fmt.Sprintf("ocdev-%s", t)
|
||||
var projName = fmt.Sprintf("odo-%s", t)
|
||||
|
||||
func runCmd(cmdS string) string {
|
||||
cmd := exec.Command("/bin/sh", "-c", cmdS)
|
||||
@@ -74,25 +74,25 @@ func pingSvc(url string) {
|
||||
|
||||
func TestOCdev(t *testing.T) {
|
||||
RegisterFailHandler(Fail)
|
||||
RunSpecs(t, "ocdev test suite")
|
||||
RunSpecs(t, "odo test suite")
|
||||
}
|
||||
|
||||
var _ = Describe("ocdev", func() {
|
||||
var _ = Describe("odo", func() {
|
||||
|
||||
tmpDir, err := ioutil.TempDir("", "ocdev")
|
||||
tmpDir, err := ioutil.TempDir("", "odo")
|
||||
if err != nil {
|
||||
Fail(err.Error())
|
||||
}
|
||||
|
||||
// TODO: Create component without creating application
|
||||
Context("ocdev project", func() {
|
||||
Context("odo project", func() {
|
||||
It("should create a new project", func() {
|
||||
session := runCmd("ocdev project create " + projName)
|
||||
session := runCmd("odo project create " + projName)
|
||||
Expect(session).To(ContainSubstring(projName))
|
||||
})
|
||||
|
||||
It("should get the project", func() {
|
||||
getProj := runCmd("ocdev project get --short")
|
||||
getProj := runCmd("odo project get --short")
|
||||
Expect(strings.TrimSpace(getProj)).To(Equal(projName))
|
||||
})
|
||||
})
|
||||
@@ -100,32 +100,32 @@ var _ = Describe("ocdev", func() {
|
||||
Describe("creating an application", func() {
|
||||
Context("when application by the same name doesn't exist", func() {
|
||||
It("should create an application", func() {
|
||||
appName := runCmd("ocdev application create usecase5")
|
||||
appName := runCmd("odo application create usecase5")
|
||||
Expect(appName).To(ContainSubstring("usecase5"))
|
||||
})
|
||||
|
||||
It("should get the current application", func() {
|
||||
appName := runCmd("ocdev application get --short")
|
||||
appName := runCmd("odo application get --short")
|
||||
Expect(appName).To(Equal("usecase5"))
|
||||
})
|
||||
|
||||
It("should be created within the project", func() {
|
||||
projName := runCmd("ocdev project get --short")
|
||||
projName := runCmd("odo project get --short")
|
||||
Expect(projName).To(ContainSubstring(projName))
|
||||
})
|
||||
|
||||
It("should be able to create another application", func() {
|
||||
appName := runCmd("ocdev application create usecase5-2")
|
||||
appName := runCmd("odo application create usecase5-2")
|
||||
Expect(appName).To(ContainSubstring("usecase5-2"))
|
||||
})
|
||||
|
||||
It("should be able to delete an application", func() {
|
||||
// Cleanup
|
||||
runCmd("ocdev application delete usecase5-2 -f")
|
||||
runCmd("odo application delete usecase5-2 -f")
|
||||
})
|
||||
|
||||
It("should be able to set an application as current", func() {
|
||||
appName := runCmd("ocdev application set usecase5")
|
||||
appName := runCmd("odo application set usecase5")
|
||||
Expect(appName).To(ContainSubstring("usecase5"))
|
||||
})
|
||||
})
|
||||
@@ -140,40 +140,40 @@ var _ = Describe("ocdev", func() {
|
||||
tmpDir + "/nodejs-ex")
|
||||
|
||||
// TODO: add tests for --git
|
||||
runCmd("ocdev create nodejs --local " + tmpDir + "/nodejs-ex")
|
||||
runCmd("odo create nodejs --local " + tmpDir + "/nodejs-ex")
|
||||
})
|
||||
|
||||
It("should be the get the component created as active component", func() {
|
||||
cmp := runCmd("ocdev component get --short")
|
||||
cmp := runCmd("odo component get --short")
|
||||
Expect(cmp).To(Equal("nodejs"))
|
||||
})
|
||||
|
||||
It("should create the component within the application", func() {
|
||||
getApp := runCmd("ocdev application get --short")
|
||||
getApp := runCmd("odo application get --short")
|
||||
Expect(getApp).To(Equal("usecase5"))
|
||||
})
|
||||
|
||||
It("should list the components within the application", func() {
|
||||
cmpList := runCmd("ocdev list")
|
||||
cmpList := runCmd("odo list")
|
||||
Expect(cmpList).To(ContainSubstring("nodejs"))
|
||||
})
|
||||
|
||||
It("should be able to create multiple components within the same application", func() {
|
||||
runCmd("ocdev create php")
|
||||
runCmd("odo create php")
|
||||
})
|
||||
|
||||
It("should list the newly created second component", func() {
|
||||
cmpList := runCmd("ocdev list")
|
||||
cmpList := runCmd("odo list")
|
||||
Expect(cmpList).To(ContainSubstring("php"))
|
||||
})
|
||||
|
||||
It("should get the application usecase5", func() {
|
||||
appGet := runCmd("ocdev application get --short")
|
||||
appGet := runCmd("odo application get --short")
|
||||
Expect(appGet).To(Equal("usecase5"))
|
||||
})
|
||||
|
||||
It("should be able to set a component as active", func() {
|
||||
cmpSet := runCmd("ocdev component set nodejs")
|
||||
cmpSet := runCmd("odo component set nodejs")
|
||||
Expect(cmpSet).To(ContainSubstring("nodejs"))
|
||||
})
|
||||
})
|
||||
@@ -198,25 +198,25 @@ var _ = Describe("ocdev", func() {
|
||||
runCmd("sed -i 's/Welcome to your Node.js application on OpenShift/Welcome to your Node.js on OCDEV/g' " + tmpDir + "/nodejs-ex/views/index.html")
|
||||
|
||||
// Push the changes
|
||||
runCmd("ocdev push --local " + tmpDir + "/nodejs-ex")
|
||||
runCmd("odo push --local " + tmpDir + "/nodejs-ex")
|
||||
})
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
Describe("Creating url", func() {
|
||||
Context("using ocdev url", func() {
|
||||
Context("using odo url", func() {
|
||||
It("should create route", func() {
|
||||
runCmd("ocdev url create nodejs")
|
||||
runCmd("odo url create nodejs")
|
||||
})
|
||||
|
||||
It("should be able to list the url", func() {
|
||||
getRoute := runCmd("ocdev url list | sed -n '1!p' | awk '{ print $3 }'")
|
||||
getRoute := runCmd("odo url list | sed -n '1!p' | awk '{ print $3 }'")
|
||||
getRoute = strings.TrimSpace(getRoute)
|
||||
Expect(getRoute).To(ContainSubstring("nodejs-" + projName))
|
||||
|
||||
for {
|
||||
pingCmd := "curl -s " + getRoute + " | grep -i ocdev | wc -l | tr -d '\n'"
|
||||
pingCmd := "curl -s " + getRoute + " | grep -i odo | wc -l | tr -d '\n'"
|
||||
out, err := exec.Command("/bin/sh", "-c", pingCmd).Output()
|
||||
if err != nil {
|
||||
Fail(err.Error())
|
||||
@@ -224,7 +224,7 @@ var _ = Describe("ocdev", func() {
|
||||
|
||||
outInt, _ := strconv.Atoi(string(out))
|
||||
if outInt > 0 {
|
||||
grepAfterPush := runCmd("curl -s " + getRoute + " | grep -i ocdev")
|
||||
grepAfterPush := runCmd("curl -s " + getRoute + " | grep -i odo")
|
||||
log.Printf("After change: %s", strings.TrimSpace(grepAfterPush))
|
||||
break
|
||||
}
|
||||
@@ -237,7 +237,7 @@ var _ = Describe("ocdev", func() {
|
||||
Describe("Adding storage", func() {
|
||||
Context("when storage is added", func() {
|
||||
It("should default to active component when no component name is passed", func() {
|
||||
storAdd := runCmd("ocdev storage create pv1 --path /mnt/pv1 --size 5Gi")
|
||||
storAdd := runCmd("odo storage add pv1 --path /mnt/pv1 --size 5Gi")
|
||||
Expect(storAdd).To(ContainSubstring("nodejs"))
|
||||
|
||||
// Check against path and name against dc
|
||||
@@ -256,22 +256,22 @@ var _ = Describe("ocdev", func() {
|
||||
})
|
||||
|
||||
It("should be able to list the storage added", func() {
|
||||
storList := runCmd("ocdev storage list")
|
||||
storList := runCmd("odo storage list")
|
||||
Expect(storList).To(ContainSubstring("pv1"))
|
||||
})
|
||||
|
||||
// TODO: Verify if the storage removed using ocdev deletes pvc
|
||||
// TODO: Verify if the storage removed using odo deletes pvc
|
||||
It("should be able to delete the storage added", func() {
|
||||
runCmd("ocdev storage remove pv1")
|
||||
runCmd("odo storage remove pv1")
|
||||
|
||||
storList := runCmd("ocdev storage list")
|
||||
storList := runCmd("odo storage list")
|
||||
Expect(storList).NotTo(ContainSubstring("pv1"))
|
||||
})
|
||||
|
||||
It("should be able add storage to a component specified", func() {
|
||||
runCmd("ocdev storage create pv2 --path /mnt/pv2 --size 5Gi --component php")
|
||||
runCmd("odo storage add pv2 --path /mnt/pv2 --size 5Gi --component php")
|
||||
|
||||
storList := runCmd("ocdev storage list --component php")
|
||||
storList := runCmd("odo storage list --component php")
|
||||
Expect(storList).To(ContainSubstring("pv2"))
|
||||
|
||||
// Verify with deploymentconfig
|
||||
@@ -293,18 +293,18 @@ var _ = Describe("ocdev", func() {
|
||||
|
||||
Context("deleting the application", func() {
|
||||
It("should delete application and component", func() {
|
||||
runCmd("ocdev application delete usecase5 -f")
|
||||
runCmd("odo application delete usecase5 -f")
|
||||
|
||||
appGet := runCmd("ocdev application get --short")
|
||||
appGet := runCmd("odo application get --short")
|
||||
Expect(appGet).To(Equal(""))
|
||||
|
||||
appList := runCmd("ocdev application list")
|
||||
appList := runCmd("odo application list")
|
||||
Expect(appList).NotTo(ContainSubstring("usecase5"))
|
||||
|
||||
cmpList := runCmd("ocdev list")
|
||||
cmpList := runCmd("odo list")
|
||||
Expect(cmpList).NotTo(ContainSubstring("nodejs"))
|
||||
|
||||
// TODO: `ocdev project delete` once implemented
|
||||
// TODO: `odo project delete` once implemented
|
||||
runCmd("oc delete project " + projName)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user