Skip to content

Commit 25313c7

Browse files
authored
Merge pull request #74 from ufoscout/multiple_build
support multiple architectures
2 parents 2127a8e + 59bd47b commit 25313c7

File tree

4 files changed

+43
-19
lines changed

4 files changed

+43
-19
lines changed

.github/workflows/release.yml

+17-5
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,36 @@ jobs:
1313
strategy:
1414
matrix:
1515
arch:
16-
- "x86_64"
17-
# - "aarch64"
16+
- { name: x86_64, target: x86_64-unknown-linux-musl }
17+
- { name: aarch64, target: aarch64-unknown-linux-musl }
18+
- { name: armv7, target: armv7-unknown-linux-musleabihf }
1819
runs-on: ubuntu-latest
1920
steps:
2021
- uses: actions/checkout@v3
2122
- name: Setup Rust
2223
uses: actions-rs/toolchain@v1
2324
with:
2425
toolchain: stable
25-
target: ${{ matrix.arch }}-unknown-linux-musl
26+
target: ${{ matrix.arch.target }}
2627
override: true
2728
- name: Build
2829
uses: actions-rs/cargo@v1
2930
with:
3031
command: build
31-
args: --release --target=${{ matrix.arch }}-unknown-linux-musl
32+
args: --release --target=${{ matrix.arch.target }}
3233
use-cross: true
34+
- name: Copy and prepare default artifact for release
35+
if: matrix.arch.name == 'x86_64'
36+
run: |
37+
mkdir -p target/artifacts
38+
cp "target/${{ matrix.arch.target }}/release/wait" "target/artifacts/wait"
39+
- name: Copy and prepare all artifacts for release
40+
run: |
41+
mkdir -p target/artifacts
42+
cp "target/${{ matrix.arch.target }}/release/wait" "target/artifacts/wait_${{ matrix.arch.name }}"
43+
echo "Artifacts list:"
44+
ls -latr target/artifacts/*
3345
- name: Release
3446
uses: softprops/action-gh-release@v1
3547
with:
36-
files: target/${{ matrix.arch }}-unknown-linux-musl/release/wait
48+
files: target/artifacts/*

Cargo.lock

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[package]
22
name = "wait"
3-
version = "2.10.0"
3+
version = "2.11.0"
44
authors = ["ufoscout <[email protected]>"]
5-
edition = "2018"
5+
edition = "2021"
66

77
[dependencies]
88
port_check = "0.1"

README.md

+19-7
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
![Build Status](https://github.com/ufoscout/docker-compose-wait/actions/workflows/build_and_test.yml/badge.svg)
44
[![codecov](https://codecov.io/gh/ufoscout/docker-compose-wait/branch/master/graph/badge.svg)](https://codecov.io/gh/ufoscout/docker-compose-wait)
55

6-
A small command-line utility to wait for other docker images to be started while using docker-compose.
6+
A small command-line utility to wait for other docker images to be started while using docker-compose (or Kubernetes or docker stack or whatever).
77

88
It permits waiting for:
99
- a fixed amount of seconds
@@ -21,7 +21,8 @@ For example, your application "MySuperApp" uses MongoDB, Postgres and MySql (wow
2121
FROM alpine
2222

2323
## Add the wait script to the image
24-
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.10.0/wait /wait
24+
## This is the default executable for the x86_64 architecture, other architectures are supported too
25+
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.11.0/wait /wait
2526
RUN chmod +x /wait
2627

2728
## Add your application to the docker image
@@ -81,7 +82,7 @@ When using [distroless](https://github.com/GoogleContainerTools/distroless) or b
8182

8283
```dockerfile
8384
FROM golang
84-
RUN wget -o /wait https://github.com/ufoscout/docker-compose-wait/releases/download/2.10.0/wait
85+
RUN wget -o /wait https://github.com/ufoscout/docker-compose-wait/releases/download/{{VERSION}}/wait
8586
COPY myApp /app
8687
WORKDIR /app
8788
RUN go build -o /myApp -ldflags '-s -w -extldflags -static' ./...
@@ -107,16 +108,27 @@ The behaviour of the wait utility can be configured with the following environme
107108
- _WAIT_AFTER_: number of seconds to wait (sleep) once all the hosts/paths are available
108109
- _WAIT_SLEEP_INTERVAL_: number of seconds to sleep between retries. The default is 1 second.
109110

111+
## Supported architectures
112+
113+
From release 2.11.0, the following executables are available for download:
114+
- _wait_: This is the executable intended for Linux x64 systems
115+
- *wait_x86_64*: This is the very same executable than _wait_
116+
- *wait_aarch64*: This is the executable to be used for aarch64 architectures
117+
- *wait_arm7*: This is the executable to be used for arm7 architectures
118+
119+
All executables are built with [MUSL](https://www.musl-libc.org/) for maximum portability.
120+
121+
To use any of these executables, simply replace the executable name in the download link:
122+
https://github.com/ufoscout/docker-compose-wait/releases/download/{{VERSION}}/{{executable_name}}
123+
124+
110125
## Using on non-linux systems
111126

112127
The simplest way of getting the _wait_ executable is to download it from
113128

114129
[https://github.com/ufoscout/docker-compose-wait/releases/download/{{VERSION}}/wait](https://github.com/ufoscout/docker-compose-wait/releases/download/{{VERSION}}/wait)
115130

116-
This is a pre-built executable for Linux x64 systems which are the default ones in Docker.
117-
In addition, it is built with [MUSL](https://www.musl-libc.org/) for maximum portability.
118-
119-
If you need it for a different architecture, you should clone this repository and build it for your target.
131+
If you need it for an architecture for which a pre-built file is not available, you should clone this repository and build it for your target.
120132

121133
As it has no external dependencies, an being written in the mighty [rust](https://www.rust-lang.org)
122134
programming language, the build process is just a simple `cargo build --release`

0 commit comments

Comments
 (0)