-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'support/cicd' into 'develop'
Support/cicd Closes #61 See merge request PBSA/dapps/NFT-store!3
- Loading branch information
Showing
4 changed files
with
77 additions
and
26 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,49 @@ | ||
# gitlab scanning | ||
include: | ||
- template: Dependency-Scanning.gitlab-ci.yml | ||
- template: License-Scanning.gitlab-ci.yml | ||
- template: SAST.gitlab-ci.yml | ||
- template: Secret-Detection.gitlab-ci.yml | ||
- template: Container-Scanning.gitlab-ci.yml | ||
|
||
variables: | ||
GIT_DEPTH: "2" # Tells git to fetch all the branches of the project, required by the analysis task | ||
DOCKER_DRIVER: overlay2 | ||
|
||
stages: | ||
- build | ||
- test | ||
- deploy | ||
|
||
# builds app | ||
build: | ||
# node docker image on which this would be run | ||
image: node:14.16.1-alpine3.13 | ||
stage: build | ||
script: | ||
- npm install | ||
tags: | ||
- docker | ||
|
||
docker_build: | ||
image: docker:stable | ||
stage: build | ||
services: | ||
- docker:19.03.12-dind | ||
variables: | ||
IMAGE: $CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:$CI_COMMIT_SHA | ||
script: | ||
- docker info | ||
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY | ||
- docker build -t $IMAGE . | ||
- docker push $IMAGE | ||
|
||
deployToDev: | ||
stage: deploy | ||
script: | ||
- docker-compose down | ||
- docker-compose up --build -d | ||
when: | ||
manual | ||
tags: | ||
- nftdev1 |
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 |
---|---|---|
@@ -1,25 +1,25 @@ | ||
FROM mhart/alpine-node:8 | ||
|
||
ENV NODE_VERSION 8.9.4 | ||
|
||
RUN apk add --no-cache make gcc g++ python bash | ||
|
||
WORKDIR /var/expressCart | ||
|
||
COPY lib/ /var/expressCart/lib/ | ||
COPY bin/ /var/expressCart/bin/ | ||
COPY config/ /var/expressCart/config/ | ||
COPY public/ /var/expressCart/public/ | ||
COPY routes/ /var/expressCart/routes/ | ||
COPY views/ /var/expressCart/views/ | ||
|
||
COPY app.js /var/expressCart/ | ||
COPY package.json /var/expressCart/ | ||
COPY deploy.js /var/expressCart/ | ||
|
||
FROM node:14.16.1-alpine3.13 | ||
|
||
RUN apk update && apk add \ | ||
g++ \ | ||
make \ | ||
nasm \ | ||
git \ | ||
libtool \ | ||
autoconf \ | ||
automake \ | ||
libpng-dev \ | ||
pkgconfig | ||
|
||
WORKDIR /var/nftstore | ||
|
||
COPY package*.json /var/nftstore/ | ||
RUN npm install | ||
|
||
VOLUME /var/expressCart/data | ||
COPY ./ /var/nftstore/ | ||
|
||
VOLUME /var/nftstore/data | ||
|
||
EXPOSE 1111 | ||
|
||
ENTRYPOINT ["npm", "start"] |
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
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