-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 60100e5
Showing
74 changed files
with
21,570 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
**/node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# This file is for unifying the coding style for different editors and IDEs | ||
# editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[*.js] | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
COMPOSE_PROJECT_NAME=osl | ||
node_version=15 | ||
node_variant=-alpine | ||
node_variant_dev=-buster |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
**/node_modules | ||
*.bak | ||
.history |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
variables: | ||
APP_IMAGE: "osl_app" | ||
COMPOSE_FILE: "docker-compose.build.yml" | ||
CONTAINER_RELEASE_IMAGE: "nanawel/our-shopping-list" | ||
|
||
stages: | ||
- check | ||
- build | ||
- release | ||
|
||
before_script: | ||
- time docker info | ||
- time docker login ${REGISTRY_SERVER} | ||
|
||
build_image: | ||
stage: build | ||
script: | ||
- time make config | ||
- time make build args="--build-arg version=${CI_COMMIT_REF_SLUG} --build-arg build_id=${CI_COMMIT_SHORT_SHA}" | ||
- time docker tag ${APP_IMAGE}:${APP_VERSION:-latest} ${CONTAINER_RELEASE_IMAGE}:${CI_COMMIT_SHORT_SHA} | ||
- time docker push ${CONTAINER_RELEASE_IMAGE}:${CI_COMMIT_SHORT_SHA} | ||
tags: | ||
- shell | ||
- docker | ||
|
||
push_image_latest: | ||
stage: release | ||
script: | ||
- time docker pull ${CONTAINER_RELEASE_IMAGE}:${CI_COMMIT_SHORT_SHA} | ||
- time docker tag ${CONTAINER_RELEASE_IMAGE}:${CI_COMMIT_SHORT_SHA} ${CONTAINER_RELEASE_IMAGE}:latest | ||
- time docker push ${CONTAINER_RELEASE_IMAGE}:latest | ||
tags: | ||
- shell | ||
- docker | ||
only: | ||
- master | ||
|
||
push_image_tagged: | ||
stage: release | ||
script: | ||
- time docker pull ${CONTAINER_RELEASE_IMAGE}:${CI_COMMIT_SHORT_SHA} | ||
- time docker tag ${CONTAINER_RELEASE_IMAGE}:${CI_COMMIT_SHORT_SHA} ${CONTAINER_RELEASE_IMAGE}:${CI_COMMIT_REF_SLUG} | ||
- time docker push ${CONTAINER_RELEASE_IMAGE}:${CI_COMMIT_REF_SLUG} | ||
tags: | ||
- shell | ||
- docker | ||
only: | ||
- /^\d+\.\d+\.\d+.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
ARG node_version="15" | ||
ARG node_variant="-alpine" | ||
ARG version | ||
ARG build_id | ||
|
||
FROM node:${node_version}${node_variant} as client-builder | ||
|
||
COPY ./client/ /app/client | ||
|
||
RUN cd /app/client \ | ||
&& yarn install \ | ||
&& yarn build | ||
|
||
FROM node:${node_version}${node_variant} | ||
|
||
ARG version | ||
ARG build_id | ||
|
||
LABEL app-name="Our Shopping List" | ||
LABEL maintainer="Anaël Ollier <[email protected]>" | ||
|
||
ENV APP_VERSION=${version} | ||
ENV APP_BUILD_ID=${build_id} | ||
|
||
COPY ./ /app | ||
COPY --from=client-builder /app/client /app/client | ||
|
||
WORKDIR /app | ||
|
||
RUN yarn install --production | ||
|
||
CMD [ "node", "server.js" ] | ||
EXPOSE 8080 |
Oops, something went wrong.