Skip to content

Commit

Permalink
build: fix choosing of right cs version
Browse files Browse the repository at this point in the history
  • Loading branch information
QuadStingray committed Oct 7, 2023
1 parent 5e0bad5 commit dd9ee8b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/all_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ jobs:
mongodb-port: 4711
- name: Run tests
run: sbt test
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Build Docker Container for test
run: docker buildx build --platform=linux/amd64,linux/arm64/v8 . --tag mongocamp-server:test
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v2
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v2
# - name: Build Docker Container for test
# run: docker buildx build --platform=linux/amd64,linux/arm64/v8 . --tag mongocamp-server:test
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ARG GRAAL_VERSION="graalvm-java17:22.3.2"
ENV PATH="$PATH:/opt/coursier/bin"
COPY . /mongocamp-cli/
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections; apt-get update; apt-get install -y curl gcc bash zlib1g-dev libc6 build-essential libz-dev zlib1g-dev; apt-get -y upgrade;
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections; apt-get update; apt-get install -y apt-utils; apt-get install -y curl gcc bash zlib1g-dev libc6 build-essential libz-dev zlib1g-dev; apt-get -y upgrade;
RUN chmod +x /mongocamp-cli/prepare-build.sh;
RUN /mongocamp-cli/prepare-build.sh;
WORKDIR /mongocamp-cli/
Expand Down
4 changes: 2 additions & 2 deletions build_docker.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ commands += Command.command("ci-docker")((state: State) => {
if (semVersion.isStable) {
val containerName = s"mongocamp-server:${version.value}"

val buildCommand = s"docker buildx build --platform=linux/amd64,linux/arm64/v8 . --tag $containerName"
val buildCommand = s"docker buildx build --platform=linux/amd64,linux/arm64/v8,linux/arm/v7 . --tag $containerName"
if (buildCommand.!(ProcessLogger(stout => state.log.info(stout), sterr => state.log.info(sterr))) != 0) {
throw new Exception(s"Not zero exit code for build base image: ${containerName}")
}
Expand All @@ -18,7 +18,7 @@ commands += Command.command("ci-docker")((state: State) => {
}

// val containerNameCached = s"mongocamp-server:${version.value}-cached"
// val buildCommandCached = s"docker build -f DockerfileJVMCached --build-arg MONGOCAMPVERSION=${version.value} --tag ${containerNameCached} ."
// val buildCommandCached = s"docker buildx build --platform=linux/amd64,linux/arm64/v8,linux/arm/v7 -f DockerfileJVMCached --build-arg MONGOCAMPVERSION=${version.value} --tag ${containerNameCached} ."
// if (buildCommandCached.!(ProcessLogger(stout => state.log.info(stout), sterr => state.log.info(sterr))) != 0) {
// throw new Exception(s"Not zero exit code for build cached image: ${containerNameCached}")
// }
Expand Down
9 changes: 5 additions & 4 deletions prepare-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ rm /bin/sh
ln -s /bin/bash /bin/sh
mkdir -p /opt/coursier;
ARCH=$(uname -m | tr '[:upper:]' '[:lower:]');
if [[ "$ARCH" == *"amd"* ]]; then
echo "Download AMD Version"
curl -fL "https://github.com/coursier/launchers/raw/master/cs-x86_64-pc-linux.gz" | gzip -d > /opt/coursier/cs
else
echo "Architecture found: $ARCH";
if [[ "$ARCH" == *"aarch"* ]]; then
echo "Download AARCH Version"
curl -fL "https://github.com/VirtusLab/coursier-m1/releases/latest/download/cs-aarch64-pc-linux.gz" | gzip -d > /opt/coursier/cs
else
echo "Download AMD Version"
curl -fL "https://github.com/coursier/launchers/raw/master/cs-x86_64-pc-linux.gz" | gzip -d > /opt/coursier/cs
fi

chmod +x /opt/coursier/cs;
Expand Down

0 comments on commit dd9ee8b

Please sign in to comment.