Skip to content

Commit a84801a

Browse files
committed
ci: refactored bootstrap-policy-run test to build latest core binaries instead of ancient 3.23 version available in alpine
Ticket: CFE-4623 Changelog: none
1 parent 01d6b79 commit a84801a

4 files changed

Lines changed: 23 additions & 4 deletions

File tree

.github/workflows/bootstrap_policy_run_check.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,17 @@ jobs:
99
uses: actions/checkout@v4
1010
with:
1111
path: masterfiles
12+
- name: Get Togethers
13+
uses: cfengine/together-javascript-action@main
14+
id: together
15+
with:
16+
myToken: ${{ secrets.GITHUB_TOKEN }}
17+
- name: Checkout Core
18+
uses: actions/checkout@v4
19+
with:
20+
repository: cfengine/core
21+
path: core
22+
ref: ${{steps.together.outputs.core || github.base_ref || github.ref}}
23+
submodules: recursive
1224
- name: Install, bootstrap, policy run
1325
run: masterfiles/ci/docker-bootstrap-policy-run.sh

ci/bootstrap-policy-run.Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
FROM alpine
2-
RUN apk update && apk add cfengine make automake autoconf git
2+
RUN apk add bash
3+
COPY core /core
4+
COPY masterfiles /masterfiles
5+
RUN ls /
6+
RUN find / -name core
7+
RUN /core/ci/install.sh

ci/bootstrap-policy-run.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/usr/bin/env sh
22
set -ex
3-
./autogen.sh --prefix=/var/lib/cfengine
3+
./autogen.sh
44
make install
5+
export PATH=/var/cfengine/bin:$PATH
56
which cf-agent
67
cf-agent -IB $(hostname -i) | tee bootstrap.log
78
cf-agent -KIf update.cf | tee update.log

ci/docker-bootstrap-policy-run.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ if docker images | grep mpf; then
2121
fi
2222

2323
# run the test
24-
docker build -t mpf -f "${NTECH_ROOT}"/masterfiles/ci/bootstrap-policy-run.Dockerfile "${NTECH_ROOT}"/masterfiles
25-
docker run --workdir /mpf --volume "${NTECH_ROOT}"/masterfiles:/mpf --tty mpf sh /mpf/ci/bootstrap-policy-run.sh
24+
ls "${NTECH_ROOT}"
25+
docker build -t mpf -f "${NTECH_ROOT}"/masterfiles/ci/bootstrap-policy-run.Dockerfile "${NTECH_ROOT}"
26+
docker run --workdir /masterfiles --tty mpf sh /masterfiles/ci/bootstrap-policy-run.sh
2627
if grep error *.log; then
2728
echo "fail"
2829
exit 1

0 commit comments

Comments
 (0)