Skip to content

Commit

Permalink
Fix from other branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Incede committed Jan 21, 2025
1 parent ec8b3ff commit 4f75325
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 26 deletions.
35 changes: 23 additions & 12 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: Build docker image
on:
push:
branches:
- master
- LISK-1400-Setup-Dshackle
- test-ci-cd

env:
ECS_TASK_DEFINITION: task-definition.json

Expand All @@ -20,6 +20,18 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
submodules: recursive

- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: 21

- name: Setup gradle
uses: gradle/gradle-build-action@v2

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@0e613a0980cbf65ed5b322eb7a1e075d28913a83
Expand All @@ -36,16 +48,15 @@ jobs:
id: docker-image
run: |
echo "image=${{ steps.login-ecr.outputs.registry }}/${{ secrets.ECR_REPOSITORY }}" >> $GITHUB_OUTPUT
- name: Build docker image
run: make jib-docker

- name: Build and push the image
uses: docker/build-push-action@v6
id: docker-build
with:
context: .
push: true
tags: |
${{ steps.docker-image.outputs.image }}:latest
${{ steps.docker-image.outputs.image }}:${{ github.sha }}
- name: Update tags
run: |
docker tag liskhq/dshackle ${{ steps.docker-image.outputs.image }}:latest
docker tag liskhq/dshackle ${{ steps.docker-image.outputs.image }}:${{ github.sha }}
- name: Push Docker images to Amazon ECR
run: |
docker push --all-tags ${{ steps.docker-image.outputs.image }}
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ test: build-foundation
./gradlew check

local-docker: Dockerfile
docker build -t drpc-dshackle .
docker build -t liskhq-dshackle .

jib: build-foundation local-docker
./gradlew jib -Pdocker=drpcorg
./gradlew jib -Pdocker=liskhq

jib-docker: build-foundation local-docker
./gradlew jibDockerBuild -Pdocker=drpcorg
./gradlew jibDockerBuild -Pdocker=liskhq

distZip: build-foundation
./gradlew disZip
Expand Down
17 changes: 6 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -122,16 +122,8 @@ dependencies {
implementation(variantOf(libs.netty.tcnative.boringssl) { classifier("linux-aarch_64") })
implementation(variantOf(libs.netty.tcnative.boringssl) { classifier("osx-x86_64") })
implementation 'dshackle:foundation:1.0.0'

implementation files('src/main/resources/LogsOracle.jar')
}

// Enable 'Foreign Function & Memory API' (JEP 434)
// Drop after update on Java 21
tasks.withType(JavaCompile) { options.compilerArgs += "--enable-preview" }
tasks.withType(Test) { jvmArgs += "--enable-preview" }
tasks.withType(JavaExec) { jvmArgs += "--enable-preview" }

compileKotlin {
compilerOptions.jvmTarget.set(JvmTarget.JVM_21)
}
Expand Down Expand Up @@ -168,7 +160,7 @@ application {

jib {
from {
image = 'docker://drpc-dshackle'
image = 'docker://liskhq-dshackle'
}
to {
// by default publish as:
Expand Down Expand Up @@ -309,14 +301,17 @@ jacoco {
}

static def getVersion() {
def exactVersion = 'git describe --tags --exact-match'.execute().text.trim()
def exactVersion = 'git describe --tags'.execute().text.trim()

def result = ""
if (exactVersion) {
result = exactVersion
} else {
def tag = 'git describe --tags --abbrev=0'.execute().text.trim()
if (!tag) {
throw new GradleException("No tags found")
def commitHash = 'git rev-parse --short HEAD'.execute().text.trim()
return commitHash
// throw new GradleException("No tags found")
}
def m = tag =~ /\.(\d+)$/
def match = m[0][1]
Expand Down

0 comments on commit 4f75325

Please sign in to comment.