Skip to content

Commit

Permalink
restore ioc-template merge
Browse files Browse the repository at this point in the history
  • Loading branch information
gilesknap committed Oct 11, 2023
1 parent c4c597e commit a960529
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 21 deletions.
2 changes: 2 additions & 0 deletions .devcontainer/.bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,5 @@ fi
if [ -f ~/.bashrc_dev_container ]; then
. ~/.bashrc_dev_container
fi

source /root/.bash_completions/ibek.sh
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@
"source=${localEnv:HOME}/.bash_eternal_history,target=/root/.bash_eternal_history,type=bind",
"source=${localWorkspaceFolder}/.devcontainer/.bashrc,target=/root/.bashrc,type=bind",
"source=${localEnv:HOME}/.bashrc_dev_container,target=/root/.bashrc_dev_container,type=bind",
"source=${localEnv:HOME}/.bashprofile_dev_container,target=/root/.bashprofile_dev_container,type=bind",
"source=${localEnv:HOME}/.gitconfig,target=/root/.gitconfig,type=bind",
"source=${localEnv:HOME}/.inputrc,target=/root/.inputrc,type=bind",
"source=${localEnv:HOME}/.ssh,target=/root/.ssh,type=bind"
]
}
}
9 changes: 8 additions & 1 deletion .devcontainer/initializeCommand
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
#!/bin/bash

# make sure all the files we mount into the container exist
for i in .bash_eternal_history .bashrc_dev_container .inputrc .gitconfig; do
for i in \
.bash_eternal_history \
.bashrc_dev_container \
.bashprofile_dev_container \
.inputrc \
.gitconfig
do
if [ ! -f $HOME/$i ] ; then
touch $HOME/$i;
fi
echo verified existance of $i
done

echo "devcontainerID ${1}"
5 changes: 5 additions & 0 deletions .devcontainer/postCreateCommand
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@
# best to let the user do this manually once inside the container

# ibek ioc compile

# add user's custom profile
if [ -f ~/.bashprofile_dev_container ]; then
. ~/.bashprofile_dev_container
fi
33 changes: 18 additions & 15 deletions .github/workflows/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,36 @@
# PLATFORM: the platform to build for (linux/amd64 or linux/arm64)
# CACHE: the directory to use for caching

if [[ ${PUSH} == 'true' ]] ; then PUSH='--push' ; else PUSH='' ; fi
TAG=${TAG:-latest}
PLATFORM=${PLATFORM:-linux/amd64}
CACHE=${CACHE:-/tmp/ec-cache}
export EC_TAG="--tag ${TAG:-latest}"
export EC_PLATFORM="--platform ${PLATFORM:-linux/amd64}"
export EC_CACHE="${CACHE:-/tmp/ec-cache}"
export EC_DEBUG=true
if [[ "${PUSH}" == 'true' ]] ; then EC_PUSH='--push' ; fi

THIS=$(dirname ${0})
set -xe
mkdir -p ${CACHE}

if ! ec --version 2> /dev/null ; then
# pip install --upgrade -r ${THIS}/../../requirements.txt
# TODO TODO - using latest dev of ec for the moment
pip install git+https://github.com/epics-containers/epics-containers-cli@dev
fi
# get the current version of ec CLI
pip install -r ${THIS}/../../requirements.txt

# add cache arguments - local file cache passed by github seems to be most reliable
export EC_CARGS="
--cache-from type=local,src=${EC_CACHE}
--cache-to type=local,dest=${EC_CACHE}
"

# add extra cross compilation platforms below if needed e.g.
# ec dev build --arch rtems ... for RTEMS cross compile

# build runtime and developer images
ec --log-level debug dev build --tag ${TAG} --platform ${PLATFORM} \
--cache-to ${CACHE} --cache-from ${CACHE} ${PUSH}
ec dev build --buildx ${EC_TAG} ${EC_PLATFORM} ${EC_PUSH} ${EC_CARGS}

# extract the ioc schema from the runtime image
ec dev launch-local --tag ${TAG} --execute \
'ibek ioc generate-schema /epics/links/ibek/*.ibek.support.yaml' \
> ibek.ioc.schema.json
echo ec dev launch-local ${EC_TAG} --execute \
'ibek ioc generate-schema /epics/links/ibek/*.ibek.support.yaml' > ibek.ioc.schema.json

# run acceptance tests
shopt -s nullglob # expand to nothing if no tests are found
for t in "${THIS}/../../tests/*.sh"; do bash ${t}; done
for t in "${THIS}/../../tests/*.sh"; do ${t}; done

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ ibek
# Remove from .gitignore if you want to customize the template.
/ioc/

# dont save workspaces as other users will have differing folders
*workspace
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
url = [email protected]:epics-containers/ibek-defs.git
[submodule "ibek-support"]
path = ibek-support
url = git@github.com:epics-containers/ibek-support.git
url = https://github.com/epics-containers/ibek-support.git
5 changes: 2 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
epics-containers-cli==2.2.0
# NOTE: to debug the CLI you can use intermediate builds by looking in Actions and copying the 'dist' URL i.e.
# epics-containers-cli -e https://github.com/epics-containers/epics-containers-cli/suites/16919013647/artifacts/966547589
# TODO using dev for the moment. Should be a pin to the current release
git+https://github.com/epics-containers/epics-containers-cli.git@dev

0 comments on commit a960529

Please sign in to comment.