Skip to content

Commit

Permalink
Merge pull request #631 from opensearch-project/main
Browse files Browse the repository at this point in the history
Moves v1.2.4 to Production
  • Loading branch information
stockholmux committed Jan 18, 2022
2 parents 4215da6 + 6786a6b commit 95c8829
Show file tree
Hide file tree
Showing 15 changed files with 272 additions and 4 deletions.
6 changes: 3 additions & 3 deletions _artifacts/_README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,18 @@ As a general rule, if it doesn't change from release to release and isn't hosted

## Automation

Included in this directory is the bash script `v_update.sh`. This script will make a new copy of all the artifact files for an existing version and change the yaml and file names to the new specified version. It is a blunt tool that will create a lot of new files, so use with caution. You will still need to update the corresponding version in `_version`.
Included in this directory is the bash script `_v_update.sh`. This script will make a new copy of all the artifact files for an existing version and change the yaml and file names to the new specified version. It is a blunt tool that will create a lot of new files, so use with caution. You will still need to update the corresponding version in `_version`.

Usage:

```shell
./v_update.sh <directory> <old version> <new version>
./_v_update.sh <directory> <old version> <new version>
```

Example:

```shell
./v_update.sh opensearch-1.2 1.2.1 1.2.2
./_v_update.sh opensearch-1.2 1.2.1 1.2.2
```

Reads all the artifact files in `opensearch-1.2` that match version 1.2.1 and converts them to 1.2.2
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
role: daemon
artifact_id: opensearch
version: 1.2.4
platform: freebsd
architecture: arm64
slug: opensearch-1.2.4-freebsd-arm64
category: opensearch
type: system-package
freebsd_package_name: opensearch
link: https://www.freshports.org/textproc/opensearch
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
role: daemon
artifact_id: opensearch
version: 1.2.4
platform: docker
architecture: arm64
slug: opensearch-1.2.4-docker-arm64
category: opensearch
type: docker_hub
link: https://hub.docker.com/r/opensearchproject/opensearch/tags?page=1&ordering=last_updated&name=1.2.4
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
role: daemon
artifact_id: opensearch
version: 1.2.4
platform: linux
architecture: arm64
artifact_url: https://artifacts.opensearch.org/releases/bundle/opensearch/1.2.4/opensearch-1.2.4-linux-arm64.tar.gz

slug: opensearch-1.2.4-linux-arm64
category: opensearch
type: targz
signature: https://artifacts.opensearch.org/releases/bundle/opensearch/1.2.4/opensearch-1.2.4-linux-arm64.tar.gz.sig
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
role: daemon
artifact_id: opensearch-min
version: 1.2.4
platform: linux
architecture: arm64
slug: opensearch-1.2.4-min-linux-arm64
category: opensearch
type: targz

artifact_url: https://artifacts.opensearch.org/releases/core/opensearch/1.2.4/opensearch-min-1.2.4-linux-arm64.tar.gz
signature: https://artifacts.opensearch.org/releases/core/opensearch/1.2.4/opensearch-min-1.2.4-linux-arm64.tar.gz.sig
security_warning: true
indirect: true
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
role: daemon
artifact_id: opensearch
version: 1.2.4
platform: freebsd
architecture: x64
slug: opensearch-1.2.4-freebsd-x64
category: opensearch
type: system-package
freebsd_package_name: opensearch
link: https://www.freshports.org/textproc/opensearch
---
11 changes: 11 additions & 0 deletions _artifacts/opensearch-1.2/x64/opensearch-1.2.4-docker-x64.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
role: daemon
artifact_id: opensearch
version: 1.2.4
platform: docker
architecture: x64
slug: opensearch-1.2.4-docker-x64
category: opensearch
type: docker_hub
link: https://hub.docker.com/r/opensearchproject/opensearch/tags?page=1&ordering=last_updated&name=1.2.4
---
12 changes: 12 additions & 0 deletions _artifacts/opensearch-1.2/x64/opensearch-1.2.4-linux-x64.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
role: daemon
artifact_id: opensearch
version: 1.2.4
platform: linux
architecture: x64
artifact_url: https://artifacts.opensearch.org/releases/bundle/opensearch/1.2.4/opensearch-1.2.4-linux-x64.tar.gz
slug: opensearch-1.2.4-linux-x64
category: opensearch
type: targz
signature: https://artifacts.opensearch.org/releases/bundle/opensearch/1.2.4/opensearch-1.2.4-linux-x64.tar.gz.sig
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
role: daemon
artifact_id: opensearch-min
version: 1.2.4
platform: linux
architecture: x64
artifact_url: https://artifacts.opensearch.org/releases/core/opensearch/1.2.4/opensearch-min-1.2.4-linux-x64.tar.gz
slug: opensearch-1.2.4-min-linux-x64
category: opensearch
type: targz
signature: https://artifacts.opensearch.org/releases/core/opensearch/1.2.4/opensearch-min-1.2.4-linux-x64.tar.gz.sig
security_warning: true
indirect: true
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
role: daemon
artifact_id: opensearch
version: 1.2.4
platform: freebsd
architecture: x86
slug: opensearch-1.2.4-freebsd-x86
category: opensearch
type: system-package
freebsd_package_name: opensearch
link: https://www.freshports.org/textproc/opensearch
---
2 changes: 1 addition & 1 deletion _data/alert.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
message: "[Important fix available: Update your clusters to 1.2.3](/downloads.html)"
# message: "[Important fix available: Update your clusters to 1.2.3](/downloads.html)"
72 changes: 72 additions & 0 deletions _versions/2022-01-18-opensearch-1.2.4.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
date: "2022-01-18"
product: opensearch
version: '1.2.4'
release_notes: https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.2.4.md
components:
- role: daemon
artifact: opensearch
version: 1.2.4
- role: ui
artifact: opensearch-dashboards
version: 1.2.0
- role: command-line-tools
artifact: opensearch-cli
version: 1.1.0
- role: ingest
artifact: logstash-oss-with-opensearch-output-plugin
version: 7.16.2
- role: ingest
artifact: data-prepper
version: data-prepper-1.2.1
platform_order:
- docker
- linux
- role: minimal-artifacts
artifact: opensearch-min
version: 1.2.4
- role: minimal-artifacts
artifact: opensearch-dashboards-min
version: 1.2.0
sections:
docker-compose:
explanation: "downloads/opensearch-docker.markdown"
opensearch:
role: daemon
artifacts:
opensearch:
explanation: "downloads/opensearch-daemon.markdown"
opensearch-dashboards:
role: ui
artifacts:
opensearch-dashboards:
explanation: "downloads/opensearch-ui.markdown"
data-ingest:
explanation: "downloads/opensearch-data-ingest.markdown"
role: ingest
artifacts:
data-prepper:
explanation: "downloads/data-prepper.html"
logstash-oss-with-opensearch-output-plugin:
explanation: "downloads/logstash-oss-with-opensearch-output-plugin.markdown"
command-line-tools:
role: command-line-tools
artifacts:
opensearch-cli:
explanation: "downloads/opensearch-cli.html"
minimal:
explanation: "downloads/minimal-distributions.markdown"
role: minimal-artifacts
artifacts:
opensearch-min:
explanation: "downloads/opensearch-daemon-min.markdown"
opensearch-dashboards-min:
explanation: "downloads/opensearch-ui-min.markdown"
pretty:
artifacts:
opensearch: ''
opensearch-min: 'OpenSearch Minimum'
opensearch-dashboards: ''
opensearch-dashboards-min: 'OpenSearch Dashboards Minimum'
---
OpenSearch is open source software that uses the Apache License version 2 (ALv2). ALv2 grants you well-understood usage rights; you can use, modify, extend, embed, monetize, resell, and offer OpenSearch as part of your products and services. The source for the entire project is available on [GitHub](https://github.com/opensearch-project/) and you're welcome to build from source for customized deployments. Downloadable artifacts for OpenSearch and OpenSearch Dashboards include plugins and tools, ready for you to use with minimal configuration.
28 changes: 28 additions & 0 deletions _versions/_README.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# How to version for OpenSearch

Each version is represented by an item in a Jekyll collection. Each version has it's own file and should follow the pattern of `YYYY-MM-DD-opensearch-major.minor.patch.markdown` (e.g. `2022-01-18-opensearch-1.2.4.markdown`)



## Automation

Included in this directory is the bash script `_v_update.sh`. This script will create a new version file based off of a previous one and command line arguments. It automatically updates the version and release notes URL. Optionally, it can update individual artifacts.

Usage:

```shell
./_v_update.sh <source> <new release version> <release date in YYYY-MM-DD> [<artifact> <new version>]...
```

Example:

```shell
./_v_update.sh ./2021-12-22-opensearch-1.2.3.markdown 1.2.4 "2022-01-18" opensearch 1.2.4 opensearch-dashboards 1.2.1
```

Reads all the version file for `2021-12-22-opensearch-1.2.3.markdown`, makes a copy to `2022-01-18-opensearch-1.2.4.markdown`, updates the release notes and version number. Changes the artifact component version for opensearch to 1.2.4 and opensearch-dashboards to 1.2.1.


Notes:
- This overwrites an existing version file.
- It needs version 4 of [`yq`](https://mikefarah.gitbook.io/yq/)
56 changes: 56 additions & 0 deletions _versions/_v_update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#/bin/sh

if ! yq -V | grep -q 'version 4.'; then
echo "ERROR - This script needs yq (https://mikefarah.gitbook.io/yq/) version 4"
exit 2
fi


if [ -z "$1" ]; then
echo "ERROR - specify a origin as the first argument"
exit 2
fi

if [ -z "$2" ]; then
echo "ERROR - specify the new version number in the second argument"
exit 2
fi

if [ -z "$3" ]; then
echo "ERROR - specify the release date in the third argument"
exit 2
fi



VERSION_FILE="$3-opensearch-$2.markdown"
if [ ! -f "$VERSION_FILE" ]; then
cp $1 $VERSION_FILE
fi

echo "Setting the version"
VERSION_PATH="./$VERSION_FILE"
export VERSION_ASSIGN=$2
yq e --front-matter=process -i '.version = strenv(VERSION_ASSIGN)' $VERSION_PATH

echo "Setting the release notes URL"
export RELEASE_NOTES_URL="https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-$2.md"
yq e --front-matter=process -i '.release_notes = strenv(RELEASE_NOTES_URL)' $VERSION_PATH

echo "Setting the release date"
export RELEASE_DATE=$3
yq e --front-matter=process -i '.date = strenv(RELEASE_DATE)' $VERSION_PATH


cmdLineArgs=( "$@" )
cmdCurrent=3
while [ ${cmdLineArgs[cmdCurrent]} ]
do
if [ ${cmdLineArgs[cmdCurrent]} ] && [ ${cmdLineArgs[cmdCurrent+1]} ]; then
echo "Settting artifact '${cmdLineArgs[cmdCurrent]}' version to '${cmdLineArgs[cmdCurrent+1]}'"
export TO_MODIFY=${cmdLineArgs[cmdCurrent]}
export NEW_VALUE=${cmdLineArgs[cmdCurrent+1]}
yq e --front-matter=process -i '(.components.[] | select(.artifact == strenv(TO_MODIFY)) | .version) = strenv(NEW_VALUE)' $VERSION_PATH
fi
cmdCurrent=$((cmdCurrent+2))
done

0 comments on commit 95c8829

Please sign in to comment.