Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Add unified description format to all the scripts (#334)
Browse files Browse the repository at this point in the history
* Add unified description format to all the scripts

* Update check_plugin.sh

* Update plugin_tag.sh

* Update setup_runners.sh

* Update userdata.sh

* Update check_plugin.sh

* Update plugin_tag.sh

* Update setup_runners.sh

* Update setup_runners_service.sh

* Update setup_runners_service_windows.ps1

* Update userdata.sh

* Update plugins-info

* Update version-info

* Update plugin_tag.sh

* Update setup_runners.sh
  • Loading branch information
peterzhuamazon committed Aug 11, 2020
1 parent f6d4780 commit 9f21d2c
Show file tree
Hide file tree
Showing 8 changed files with 168 additions and 4 deletions.
21 changes: 21 additions & 0 deletions .github/scripts/check_plugin.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
#!/bin/bash

###### Information ############################################################################
# Name: check_plugin.sh
# Maintainer: ODFE Infra Team
# Language: Shell
#
# About: This script is to check plugin artifacts availability for odfe distros
# It will prepare emails to odfe-release-process@amazon.com and a chime msg
# to inform user the status of the list of plugins
#
# RED: plugin artifact is NOT in S3 and corresponding repo has NO tag cut
# YELLOW: plugin artifact is NOT in S3 but corresponding repo has A tag cut
# GREEN: plugin artifact is in S3
#
# Usage: ./check_plugin.sh $PLUGIN_TYPES [$ODFE_VERSION]
# $PLUGIN_TYPES: zip,deb,rpm,kibana,clidvr,perftop (optional)
# $ODFE_VERSION: x.y.z (optional)
#
# Starting Date: 2020-05-29
# Modified Date: 2020-07-30
###############################################################################################

# Please leave it commented as aws s3 will fail if no plugin presents
#set -e

Expand Down
16 changes: 16 additions & 0 deletions .github/scripts/plugin_tag.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
#!/bin/bash

###### Information ############################################################################
# Name: plugin-tag.sh
# Maintainer: ODFE Infra Team
# Language: Shell
#
# About: Retrieve the latest tag of a specific repo on Git based on user parameters
#
# Usage: ./plugin-tag.sh $GIT_REPONAME [$OD_VERSION]
# $GIT_REPONAME: <repo_owner>/<repo_name> (required)
# $OD_VERSION: ODFE Version (optional)
#
# Starting Date: 2020-06-17
# Modified Date: 2020-07-30
###############################################################################################

set -e

# This script allows users to manually assign parameters
Expand Down
51 changes: 51 additions & 0 deletions .github/scripts/setup_runners.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,55 @@
#!/bin/bash

###### Information ############################################################################
# Name: setup_runners.sh
# Maintainer: ODFE Infra Team
# Language: Shell
#
# About: 1. Run instances on EC2 based on parameters defined and wait for completion
# 2. SSH to these instances and configure / bootstrap on $GIT_URL_REPO as runners
# 3. Unbootstrap the runners and terminate the instances for cleanups
#
# Usage: ./setup_runners.sh $ACTION $EC2_INSTANCE_NAMES $GITHUB_TOKEN
# $ACTION: run | terminate (required)
# $EC2_INSTANCE_NAMES: <names of instances> (required, sep ",")
# $GITHUB_TOKEN: GitHub PAT with repo scope and Admin Access to $GIT_URL_REPO
#
# Requirements: The env that runs this script must have its AWS IAM with these configurations
#
# * SSM Role
# AmazonEC2RoleforSSM
# AmazonSSMManagedInstanceCore
#
# * EC2 User with FullAccess Policy requires these policies to attach to SSM Role
# {
# "Version": "2012-10-17",
# "Statement": [
# {
# "Sid": "VisualEditor0",
# "Effect": "Allow",
# "Action": [
# "ssm:SendCommand",
# "iam:PassRole"
# ],
# "Resource": [
# "arn:aws:ssm:*:*:document/*",
# "arn:aws:ec2:*:*:instance/*",
# "arn:aws:iam::<User ID>:role/<SSM Role Name>"
# ]
# },
# {
# "Sid": "VisualEditor1",
# "Effect": "Allow",
# "Action": "ssm:DescribeInstanceInformation",
# "Resource": "*"
# }
# ]
# }
#
# Starting Date: 2020-07-27
# Modified Date: 2020-07-30
###############################################################################################

set -e

#####################################
Expand Down
15 changes: 15 additions & 0 deletions .github/scripts/setup_runners_service.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
#!/bin/bash

###### Information ############################################################################
# Name: setup_runners_service.sh
# Maintainer: ODFE Infra Team
# Language: Shell
#
# About: Setup ES/KIBANA for integTests on *NIX based ODFE distros w/wo Security
#
# Usage: ./setup_runners_service.sh $SETUP_DISTRO $SETUP_ACTION
# $SETUP_DISTRO: tar | deb | rpm (required)
# $SETUP_ACTION: --es | --es-nosec | --kibana | --kibana-nosec (required)
#
# Starting Date: 2020-07-27
# Modified Date: 2020-07-30
###############################################################################################

# This script allows users to manually assign parameters
if [ "$#" -ne 2 ] || [ "$1" = "--help" ] || [ "$1" = "-h" ]
then
Expand Down
15 changes: 15 additions & 0 deletions .github/scripts/setup_runners_service_windows.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
#!/usr/bin/env pwsh

###### Information ############################################################################
# Name: setup_runners_service_windows.ps1
# Maintainer: ODFE Infra Team
# Language: PowerShell
#
# About: Setup ES/KIBANA for integTests on Windows based ODFE distros w/wo Security
#
# Usage: ./setup_runners_service_windows.ps1 $SETUP_ACTION
# $SETUP_ACTION: --es | --es-nosec | --kibana | --kibana-nosec (required)
#
# Starting Date: 2020-07-27
# Modified Date: 2020-07-30
###############################################################################################

# Keep the pwsh script running even with errors
# Put this line before the .\gradlew.bat run
#$ErrorActionPreference = 'SilentlyContinue'

# setup user parameters
Expand Down
20 changes: 20 additions & 0 deletions .github/scripts/userdata.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
#!/bin/bash

###### Information ############################################################################
# Name: userdata.sh
# Maintainer: ODFE Infra Team
# Language: Shell
#
# About: This script is related to testing-domains set-up.
# See https://github.com/opendistro-for-elasticsearch/opendistro-build/pull/283
#
# In order to set-up domains, EC2 needs to have ES and Kibana running,
# hence this script will act as userdata input to install and configure
# the necessary services while installing the EC2 via AutoScaling Groups
#
# Usage: ./userdata.sh $distribution $security
# $distribution: TAR | DEB | RPM (required)
# $security: ENABLE | DISABLE (required)
#
# Starting Date: 2020-06-24
# Modified Date: 2020-07-30
###############################################################################################

set -e
REPO_ROOT=`git rev-parse --show-toplevel`
ES_VER=`$REPO_ROOT/bin/version-info --es`
Expand Down
17 changes: 17 additions & 0 deletions bin/plugins-info
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
#!/bin/bash

###### Information ############################################################################
# Name: plugins-info
# Maintainer: ODFE Infra Team
# Language: Shell
#
# About: Print the ES/KIBANA plugin names and git urls with correct dependency orders
# as defined in the 'plugins.json' file
#
# Usage: ./plugins-info $PLUGINS_TYPE [$RETURN_TYPE]
# $PLUGINS_TYPE: <check plugins.json> (required)
# $RETURN_TYPE: <default to name> | --git (optional)
#
# Starting Date: 2020-06-24
# Modified Date: 2020-07-30
###############################################################################################

set -e
ROOT=`dirname $(realpath $0)`;
PLUGINS_LIST="$ROOT/plugins.json"
Expand Down
17 changes: 13 additions & 4 deletions bin/version-info
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,20 @@
# permissions and limitations under the License.
#

# Description:
# Print the ES version for the current branch, as defined in
# the 'version.json' file.
###### Information ############################################################################
# Name: version-info
# Maintainer: ODFE Infra Team
# Language: Python
#
# The version can also be forced by setting the ELASTIC_VERSION environment variable.
# About: Print the ES/ODFE version for the current/previous branches
# as defined in the 'version.json' file
#
# Usage: [python] ./version-info $VERSION_TYPE
# $VERSION_TYPE: --od | --od-prev | --es | --es-prev (required)
#
# Starting Date: 2019-05-15
# Modified Date: 2020-07-30
###############################################################################################

import sys
import json
Expand Down

0 comments on commit 9f21d2c

Please sign in to comment.