Skip to content

Commit

Permalink
ci(Jenkinsfile): migrate to cloud-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
menski committed Jun 7, 2019
1 parent e71772b commit 13f27b7
Show file tree
Hide file tree
Showing 7 changed files with 286 additions and 301 deletions.
283 changes: 0 additions & 283 deletions .ci/job.dsl

This file was deleted.

19 changes: 19 additions & 0 deletions .ci/scripts/docker-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh -xeu

cd app/

IMAGE="camunda/zeebe-simple-monitor"

echo "Building Zeebe Simple Monitor Docker image ${RELEASE_VERSION}."
docker build --no-cache --build-arg JAR=target/zeebe-simple-monitor-app-${RELEASE_VERSION}.jar -t ${IMAGE}:${RELEASE_VERSION} .

echo "Authenticating with DockerHub and pushing image."
docker login --username ${DOCKER_HUB_USR} --password ${DOCKER_HUB_PSW}

echo "Pushing ${IMAGE}:${RELEASE_VERSION}"
docker push ${IMAGE}:${RELEASE_VERSION}

docker tag ${IMAGE}:${RELEASE_VERSION} ${IMAGE}:latest

echo "Pushing ${IMAGE}:latest"
docker push ${IMAGE}:latest
16 changes: 16 additions & 0 deletions .ci/scripts/docker-snapshot.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh -xeu

cd app/

if [ -f target/zeebe-simple-monitor-app-*-SNAPSHOT.jar ]; then
IMAGE="camunda/zeebe-simple-monitor:SNAPSHOT"

echo "Building Zeebe Simple Monitor Docker image ${IMAGE}."
docker build --no-cache -t ${IMAGE} .

echo "Authenticating with DockerHub and pushing image."
docker login --username ${DOCKER_HUB_USR} --password ${DOCKER_HUB_PSW}

echo "Pushing ${IMAGE}"
docker push ${IMAGE}
fi
33 changes: 33 additions & 0 deletions .ci/scripts/github-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash -xeu

export GITHUB_TOKEN=${GITHUB_TOKEN_PSW}
export GITHUB_ORG=zeebe-io
export GITHUB_REPO=zeebe-simple-monitor

# do github release
curl -sL https://github.com/aktau/github-release/releases/download/v0.7.2/linux-amd64-github-release.tar.bz2 | tar xjvf - --strip 3
./github-release release --user ${GITHUB_ORG} --repo ${GITHUB_REPO} --tag ${RELEASE_VERSION} --draft --name "Zeebe Hazelcast Exporter ${RELEASE_VERSION}" --description ""

# upload app
cd app/target

export ARTIFACT=zeebe-simple-monitor-app-${RELEASE_VERSION}.jar
export CHECKSUM=${ARTIFACT}.sha1sum

# create checksum files
sha1sum ${ARTIFACT} > ${CHECKSUM}

../../github-release upload --user ${GITHUB_ORG} --repo ${GITHUB_REPO} --tag ${RELEASE_VERSION} --name "${ARTIFACT}" --file "${ARTIFACT}"
../../github-release upload --user ${GITHUB_ORG} --repo ${GITHUB_REPO} --tag ${RELEASE_VERSION} --name "${CHECKSUM}" --file "${CHECKSUM}"

# upload exporter
cd ../../exporter/target

export ARTIFACT=zeebe-simple-monitor-exporter-${RELEASE_VERSION}.jar
export CHECKSUM=${ARTIFACT}.sha1sum

# create checksum files
sha1sum ${ARTIFACT} > ${CHECKSUM}

../../github-release upload --user ${GITHUB_ORG} --repo ${GITHUB_REPO} --tag ${RELEASE_VERSION} --name "${ARTIFACT}" --file "${ARTIFACT}"
../../github-release upload --user ${GITHUB_ORG} --repo ${GITHUB_REPO} --tag ${RELEASE_VERSION} --name "${CHECKSUM}" --file "${CHECKSUM}"
29 changes: 29 additions & 0 deletions .ci/settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>camunda-nexus</id>
<username>${env.NEXUS_USR}</username>
<password>${env.NEXUS_PSW}</password>
</server>
<server>
<id>central</id>
<username>${env.MAVEN_CENTRAL_USR}</username>
<password>${env.MAVEN_CENTRAL_PSW}</password>
</server>
</servers>
<mirrors>
<mirror>
<id>camunda-nexus</id>
<mirrorOf>*</mirrorOf>
<name>Camunda Nexus</name>
<!-- uncomment to use DC Nexus locally
<url>https://app.camunda.com/nexus/content/groups/internal</url>
-->
<!-- use CI proxy nexus -->
<url>http://repository-ci-camunda-cloud.nexus:8081/content/groups/internal/</url>
</mirror>
</mirrors>
</settings>
Loading

0 comments on commit 13f27b7

Please sign in to comment.