-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from soramitsu/feature/DOPS-2816/load-tool-ci
DOPS-2816: Add iroha2-perf CI
- Loading branch information
Showing
14 changed files
with
175 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: I2-PERF::CI::Publish | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
workflow_dispatch: | ||
inputs: | ||
GITHUB_IROHA2_BRANCH: | ||
description: "iroha2 repo branch to take the image tag release" | ||
required: false | ||
default: iroha2-stable | ||
|
||
env: | ||
IROHA2_RELEASE: ${{ github.event.inputs.GITHUB_IROHA2_BRANCH || 'iroha2-stable' }} | ||
|
||
jobs: | ||
registry: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | ||
- name: Bump version and save the semver tag | ||
uses: anothrNick/github-tag-action@a2c70ae13a881faf2b4953baaa9e49731997ab36 | ||
id: tag_id | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
WITH_V: false | ||
DEFAULT_BUMP: none | ||
- name: Get the release from a branch name | ||
run: | | ||
RELEASE=$(curl -s https://raw.githubusercontent.com/hyperledger/iroha/${{ ENV.IROHA2_RELEASE }}/Cargo.toml \ | ||
| sed -n '3p' | sed -e 's/version = "//g' -e 's/"$//' | tr -d '\n') | ||
echo "RELEASE=$RELEASE" >>$GITHUB_ENV | ||
- name: Login to Soramitsu Harbor | ||
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d | ||
with: | ||
registry: docker.soramitsu.co.jp | ||
username: ${{ secrets.HARBOR_USERNAME }} | ||
password: ${{ secrets.HARBOR_PASSWORD }} | ||
- name: Build and push iroha2-perf image | ||
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 | ||
with: | ||
push: true | ||
tags: docker.soramitsu.co.jp/iroha2/iroha2-perf:${{ steps.tag_id.outputs.new_tag }}-${{ env.RELEASE }} | ||
file: Dockerfile | ||
context: . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,38 @@ | ||
FROM maven:3.9.5-eclipse-temurin-11-alpine | ||
FROM maven:3.9.5-eclipse-temurin-11-alpine as builder | ||
|
||
RUN apk add wget && \ | ||
wget https://github.com/JetBrains/kotlin/releases/download/v1.8.0/kotlin-compiler-1.8.0.zip && \ | ||
RUN wget https://github.com/JetBrains/kotlin/releases/download/v1.8.0/kotlin-compiler-1.8.0.zip && \ | ||
unzip kotlin-compiler-1.8.0.zip -d /opt && \ | ||
rm kotlin-compiler-1.8.0.zip | ||
|
||
WORKDIR /app | ||
COPY . /app | ||
RUN mvn clean package | ||
COPY pom.xml ./ | ||
COPY ./src ./src | ||
RUN mvn clean package | ||
|
||
FROM maven:3.9.5-eclipse-temurin-11-alpine | ||
|
||
ENV USER=iroha | ||
ENV UID=1000 | ||
ENV GID=1000 | ||
ENV MAVEN_CONFIG=/var/maven/.m2 | ||
USER root | ||
|
||
RUN set -ex && \ | ||
addgroup -g $GID $USER && \ | ||
adduser \ | ||
--disabled-password \ | ||
--gecos "" \ | ||
--home /app \ | ||
--ingroup "$USER" \ | ||
--uid "$UID" \ | ||
"$USER" && \ | ||
mkdir -p $MAVEN_CONFIG && \ | ||
chown $USER:$USER -R $MAVEN_CONFIG | ||
|
||
WORKDIR /app | ||
COPY --from=builder /app/pom.xml ./ | ||
COPY --from=builder /app/target/ ./target/ | ||
|
||
USER $USER | ||
|
||
ENTRYPOINT ["/usr/local/bin/mvn-entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters