Skip to content

Commit c851fd0

Browse files
committed
feat: latest changes from website-template
1 parent ea695fd commit c851fd0

File tree

11 files changed

+209
-23
lines changed

11 files changed

+209
-23
lines changed

CONFIGURATION.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ All unit tests are run automatically during build (see the `Dockerfile.build` fi
126126

127127
### Integration and end-to-end tests
128128

129-
All integration and end-to-end test suites are run automatically after application has been deployed to dev environment. You can use any test tools that have been installed as development dependency inside the `builder` container (see `Dockerfile.build`). You can specify your environment specific test settings in `taito-config.sh` using `test_` as prefix. You can access database in your tests as database proxy is run automatically in background (see `docker-compose-test.yaml`). If the test tools generate reports, screenshots or videos, they should be placed at the `/service/test/reports`, `/service/test/screenshots` and `/service/test/videos` directories.
129+
All integration and end-to-end test suites are run automatically after application has been deployed to dev environment. You can use any test tools that have been installed as development dependency inside the `builder` container (see `Dockerfile.build`). You can specify your environment specific test settings in `taito-test-config.sh` using `test_` as prefix. You can access database in your tests as database proxy is run automatically in background (see `docker-compose-test.yaml`). If the test tools generate reports, screenshots or videos, they should be placed at the `/service/test/reports`, `/service/test/screenshots` and `/service/test/videos` directories.
130130

131131
Tests are grouped in test suites (see the `test-suites` files). All test suites can be kept independent by cleaning up data before each test suite execution by running `taito init --clean`. You can enable data cleaning in `taito-config.sh` with the `ci_exec_test_init` setting, but you should use it for dev environment only.
132132

www/Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ ARG SERVICE_DIR=.
66
RUN apt-get -y update && apt-get -y install rsync # rsync for windows devs
77
ENV NODE_ENV development
88

9-
# https://github.com/gatsbyjs/gatsby/issues/11406#issuecomment-485278936
10-
RUN echo fs.inotify.max_user_watches=524288 | tee -a /etc/sysctl.conf
11-
129
RUN mkdir /service && chown node:node /service
10+
1311
WORKDIR /service
1412
COPY ${SERVICE_DIR}/install.sh \
1513
${SERVICE_DIR}/package* \

www/Dockerfile.build

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@ ENV BUILD_VERSION ${BUILD_VERSION}
1010
ENV NODE_ENV development
1111
ENV APP_SENTRY_PUBLIC_DSN #sentryPublicDSN
1212

13-
# https://github.com/gatsbyjs/gatsby/issues/11406#issuecomment-485278936
14-
RUN echo fs.inotify.max_user_watches=524288 | tee -a /etc/sysctl.conf
15-
1613
RUN mkdir /service && chown node:node /service
14+
1715
WORKDIR /service
1816
COPY ${SERVICE_DIR}/*.sh \
1917
${SERVICE_DIR}/package* \
@@ -33,7 +31,7 @@ FROM nginx:1.15-alpine
3331
ARG BUILD_VERSION
3432
LABEL version=${BUILD_VERSION} \
3533
company=companyname \
36-
project=website-template \
34+
project=server-template \
3735
role=www
3836
WORKDIR /service
3937
RUN chown -R nginx:nginx /var/cache/nginx && \

www/Dockerfile.webhook

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,11 @@ ARG SERVICE_DIR=.
33
ARG BUILD_VERSION
44
LABEL version=${BUILD_VERSION} \
55
company=companyname \
6-
project=website-template \
6+
project=server-template \
77
role=webhook
88
RUN apt-get -y update && \
99
apt-get -y install git webhook
1010

11-
# https://github.com/gatsbyjs/gatsby/issues/11406#issuecomment-485278936
12-
RUN echo fs.inotify.max_user_watches=524288 | tee -a /etc/sysctl.conf
13-
1411
WORKDIR /service
1512
COPY ${SERVICE_DIR}/*.sh \
1613
${SERVICE_DIR}/*.json \

www/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Configuration
22

3-
Configure static site generator of your choice with the following instructions. Currently instructions are provided only for Gatsby, Hugo and Jekyll, but with some extra work the website-template may easily be used with any static site generator.
3+
Configure static site generator of your choice with the following instructions. Currently instructions are provided only for Gatsby, Hugo and Jekyll, but with some extra work the server-template may easily be used with any static site generator.
44

55
Remove static site generators that you do not use from `www/install.sh`.
66

@@ -11,6 +11,8 @@ Start containers, and start a shell inside the www Docker container:
1111
taito start
1212
taito shell:www
1313

14+
*FOR PLAIN STATIC FILES:* Exit the shell and add static files to www/assets with your code editor.
15+
1416
*FOR GATSBY ONLY:* Create a new Gatsby site based on one of the [starters](https://www.gatsbyjs.org/starters?v=2) (NOTE: Select 'npm' as package manager and ignore the 'git commit' error):
1517

1618
su node

www/build-site.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,27 @@
22

33
set -x
44

5-
if [ ! -d ./site ]; then
6-
echo No site yet.
7-
elif [ -f ./site/package.json ]; then
5+
if [ -f ./site/package.json ]; then
86
# Gatsby build
97
cd site && \
10-
npm run build -- --prefix-paths && \
8+
npm run build --prefix-paths && \
119
cp -rf ./public/* /build
1210
elif [ -f ./site/Gemfile ]; then
1311
# Jekyll build
1412
cd site && \
1513
jekyll build && \
1614
cp -rf /_site/* /build
17-
else
15+
elif [ -f ./site/config.toml ]; then
1816
# Hugo build
1917
cd site && \
2018
hugo && \
2119
cp -rf ./public/* /build
20+
else
21+
echo No site yet.
22+
fi
23+
24+
if [ -d ./assets ]; then
25+
cp -rf ./assets/* /build
2226
fi
2327

2428
# TODO configure live reload for all of these

www/build-webhook.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ if [ "${1}" = "install" ]; then
99
cp -rf /build-orig/* /build
1010
fi
1111
# Clone git and install libraries for real-time builds
12-
git clone "https://${WEBHOOK_VC_TOKEN}@${VC_REPOSITORY_URL/\//:}" repository && \
12+
git clone "https://${WEBHOOK_VC_TOKEN}@${VC_REPOSITORY_URL}" repository && \
1313
cd /service/repository/www && \
1414
git checkout "${COMMON_ENV}" && \
1515
npm run install-site

www/cypress.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"baseUrl": "https://website-template-dev.mydomain.com",
2+
"baseUrl": "https://server-template-dev.mydomain.com",
33
"fixturesFolder": "test/fixtures",
44
"integrationFolder": "test/integration",
55
"pluginsFile": "test/plugins/index.js",

www/develop.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ elif [ -f ./site/config.toml ]; then
2121
hugo server -D --bind=0.0.0.0 --port 8080 \
2222
--baseURL "http://localhost:${COMMON_PUBLIC_PORT}" --appendPort=false \
2323
--liveReloadPort "${COMMON_PUBLIC_PORT}"
24+
elif [ -d ./assets ]; then
25+
echo "Serving static assets from www/assets"
26+
npm run serve
2427
else
2528
echo "develop.sh: No site yet at www/site. Just keep the container running."
2629
tail -f /dev/null

0 commit comments

Comments
 (0)