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

bump-stack-version 8.0.0-bf13b83e #4

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
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
49 changes: 49 additions & 0 deletions .ci/bump-stack-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/usr/bin/env bash
#
# Given the stack version this script will bump the version.
#
# This script is executed by the automation we are putting in place
# and it requires the git add/commit commands.
#
# Parameters:
# $1 -> the version to be bumped. Mandatory.
# $2 -> whether to create a branch where to commit the changes to.
# this is required when reusing an existing Pull Request.
# Optional. Default true.
#
set -euo pipefail
MSG="parameter missing."
VERSION=${1:?$MSG}
CREATE_BRANCH=${2:-true}

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

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

if [ "$CREATE_BRANCH" = "true" ]; then
git checkout -b "update-stack-version-$(date "+%Y%m%d%H%M%S")"
else
echo "Branch creation disabled."
fi

FILES="testing/environments/snapshot-oss.yml
testing/environments/snapshot.yml
"

echo "Update stack with version ${VERSION}"
for FILE in ${FILES} ; do
${SED} -E -e "s#(image: docker\.elastic\.co/.*):[0-9]+\.[0-9]+\.[0-9]+(-[a-f0-9]{8})?#\1:${VERSION}#g" $FILE
done

echo "Commit changes"
for FILE in ${FILES} ; do
git add $FILE
done
git diff --staged --quiet || git commit -m "bump stack version ${VERSION}"
git --no-pager log -1

echo "You can now push and create a Pull Request"
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,6 @@ x-pack/elastic-agent/pkg/agent/operation/tests/scripts/serviceable-1.0-darwin-x8
# Terraform
*.terraform
*.tfstate*

# Bump
testing/environments/*.bck
9 changes: 9 additions & 0 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,12 @@ pull_request_rules:
git merge upstream/{{base}}
git push upstream {{head}}
```
- name: Automatic squash and merge with success checks and the files matching the regex ^testing/environments/snapshot* are modified.
conditions:
- check-success=beats-ci/pr-merge
- label=automation
- files~=^testing/environments/snapshot.*\.yml$
actions:
merge:
method: squash
strict: smart+fasttrack
6 changes: 3 additions & 3 deletions testing/environments/snapshot-oss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
version: '2.3'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.0.0-SNAPSHOT
image: docker.elastic.co/elasticsearch/elasticsearch:8.0.0-bf13b83e-SNAPSHOT
healthcheck:
test: ["CMD-SHELL", "curl -s http://localhost:9200/_cat/health?h=status | grep -q green"]
retries: 300
Expand All @@ -21,7 +21,7 @@ services:
- "script.context.template.cache_max_size=2000"

logstash:
image: docker.elastic.co/logstash/logstash-oss:8.0.0-SNAPSHOT
image: docker.elastic.co/logstash/logstash-oss:8.0.0-bf13b83e-SNAPSHOT
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9600/_node/stats"]
retries: 600
Expand All @@ -31,7 +31,7 @@ services:
- ./docker/logstash/pki:/etc/pki:ro

kibana:
image: docker.elastic.co/kibana/kibana:8.0.0-SNAPSHOT
image: docker.elastic.co/kibana/kibana:8.0.0-bf13b83e-SNAPSHOT
healthcheck:
test: ["CMD-SHELL", "curl -s http://localhost:5601/api/status | grep -q 'Looking good'"]
retries: 600
Expand Down
4 changes: 2 additions & 2 deletions testing/environments/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
version: '2.3'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.0.0-SNAPSHOT
image: docker.elastic.co/elasticsearch/elasticsearch:8.0.0-bf13b83e-SNAPSHOT
healthcheck:
test: ["CMD-SHELL", "curl -s http://localhost:9200/_cat/health?h=status | grep -q green"]
retries: 300
Expand Down Expand Up @@ -32,7 +32,7 @@ services:
- ./docker/logstash/pki:/etc/pki:ro

kibana:
image: docker.elastic.co/kibana/kibana:8.0.0-SNAPSHOT
image: docker.elastic.co/kibana/kibana:8.0.0-bf13b83e-SNAPSHOT
healthcheck:
test: ["CMD-SHELL", "curl -s http://localhost:5601/api/status | grep -q 'Looking good'"]
retries: 600
Expand Down