Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: bump elastic stack version #1038

Merged
merged 4 commits into from
Jun 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .ci/bump-stack-release-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env bash
#
# Given the stack version this script will bump the release version.
#
# This script is executed by the automation we are putting in place
# and it requires the git add/commit commands.
#
# Parameters:
# $1 -> the minor version to be bumped. Mandatory.
# $1 -> the major version to be bumped. Mandatory.
#
set -euo pipefail
MSG="parameter missing."
VERSION_RELEASE=${1:?$MSG}
VERSION_DEV=${2:?$MSG}

OS=$(uname -s| tr '[:upper:]' '[:lower:]')

if [ "${OS}" == "darwin" ] ; then
SED="sed -i .bck"
else
SED="sed -i"
fi

echo "Update stack with versions ${VERSION_RELEASE} and ${VERSION_DEV}"
${SED} -E -e "s#(values '8.0.0-SNAPSHOT', '7.x',) '[0-9]+\.[0-9]+\.[0-9]+'#\1 '${VERSION_DEV}'#g" Jenkinsfile
${SED} -E -e "s#(defaultValue:) '[0-9]+\.[0-9]+\.[0-9]+'#\1 '${VERSION_RELEASE}'#g" Jenkinsfile
git add Jenkinsfile
for FILE in .ci/scripts/load-testing.sh .ci/scripts/pull_and_build.sh .ci/scripts/test.sh dev-utils/docker-compose.yml ; do
${SED} -E -e "s#:-[0-9]+\.[0-9]+\.[0-9]+#:-${VERSION_RELEASE}#g" $FILE
git add $FILE
done

git diff --staged --quiet || git commit -m "chore: update elastic stack release ${VERSION_RELEASE} and ${VERSION_DEV}"
git --no-pager log -1

echo "You can now push and create a Pull Request"
2 changes: 1 addition & 1 deletion .ci/scripts/load-testing.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

STACK_VERSION=${1:-7.10.0}
STACK_VERSION=${1:-7.13.1}
USER_ID="$(id -u):$(id -g)"
NODEJS_VERSION=$(cat ./dev-utils/.node-version)

Expand Down
4 changes: 2 additions & 2 deletions .ci/scripts/pull_and_build.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env bash
export NODEJS_VERSION=$(cat ./dev-utils/.node-version)
export STACK_VERSION=${STACK_VERSION:-7.10.0}
export STACK_VERSION=${STACK_VERSION:-7.13.1}

STACK_VERSION=${STACK_VERSION} \
docker-compose -f ./dev-utils/docker-compose.yml --log-level INFO pull --quiet --ignore-pull-failures

# We are building the images here even though the Docker images are already cached in Packer.
# This is because there could be changes in the PR affecting the files copied to the Docker image,
# which we want to test in the current build.
# which we want to test in the current build.
NODEJS_VERSION="${NODEJS_VERSION}" \
STACK_VERSION=${STACK_VERSION} \
docker-compose -f ./dev-utils/docker-compose.yml --log-level INFO build >docker-compose.log 2>docker-compose.err
Expand Down
2 changes: 1 addition & 1 deletion .ci/scripts/test.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
set -xeo pipefail
STACK_VERSION=${STACK_VERSION:-7.10.0}
STACK_VERSION=${STACK_VERSION:-7.13.1}

pip install docker-compose>=1.25.4

Expand Down
44 changes: 22 additions & 22 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pipeline {
booleanParam(name: 'saucelab_test', defaultValue: "true", description: "Enable run a Sauce lab test")
booleanParam(name: 'bench_ci', defaultValue: true, description: 'Enable benchmarks')
booleanParam(name: 'release', defaultValue: false, description: 'Release. If so, all the other parameters will be ignored when releasing from master.')
string(name: 'stack_version', defaultValue: '7.10.0', description: "What's the Stack Version to be used for the load testing?")
string(name: 'stack_version', defaultValue: '7.13.1', description: "What's the Stack Version to be used for the load testing?")
}
stages {
stage('Initializing'){
Expand Down Expand Up @@ -111,12 +111,11 @@ pipeline {
agent { label 'linux && immutable' }
axes {
axis {
name 'STACK_VERSION'
values (
'8.0.0-SNAPSHOT',
'7.7.0',
'7.0.0'
)
name 'ELASTIC_STACK_VERSION'
// The below line is part of the bump release automation
// if you change anything please modifies the file
// .ci/bump-stack-release-version.sh
values '8.0.0-SNAPSHOT', '7.x', '7.13.1'
}
axis {
name 'SCOPE'
Expand All @@ -132,7 +131,7 @@ pipeline {
stages {
stage('Scope Test') {
steps {
runTest()
runTest(stack: env.ELASTIC_STACK_VERSION, scope: env.SCOPE)
}
}
}
Expand Down Expand Up @@ -558,26 +557,27 @@ def prepareRelease(String nodeVersion='node:lts', Closure body){

def runAllScopes(){
def scopes = [
'SCOPE=@elastic/apm-rum-core',
'SCOPE=@elastic/apm-rum',
'SCOPE=@elastic/apm-rum-react',
'SCOPE=@elastic/apm-rum-angular',
'SCOPE=@elastic/apm-rum-vue'
'@elastic/apm-rum-core',
'@elastic/apm-rum',
'@elastic/apm-rum-react',
'@elastic/apm-rum-angular',
'@elastic/apm-rum-vue'
]
scopes.each{ s ->
withEnv([s]){
runTest()
}
scopes.each{ scope ->
runTest(stack: env.STACK_VERSION, scope: scope)
}
}

def runTest(){
def runTest(Map args = [:]){
def stack = args.stack
def scope = args.scope
def mode = env.MODE == 'none' ? 'Puppeteer' : env.MODE
withGithubNotify(context: "Test ${SCOPE} - ${STACK_VERSION} - ${mode}", tab: 'tests') {
def stackVersion = (stack == '7.x') ? artifactsApi(action: '7.x-version') : stack
withGithubNotify(context: "Test ${scope} - ${stack} - ${mode}", tab: 'tests') {
runScript(
label: "${SCOPE}",
stack: "${STACK_VERSION}",
scope: "${SCOPE}",
label: "${scope}",
stack: "${stackVersion}",
scope: "${scope}",
goal: 'test'
)
}
Expand Down
6 changes: 3 additions & 3 deletions dev-utils/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "2.1"
services:
elasticsearch:
container_name: elasticsearch
image: docker.elastic.co/elasticsearch/elasticsearch:${STACK_VERSION:-7.10.0}
image: docker.elastic.co/elasticsearch/elasticsearch:${STACK_VERSION:-7.13.1}
environment:
- cluster.name=docker-cluster
- bootstrap.memory_lock=true
Expand Down Expand Up @@ -34,7 +34,7 @@ services:

apm-server:
container_name: apm-server
image: docker.elastic.co/apm/apm-server:${STACK_VERSION:-7.10.0}
image: docker.elastic.co/apm/apm-server:${STACK_VERSION:-7.13.1}
ports:
- "127.0.0.1:${APM_SERVER_PORT:-8200}:8200"
environment:
Expand Down Expand Up @@ -84,7 +84,7 @@ services:

kibana:
container_name: kibana
image: docker.elastic.co/kibana/kibana:${STACK_VERSION:-7.10.0}
image: docker.elastic.co/kibana/kibana:${STACK_VERSION:-7.13.1}
environment:
SERVER_NAME: kibana.example.org
ELASTICSEARCH_URL: http://elasticsearch:9200
Expand Down