Skip to content

Commit 6127fa7

Browse files
authored
Merge pull request #186 from bryanlatten/newrelic-go-cache
Newrelic: remove go-cache after compile, Github CI compatible + working
2 parents ae9d5f1 + 25fbf83 commit 6127fa7

File tree

14 files changed

+91
-80
lines changed

14 files changed

+91
-80
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,38 +10,39 @@ jobs:
1010
strategy:
1111
matrix:
1212
variant:
13-
- 7.4
14-
- 7.4-alpine
15-
- 8.0
13+
- "7.4"
14+
- "7.4-alpine"
15+
- "8.0"
1616
platform:
1717
- linux/amd64
18-
# - linux/arm64
18+
- linux/arm64
1919
exclude:
20-
- props:
21-
Dockerfile: Dockerfile-7.4-alpine
20+
# TODO: enable with compile cache
2221
- platform: linux/arm64
2322
env:
24-
TEST_MATCH: PHP Version ${{ matrix.props.version }}
23+
TEST_MATCH: PHP Version ${{ matrix.variant }}
2524
steps:
2625
-
2726
name: Checkout
2827
uses: actions/checkout@v2
28+
-
29+
name: Install goss
30+
run: |
31+
curl -L https://github.com/aelsabbahy/goss/releases/download/v0.3.9/goss-linux-amd64 -o /usr/local/bin/goss
32+
curl -L https://raw.githubusercontent.com/aelsabbahy/goss/master/extras/dgoss/dgoss -o /usr/local/bin/dgoss
33+
chmod +rx /usr/local/bin/goss
34+
chmod +rx /usr/local/bin/dgoss
2935
-
3036
name: Detect host configuration
3137
run: |
32-
# NOTE: Docker host configuration determines the networking target for integration testing
33-
v=$(mount | grep "/run/docker.sock")
3438
TARGET_HOST=
35-
36-
if [ -n "$v" ]; then
37-
echo "Injected docker socket detected"
39+
if [[ -n "$ACT" ]]; then
40+
echo "Local execution detected"
3841
TARGET_HOST="host.docker.internal"
39-
elif [ -S /var/run/docker.sock ]; then
40-
TARGET_HOST="localhost"
4142
else
42-
echo "No Docker socket detected, fail"
43-
exit 1
44-
fi
43+
TARGET_HOST="localhost"
44+
fi;
45+
4546
echo "TARGET_HOST=${TARGET_HOST}" >> $GITHUB_ENV
4647
-
4748
# Build and execute in multiple configurations: vanilla, with env overrides, with TLS enabled

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ sudo: required
22

33
env:
44
global:
5-
- GOSS_INSTALL_PATH="./"
5+
- GOSS_PATH="./goss"
6+
- DGOSS_PATH="./dgoss"
67
jobs:
78
- PHP_VARIANT=7.4-alpine
89
- PHP_VARIANT=7.4

Dockerfile-7.4

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM behance/docker-nginx:9.0
1+
FROM behance/docker-nginx:9.0 as output
22
LABEL maintainers="Behance Team <dev-behance@adobe.com>"
33

44
# Set TERM to suppress warning messages.
@@ -138,9 +138,13 @@ RUN cp /etc/php/7.0/mods-available/* $CONF_PHPMODS && \
138138
# Run standard set of tweaks to ensure runs performant, reliably, and consistent between variants
139139
/bin/bash -e /scripts/prep-php.sh
140140

141+
# TESTING PHASE: using multi-stage to isolate any possible side effects
142+
FROM output as testenvironment
141143

142144
# HACK: workaround for https://github.com/aelsabbahy/goss/issues/392
143145
# Run the child and parent test configs separately instead of leveraging inheritance
144146
RUN goss -g /tests/php-fpm/7.4.goss.yaml validate && \
145-
goss -g /tests/php-fpm/base.goss.yaml validate && \
146-
/aufs_hack.sh
147+
goss -g /tests/php-fpm/base.goss.yaml validate
148+
149+
# Output the final image
150+
FROM output

Dockerfile-7.4-alpine

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM behance/docker-nginx:9.0-alpine
1+
FROM behance/docker-nginx:9.0-alpine as output
22
LABEL maintainers="Behance Team <dev-behance@adobe.com>"
33

44
# Set TERM to suppress warning messages.
@@ -130,8 +130,12 @@ RUN cp /etc/php/7.0/mods-available/* $CONF_PHPMODS && \
130130
ln -s /usr/sbin/php-fpm7 /usr/sbin/php-fpm && \
131131
/bin/bash -e /scripts/prep-php.sh
132132

133+
# TESTING PHASE: using multi-stage to isolate any possible side effects
134+
FROM output
133135
# HACK: workaround for https://github.com/aelsabbahy/goss/issues/392
134136
# Run the child and parent test configs separately instead of leveraging inheritance
135137
RUN goss -g /tests/php-fpm/7.4-alpine.goss.yaml validate && \
136-
goss -g /tests/php-fpm/base.goss.yaml validate && \
137-
/aufs_hack.sh
138+
goss -g /tests/php-fpm/base.goss.yaml validate
139+
140+
# Output the final image
141+
FROM output

Dockerfile-8.0

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM behance/docker-nginx:9.0
1+
FROM behance/docker-nginx:9.0 as output
22
LABEL maintainers="Behance Team <dev-behance@adobe.com>"
33

44
# Set TERM to suppress warning messages.
@@ -133,8 +133,13 @@ RUN cp /etc/php/7.0/mods-available/* $CONF_PHPMODS && \
133133
# Run standard set of tweaks to ensure runs performant, reliably, and consistent between variants
134134
/bin/bash -e /scripts/prep-php.sh
135135

136+
# TESTING PHASE: using multi-stage to isolate any possible side effects
137+
FROM output as testenvironment
138+
136139
# HACK: workaround for https://github.com/aelsabbahy/goss/issues/392
137140
# Run the child and parent test configs separately instead of leveraging inheritance
138141
RUN goss -g /tests/php-fpm/8.0.goss.yaml validate && \
139-
goss -g /tests/php-fpm/base.goss.yaml validate && \
140-
/aufs_hack.sh
142+
goss -g /tests/php-fpm/base.goss.yaml validate
143+
144+
# Output the final image
145+
FROM output

runtime-tests/newrelic/7.4/goss.yaml

Lines changed: 0 additions & 11 deletions
This file was deleted.

runtime-tests/newrelic/8.0/goss.yaml

Lines changed: 0 additions & 11 deletions
This file was deleted.

runtime-tests/newrelic/7.4-alpine/goss.yaml renamed to runtime-tests/newrelic/goss.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
file:
2-
/etc/php7/conf.d/newrelic.ini:
2+
{{ .Env.CONF_PHPMODS }}/newrelic.ini:
33
exists: true
44
mode: "0644"
55
filetype: file # file, symlink, directory
@@ -9,3 +9,10 @@ file:
99
- '/^newrelic.loglevel = \"verbosedebug\"/'
1010
- '/^newrelic.daemon.loglevel = \"verbosedebug\"/'
1111
- '/^newrelic.special=debug_autorum/'
12+
/goss/docker_output.log:
13+
exists: true
14+
filetype: file # file, symlink, directory
15+
contains: # Check file content for these patterns
16+
- '/enabling APM metrics/'
17+
- '/adding in newrelic.special/'
18+
- '/enabling tracing/'

runtime-tests/startup/7.4-alpine/goss.yaml

Lines changed: 0 additions & 6 deletions
This file was deleted.

runtime-tests/startup/8.0/goss.yaml

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)