Skip to content

Commit

Permalink
fix: no version commits
Browse files Browse the repository at this point in the history
  • Loading branch information
sleidig committed Jul 23, 2021
1 parent 0a350e4 commit 81acbc4
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/tagged-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ jobs:
tags: aamdigital/ndb-testing:${{ env.TAG }}
cache-from: type=registry,ref=aamdigital/ndb-testing:cache
cache-to: type=registry,ref=aamdigital/ndb-testing:cache,mode=max
build-args: |
APP_VERSION=${{ env.TAG }}
4 changes: 0 additions & 4 deletions .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@
["@semantic-release/npm", {
"npmPublish": false
}],
["@semantic-release/git", {
"assets": ["src/environments/environment.ts", "src/environments/environment.prod.ts", "package.json", "package-lock.json"],
"message": "chore(release): ${nextRelease.version} \n\n${nextRelease.notes}"
}],
["@semantic-release/github", {
"assets": []
}],
Expand Down
67 changes: 67 additions & 0 deletions build/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# This docker image can be used to run the application locally.
# To use it only Docker needs to be installed locally
# Run the following commands from the root folder to build, run and kill the application
# >> docker build -f build/Dockerfile -t aam/digital:latest .
# >> docker run -p=80:80 aam/digital:latest aam-digital
# >> docker kill aam-digital
FROM node:15.11.0-alpine3.13 as builder
WORKDIR /app

COPY package*.json ./
#RUN npm ci --no-progress

#RUN $(npm bin)/ng version

COPY . .

ARG APP_VERSION="UNKNOWN"
RUN sed -i "s/appVersion: \".*\"/appVersion: \"$APP_VERSION\"/g" src/environments/environment*.ts
RUN cat src/environments/environment.ts

#RUN npm run build-localized

# When set to true, tests are run and coverage will be uploaded to CodeClimate
ARG UPLOAD_COVERAGE=false
#RUN if [ "$UPLOAD_COVERAGE" = true ] ; then \
# apk --no-cache add curl &&\
# curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter &&\
# chmod +x ./cc-test-reporter &&\
# ./cc-test-reporter before-build ; fi

# When set to true, chromium is installed an tests are executed
ARG RUN_TESTS=false
ARG CHROME_BIN=/usr/bin/chromium-browser
# Install chromium for karma, lint code and run tests
#RUN if [ "$RUN_TESTS" = true ] || [ "$UPLOAD_COVERAGE" = true ] ; then \
# apk --no-cache add chromium &&\
# npm run lint &&\
# npm run test-ci ; fi

# The following arguments need to be provided for the code climate test reporter to work correctly
# The commit sha
ARG GIT_COMMIT_SHA
# The branch
ARG GIT_BRANCH
# The time of the commit, can be extracted with `git log -1 --pretty=format:%ct`
ARG GIT_COMMITTED_AT
# The ID for the test reporter, can be found on CodeCoverage
ARG CC_TEST_REPORTER_ID
#RUN if [ "$UPLOAD_COVERAGE" = true ] ; then ./cc-test-reporter after-build --debug ; fi


### PROD image

FROM nginx:1.21-alpine
COPY ./build/default.conf /etc/nginx/templates/default.conf
COPY --from=builder /app/dist/ /usr/share/nginx/html
# The port on which the app will run in the Docker container
ENV PORT=80
# The url to the webdav server
ENV WEBDAV_URL="http://localhost"
# The url to the CouchDB database
ENV COUCHDB_URL="http://localhost"
# The language which should be loaded on default options are "en-US" and "de"
ENV DEFAULT_LANGUAGE="en-US"
# variables are inserted into the nginx config
CMD envsubst '$$PORT $$WEBDAV_URL $$COUCHDB_URL $$DEFAULT_LANGUAGE' < /etc/nginx/templates/default.conf > /etc/nginx/conf.d/default.conf &&\
nginx -g 'daemon off;'
48 changes: 48 additions & 0 deletions build/default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
server {
listen ${PORT};
listen [::]:${PORT};

#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;

root /usr/share/nginx/html;
location ^~ /de {
index index.html index.htm;
try_files $uri $uri/ /de/index.html;
}

location ^~ /en {
index index.html index.htm;
try_files $uri $uri/ /en-US/index.html;
}

# Set the default language when nothing is entered in the url
location / {
try_files $uri /${DEFAULT_LANGUAGE}/index.html;
}

#error_page 404 /404.html;

# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}

location /db {
rewrite /db/(.*) /$1 break;
proxy_pass ${COUCHDB_URL};
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Ssl on;
}

location /webdav {
rewrite /webdav/(.*) /$1 break;
proxy_pass ${WEBDAV_URL};
}
}

0 comments on commit 81acbc4

Please sign in to comment.