-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
deploy: add build using epics-in-docker musl image.
musl allows us to produce a fully static binary, which can be deployed on almost any machine. The intended deployment directory is /opt/rffe-epics-ioc, so that's where we build the IOC, to guarantee that envPaths has the correct definitions.
- Loading branch information
Showing
2 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/sh | ||
|
||
set -ex | ||
|
||
cp /opt/epics/RELEASE configure/ | ||
cat << EOF > configure/CONFIG_SITE.local | ||
STATIC_BUILD=YES | ||
FULL_STATIC_BUILD=YES | ||
USR_LDFLAGS = -static-pie | ||
# TODO: add to base image | ||
COMMANDLINE_LIBRARY = READLINE_NCURSES | ||
EOF | ||
|
||
# TODO: add to base image | ||
apk add git ncurses-static | ||
|
||
git config --global --add safe.directory $PWD | ||
|
||
make distclean | ||
make | ||
make clean | ||
make -C iocBoot | ||
|
||
version=$(git describe) | ||
|
||
echo $version > rffe-epics-ioc-version | ||
echo ".git/" > /tmp/globs | ||
# this trick is done so the resulting tarball has a root rffe-epics-ioc/ directory | ||
(cd .. && tar caf rffe-epics-ioc/rffe-epics-ioc-${version}.tar.gz -X /tmp/globs rffe-epics-ioc/) | ||
rm rffe-epics-ioc-version | ||
|
||
make distclean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
services: | ||
build-static-ioc: | ||
image: ghcr.io/cnpem/lnls-alpine-3.18-epics-7:v0.10.0-dev | ||
volumes: | ||
- type: bind | ||
source: ./ | ||
target: /opt/rffe-epics-ioc | ||
working_dir: /opt/rffe-epics-ioc | ||
command: ./build-ioc.sh |