Skip to content

Commit

Permalink
ci(jenkins): release process (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v authored Dec 6, 2019
1 parent 95b96bd commit 7fa9c78
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
18 changes: 18 additions & 0 deletions .ci/bump-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -euxo pipefail

AGENT_VERSION="${1?Missing the APM Node.js agent version}"

## Use docker to bump the version to ensure the environment is easy to reproduce.
docker run --rm -t \
--user $UID \
-e HOME=/tmp \
-e AGENT_VERSION="${AGENT_VERSION}" \
-w /app \
-v "$(pwd):/app" \
node:12-alpine /bin/sh -c "set -x
CI=true npm install elastic-apm-node@${AGENT_VERSION}"

# Commit changes
git add package.json
git commit -m "fix(package): bump elastic-apm-node to v${AGENT_VERSION}"
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
PORT ?= 3000
IMAGE ?= opbeans/opbeans-node
VERSION ?= latest
LTS_ALPINE ?= 12-alpine

Expand All @@ -10,7 +11,7 @@ help: ## Display this help text
all: build test

build: ## Build docker image
@docker build --file Dockerfile --tag=opbeans/opbeans-node:${VERSION} .
@docker build --file Dockerfile --tag=${IMAGE}:${VERSION} .

bats: ## Install bats in the project itself
@git clone https://github.com/sstephenson/bats.git
Expand All @@ -28,7 +29,7 @@ test: prepare-test ## Run the tests
sh -c "npm install tap-xunit -g && cat target/results.tap | tap-xunit --package='co.elastic.opbeans' > target/junit-results.xml"

publish: build ## Publish docker image
@docker push opbeans/opbeans-node:${VERSION}
@docker push "${IMAGE}:${VERSION}"

clean: ## Clean autogenerated files/folders
@rm -rf bats
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"dependencies": {
"after-all-results": "^2.0.0",
"body-parser": "^1.18.3",
"elastic-apm-node": "^3.0.0",
"elastic-apm-node": "3.2.0",
"express": "^4.16.4",
"express-pino-logger": "^4.0.0",
"pg": "^7.8.1",
Expand Down

0 comments on commit 7fa9c78

Please sign in to comment.