Skip to content

Commit 2720ce9

Browse files
committed
chore: ci test - static build
1 parent 2580bee commit 2720ce9

File tree

10 files changed

+27
-62
lines changed

10 files changed

+27
-62
lines changed

.github/workflows/build-graalvm.yml

-6
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ on:
1010
jobs:
1111
buildAndPush:
1212
runs-on: ubuntu-22.04
13-
strategy:
14-
matrix:
15-
platform: ["linux/amd64", "linux/arm64"]
1613
steps:
1714
- uses: earthly/actions-setup@v1
1815
with:
@@ -35,6 +32,3 @@ jobs:
3532
echo "TAG=${TAG}" >> $GITHUB_ENV
3633
- name: Run build
3734
run: earthly +build --tag ${{ env.TAG }} --build_type=native-ci
38-
# - name: Build native image
39-
# run: ./gradlew --no-daemon -i -Pversion=${{ env.TAG }} clean build nativeCompile
40-
# working-directory: ./applications/cli

.github/workflows/release.yml

-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ on:
88
jobs:
99
buildAndPush:
1010
runs-on: self-hosted
11-
# strategy:
12-
# matrix:
13-
# platform: ["linux/amd64", "linux/arm64"]
1411
env:
1512
DOCKERHUB_USERNAME: ${{ secrets.DEV_DOCKERHUB_USERNAME }}
1613
DOCKERHUB_TOKEN: ${{ secrets.DEV_DOCKERHUB_TOKEN }}

Earthfile

-8
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,6 @@ zip:
5555
RUN cd /app && zip -r yaci-devkit-${tag}.zip .
5656
SAVE ARTIFACT yaci-devkit-${tag}.zip AS LOCAL build/yaci-devkit-${tag}.zip
5757

58-
cli-zip:
59-
LOCALLY
60-
ARG EARTHLY_TARGET_NAME
61-
ARG EARTHLY_GIT_SHORT_HASH
62-
ARG TARGETOS
63-
ARG TARGETARCH
64-
BUILD ./applications/cli+zip --APP_VERSION=${tag} --COMMIT_ID=${EARTHLY_GIT_SHORT_HASH}
65-
6658
test-nodes-setup:
6759
LOCALLY
6860
RUN cd build/ && unzip yaci-devkit-${tag}.zip

applications/cli/Earthfile

+6-22
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
VERSION 0.8
22

3-
cli-jar:
3+
cli-java:
44
ARG EARTHLY_TARGET_NAME
55
ARG EARTHLY_GIT_SHORT_HASH
66
ARG APP_VERSION
@@ -103,9 +103,12 @@ docker-build:
103103
ELSE IF [ "$BUILD_TYPE" = "native-ci" ]
104104
COPY (+cli-native-ci/yaci-cli* --APP_VERSION=${APP_VERSION}) /app/
105105
ELSE
106-
COPY (+cli-jar/yaci-cli.jar --APP_VERSION=${APP_VERSION}) /app/yaci-cli.jar
106+
COPY (+cli-java/yaci-cli.jar --APP_VERSION=${APP_VERSION}) /app/yaci-cli.jar
107107
END
108108

109+
COPY docker/yaci-cli.sh /app/
110+
RUN chmod +x /app/yaci-cli.sh
111+
109112
RUN mkdir -p /app/config
110113
COPY docker/application.properties /app/config/
111114

@@ -121,25 +124,6 @@ docker-build:
121124
EXPOSE 1337
122125
EXPOSE 1442
123126

124-
IF [ "$BUILD_TYPE" = "native" ]
125-
ENTRYPOINT ["/app/yaci-cli"]
126-
ELSE
127-
ENTRYPOINT ["java", "-jar","/app/yaci-cli.jar"]
128-
END
127+
ENTRYPOINT ["sh", "/app/yaci-cli.sh"]
129128

130129
SAVE IMAGE --push ${REGISTRY_ORG}/yaci-cli:${APP_VERSION}
131-
132-
zip:
133-
LOCALLY
134-
ARG TARGETOS
135-
ARG TARGETARCH
136-
ARG APP_VERSION
137-
138-
COPY (+cli-native-ci/yaci-cli --APP_VERSION=${APP_VERSION}) build/yaci-cli
139-
FROM alpine:3.19.1
140-
WORKDIR /app
141-
RUN apk add --no-cache zip
142-
RUN mkdir -p /app/yaci-cli-${APP_VERSION}-${TARGETOS}-${TARGETARCH}
143-
COPY build/yaci-cli /app/yaci-cli-${APP_VERSION}-${TARGETOS}-${TARGETARCH}/
144-
RUN cd /app && zip -r yaci-cli-${APP_VERSION}-${TARGETOS}-${TARGETARCH}.zip .
145-
SAVE ARTIFACT yaci-cli-${APP_VERSION}-${TARGETOS}-${TARGETARCH}.zip AS LOCAL build/yaci-cli-${APP_VERSION}-${TARGETOS}-${TARGETARCH}.zip

applications/cli/docker/yaci-cli.sh

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
# Check if yaci_cli_mode is set in the environment, if not set it to "java"
4+
if [ -z "$yaci_cli_mode" ]; then
5+
yaci_cli_mode="java"
6+
fi
7+
8+
# Check the value of yaci_cli_mode and run the appropriate command
9+
if [ "$yaci_cli_mode" == "java" ]; then
10+
java -jar /app/yaci-cli.jar
11+
elif [ "$yaci_cli_mode" == "native" ]; then
12+
/app/yaci-cli
13+
else
14+
echo "Invalid mode. Please use 'java' or 'native'."
15+
exit 1
16+
fi

bin/devkit.sh

+2-6
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ cd "$(dirname "$0")"
55
SCRIPT_DIR="../scripts"
66
CONFIG_DIR="../config"
77

8-
YACI_CLI_SCRIPT="yaci-cli.sh"
9-
# Uncomment to run the Java version of yaci-cli
10-
#YACI_CLI_SCRIPT="yaci-cli-java.sh"
11-
128
# This is the wrapper script for starting and stopping services and running yaci-cli.sh
139

1410
# Function to display help message
@@ -45,7 +41,7 @@ case $1 in
4541
echo "start.sh executed successfully. Running yaci-cli.sh..."
4642
first_arg="$1"
4743
shift
48-
sh $SCRIPT_DIR/$YACI_CLI_SCRIPT "$@"
44+
sh $SCRIPT_DIR/yaci-cli.sh "$@"
4945
else
5046
echo "start.sh failed. Not executing yaci-cli.sh."
5147
fi
@@ -56,7 +52,7 @@ case $1 in
5652
;;
5753
ssh)
5854
echo "ssh to Devkit container..."
59-
sh $SCRIPT_DIR//ssh.sh
55+
sh $SCRIPT_DIR/ssh.sh
6056
;;
6157
info)
6258
echo "Info of Devkit"

config/env

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ ogmios_enabled=true
33
kupo_enabled=false
44

55
node=node1
6+
yaci_cli_mode=native
67

78
#######################################################
89
# Ports

config/version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
tag=0.9.0-dev3
1+
tag=0.9.0-dev4
22
revision=

scripts/yaci-cli-java.sh

-15
This file was deleted.

scripts/yaci-cli.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ then
1212
CMD="docker compose"
1313
fi
1414

15-
$CMD --env-file $ENV_FILE --env-file $VERSION_FILE exec yaci-cli /app/yaci-cli $*
15+
$CMD --env-file $ENV_FILE --env-file $VERSION_FILE exec yaci-cli /app/yaci-cli.sh $*

0 commit comments

Comments
 (0)