File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11FROM debian:stable-slim
22LABEL Description="Use the Balena CLI to perform actions"
33
4- # # Install the standalone balena-cli package
5- RUN apt-get update && apt-get install -y curl unzip
4+ # # Build arguments
5+
6+ # # CLI version
7+ ARG CLI_VERSION=22.2.4
8+ ARG CLI_URL=https://github.com/balena-io/balena-cli/releases/download/v${CLI_VERSION}
9+ ARG CLI_ARCHIVE=balena-cli-v${CLI_VERSION}-linux-x64-standalone.tar.gz
10+ ARG DEBIAN_FRONTEND=noninteractive
611
712WORKDIR /app
813
9- # # Version
10- ENV CLI_VERSION=18.2.33
14+ # # Install the standalone balena-cli package
15+ RUN apt update && \
16+ apt install -y \
17+ curl && \
18+ apt autoremove -y && \
19+ rm -rf /var/lib/apt/lists/* && \
20+ apt clean
1121
12- # # Download and Unzip Balena CLI
13- RUN curl -O -sSL https://github.com/balena-io/balena-cli/releases/download/v${CLI_VERSION}/balena-cli-v${CLI_VERSION}-linux-x64-standalone.zip && \
14- unzip balena-cli-*-linux-x64-standalone.zip
22+ # # Download and extract Balena CLI
23+ RUN curl -O -sSL ${CLI_URL}/${CLI_ARCHIVE} && \
24+ tar -xvzf ${CLI_ARCHIVE} && \
25+ /app/balena/bin/balena --version
1526
1627# # Copy Entrypoint
1728COPY entrypoint.sh ./entrypoint.sh
Original file line number Diff line number Diff line change 33
44# Switch to Workspace path
55if [ -d " ${GITHUB_WORKSPACE} " ]; then
6- cd ${GITHUB_WORKSPACE}
6+ cd " ${GITHUB_WORKSPACE} "
77fi
88
99# Switch to Application path
1010if [ -d " ${INPUT_APPLICATION_PATH} " ]; then
11- cd ${INPUT_APPLICATION_PATH}
11+ cd " ${INPUT_APPLICATION_PATH} "
1212fi
1313
1414# Error out of no API Token is available
2525# Write secrets file if provided
2626if [[ " ${INPUT_BALENA_SECRETS} " != " " ]]; then
2727 mkdir -p ~ /.balena/
28- echo ${INPUT_BALENA_SECRETS} > ~/.balena/secrets.json
28+ echo " ${INPUT_BALENA_SECRETS} " > ~/.balena/secrets.json
2929fi
3030
3131# Log in to Balena
32- /app/balena-cli/ balena login --token ${INPUT_BALENA_API_TOKEN}
32+ /app/balena/bin/ balena login --token " ${INPUT_BALENA_API_TOKEN} "
3333
3434# Run command
35- /app/balena-cli/ balena $*
35+ /app/balena/bin/ balena " $* "
You can’t perform that action at this time.
0 commit comments