Skip to content

Commit

Permalink
Opensearch cli rename (opendistro-for-elasticsearch#2)
Browse files Browse the repository at this point in the history
* Refactor: Rename module and variables

rename from odfe-cli to opensearch-cli, Elasticsearch to OpenSearch.
update environment variables
remove odfe-cli rfc
update README
update dependency
update usage
  • Loading branch information
VijayanB authored Apr 12, 2021
1 parent 46ef2ea commit 0eb6ddf
Show file tree
Hide file tree
Showing 89 changed files with 708 additions and 1,221 deletions.
104 changes: 0 additions & 104 deletions .github/workflows/odfe-cli-publish-upload-artifacts.yml

This file was deleted.

104 changes: 104 additions & 0 deletions .github/workflows/publish-upload-artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: Publish and Upload opensearch-cli
on:
push:
tags:
- v*

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Get Version
run: |
TAG_NAME=${GITHUB_REF#refs/*/}
echo "RELEASE_VERSION=${TAG_NAME:1}" >> $GITHUB_ENV
- name: Set up Go ubuntu-latest
uses: actions/setup-go@v2
with:
go-version: 1.16.2

- name: Check out source code
uses: actions/checkout@v2

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: --snapshot --skip-publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload macOS(amd64) Artifact
uses: actions/upload-artifact@v2
with:
name: opensearch-cli-${{ env.RELEASE_VERSION }}-macos-x64
path: dist/opensearch-cli_darwin_amd64/opensearch-cli

- name: Upload Linux(amd64) Artifact
uses: actions/upload-artifact@v2
with:
name: opensearch-cli-${{ env.RELEASE_VERSION }}-linux-x64
path: dist/opensearch-cli_linux_amd64/opensearch-cli

- name: Upload Linux(arm64) Artifact
uses: actions/upload-artifact@v2
with:
name: opensearch-cli-${{ env.RELEASE_VERSION }}-linux-arm64
path: dist/opensearch-cli_linux_arm64/opensearch-cli

- name: Upload Windows(i386) Artifact
uses: actions/upload-artifact@v2
with:
name: opensearch-cli-${{ env.RELEASE_VERSION }}-windows-x86
path: dist/opensearch-cli_windows_386/opensearch-cli.exe

- name: Upload Windows(amd64) Artifact
uses: actions/upload-artifact@v2
with:
name: opensearch-cli-${{ env.RELEASE_VERSION }}-windows-x64
path: dist/opensearch-cli_windows_amd64/opensearch-cli.exe


- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Zip and copy macOS(amd64) artifacts to S3 bucket with the AWS CLI
run: |
cd dist/opensearch-cli_darwin_amd64/
zip opensearch-cli-${{ env.RELEASE_VERSION }}-macos-x64.zip opensearch-cli
aws s3 cp opensearch-cli-${{ env.RELEASE_VERSION }}-macos-x64.zip ${{ secrets.S3_MACOS_URI }}
- name: Zip and copy macOS(arm64) artifacts to S3 bucket with the AWS CLI
run: |
cd dist/opensearch-cli_darwin_arm64/
zip opensearch-cli-${{ env.RELEASE_VERSION }}-macos-arm64.zip opensearch-cli
aws s3 cp opensearch-cli-${{ env.RELEASE_VERSION }}-macos-arm64.zip ${{ secrets.S3_MACOS_URI }}
- name: Zip and copy linux(amd64) artifacts to S3 bucket with the AWS CLI
run: |
cd dist/opensearch-cli_linux_amd64
zip opensearch-cli-${{ env.RELEASE_VERSION }}-linux-x64.zip opensearch-cli
aws s3 cp opensearch-cli-${{ env.RELEASE_VERSION }}-linux-x64.zip ${{ secrets.S3_LINUX_URI }}
- name: Zip and copy linux(arm64) artifacts to S3 bucket with the AWS CLI
run: |
cd dist/opensearch-cli_linux_arm64/
zip opensearch-cli-${{ env.RELEASE_VERSION }}-linux-arm64.zip opensearch-cli
aws s3 cp opensearch-cli-${{ env.RELEASE_VERSION }}-linux-arm64.zip ${{ secrets.S3_LINUX_URI }}
- name: Zip and copy windows(x386) artifacts to S3 bucket with the AWS CLI
run: |
cd dist/opensearch-cli_windows_386
zip opensearch-cli-${{ env.RELEASE_VERSION }}-windows-x86.zip opensearch-cli.exe
aws s3 cp opensearch-cli-${{ env.RELEASE_VERSION }}-windows-x86.zip ${{ secrets.S3_WINDOWS_URI }}
- name: Zip and copy windows(amd64) artifacts to S3 bucket with the AWS CLI
run: |
cd dist/opensearch-cli_windows_amd64/
zip opensearch-cli-${{ env.RELEASE_VERSION }}-windows-x64.zip opensearch-cli.exe
aws s3 cp opensearch-cli-${{ env.RELEASE_VERSION }}-windows-x64.zip ${{ secrets.S3_WINDOWS_URI }}
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: Build and Test odfe-cli
name: Build and Test opensearch-cli
on:
push:
branches:
- main
- opendistro-*
- opensearch-*
pull_request:
branches:
- main
- opendistro-*
- opensearch-*

jobs:
test:
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:
with:
token: ${{secrets.CODECOV_TOKEN}}
file: coverage.out
flags: odfe-cli
flags: opensearch-cli
name: codecov-umbrella

- name: Stop and Clean Docker Components
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ bin

/coverage.out

odfe-cli
odfe-cli.exe
opensearch-cli
opensearch-cli.exe
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This is an example goreleaser.yaml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
project_name: odfe-cli
project_name: opensearch-cli
dist: ./dist
before:
hooks:
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ INTEGRATION_TEST_PATH=./it/...

# set of env variables that you need for testing
ENV_LOCAL_TEST=\
ODFE_ENDPOINT="https://localhost:9200" \
ODFE_USER="admin" \
ODFE_PASSWORD="admin"
OPENSEARCH_ENDPOINT="https://localhost:9200" \
OPENSEARCH_USER="admin" \
OPENSEARCH_PASSWORD="admin"

# this command will start a docker components that we set in docker-compose.yml
docker.start.components:
Expand Down Expand Up @@ -33,7 +33,7 @@ test.unit:
format:
goimports -w .;

# generate odfe-cli file in current directory
# update GOOS / GOARCH if you want to build for other os and architecture
# generate opensearch-cli file in current directory
# update GOOS / GOARCH if you want to build for other core and architecture
build:
go build .
Loading

0 comments on commit 0eb6ddf

Please sign in to comment.