Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Update .gitlab-ci.yml #1

Open
wants to merge 65 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
eae1bd1
Update .gitlab-ci.yml
themayursinha Jul 28, 2020
4cda59b
Update .gitlab-ci.yml
themayursinha Jul 28, 2020
d55d86a
Update .gitlab-ci.yml
themayursinha Jul 28, 2020
6b14e1e
Update .gitlab-ci.yml
themayursinha Jul 28, 2020
7f93da8
Update .gitlab-ci.yml
themayursinha Jul 29, 2020
66ff9f2
Update .gitlab-ci.yml
themayursinha Jul 30, 2020
34f4e24
Create Dockerfile.test
themayursinha Jul 31, 2020
6389d34
Delete Dockerfile.test
themayursinha Jul 31, 2020
010a221
Update .gitlab-ci.yml
themayursinha Aug 7, 2020
c90cae2
Update .gitlab-ci.yml
themayursinha Aug 7, 2020
459f277
Update .gitlab-ci.yml
themayursinha Aug 13, 2020
778c27f
Update .gitlab-ci.yml
themayursinha Aug 13, 2020
736eb5d
Update .gitlab-ci.yml
themayursinha Aug 13, 2020
2a19693
Update .gitlab-ci.yml
themayursinha Aug 13, 2020
44426f8
Update .gitlab-ci.yml
themayursinha Aug 17, 2020
75c20c8
Update .gitlab-ci.yml
themayursinha Aug 19, 2020
ea4d1a7
Update .gitlab-ci.yml
themayursinha Aug 19, 2020
3df6a62
Update .gitlab-ci.yml
themayursinha Aug 19, 2020
64586ac
Update .gitlab-ci.yml
themayursinha Aug 19, 2020
bcf2509
test
themayursinha Aug 20, 2020
4c17810
update on juice shop code
Aug 21, 2020
35b3244
docker tld updated
Aug 21, 2020
8d5372d
build step updated
Aug 21, 2020
73c85a1
updated test 2
Aug 21, 2020
f7a51c9
registry url updated
Aug 21, 2020
d43a2d2
container scanning updated
Aug 21, 2020
130c770
updated registry image
Aug 21, 2020
1b1fc29
update on gitlab ci with image
Aug 21, 2020
5f41e97
container image updated for juice shop
Aug 21, 2020
eae8ab0
registry image url updated
Aug 21, 2020
b57e23d
before script added for authentication of google api
Aug 21, 2020
21286b8
container scanning updated
Aug 21, 2020
49a68b2
juice shop updated with fetch script
Aug 21, 2020
5fbfb01
build step removed
Aug 21, 2020
5d87883
updated with container image
Aug 21, 2020
9db2012
updated with new docker image
Aug 21, 2020
fbff0cc
§updated with security imag
Aug 21, 2020
a417173
updated with klar image
Aug 21, 2020
03a836c
update on gitlab taxfix-engine
Aug 24, 2020
7489d99
update on juice shop
Aug 24, 2020
dcf2fc7
update on test build script
Aug 24, 2020
b99da3b
update on test env
Aug 24, 2020
721bf44
update on juice shop
Aug 24, 2020
7cf1498
update on docker credentials
Aug 24, 2020
444e8f4
checking the path
Aug 24, 2020
d119adb
update on docker service
Aug 24, 2020
d6a7af9
update on docker script
Aug 24, 2020
80f7f7c
docker dind updated
Aug 24, 2020
f8f7c55
update on environment
Aug 24, 2020
ab119c2
db image updated
Aug 24, 2020
da7dc74
juice shop updated
Aug 24, 2020
6db2387
update test
Aug 24, 2020
be41114
build credentails
Aug 24, 2020
346daf6
update test
Aug 24, 2020
629a5d2
gitlab test
Aug 24, 2020
633c303
update on gitlab pipeline
Aug 24, 2020
77c4ec8
update test
Aug 24, 2020
2f9172b
docker push
Aug 24, 2020
6539ed6
build push removed
Aug 24, 2020
09a5dae
testing inages
Aug 24, 2020
2e51ae3
testing build image
Aug 24, 2020
b8fc46c
testing build image
Aug 24, 2020
95f5687
update on docker image
Aug 24, 2020
339e207
update on credentials
Aug 24, 2020
4efe062
update tesst
Aug 24, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 80 additions & 5 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,83 @@
include:
- project: 'devops/devops-tools'
ref: security
file: '/templates/.gitlab-ci-template.yml'
# include:
# - project: 'devops/devops-tools'
# ref: security
# file: '/templates/.gitlab-ci-template.yml'

variables:
SAST_EXCLUDED_PATHS: "frontend/src/assets/private/**"
CI_IS_DEPLOY_OLD: "true"
DOCKER_DRIVER: overlay2
REGISTRY_URL: "eu.gcr.io"
DOCKER_HOST: tcp://docker:2375
DOCKER_TLS_CERTDIR: ""
PROJECT_NAME: "taxfix-central"
# CI_REGISTRY_IMAGE: "eu.gcr.io/taxfix-central/gitlab-security"

services:
- docker:19.03.5-dind

stages:
- build
- test

before_script:
- mkdir -p ./creds
- echo $SERVICEACCOUNT | base64 -d > ./creds/sa.json
- gcloud auth activate-service-account --key-file=./creds/sa.json --project=$PROJECT_NAME
- gcloud components install docker-credential-gcr --quiet
- gcloud auth configure-docker --quiet
- |
echo " Release tag - $CI_COMMIT_TAG"
CI_COMMIT_TAG=${CI_COMMIT_TAG/v/}
export RELEASE_VERSION=$CI_COMMIT_TAG
if [ -z "$RELEASE_VERSION" ]
then
IMAGE_TAG=sha.${CI_COMMIT_SHA}
else
IMAGE_TAG=$RELEASE_VERSION-sha.${CI_COMMIT_SHA}
fi
- export IMAGE_TAG=$IMAGE_TAG
- export REGISTRY_IMAGE=${REGISTRY_URL}/$PROJECT_NAME/${CI_PROJECT_NAME}:$IMAGE_TAG
- export REGISTRY_IMAGE_LATEST=${REGISTRY_URL}/$PROJECT_NAME/${CI_PROJECT_NAME}:latest
- export DOCKER_IMAGE=$REGISTRY_IMAGE_LATEST


build:
variables:
DOCKER_TLS_CERTDIR: ""
stage: build
image: eu.gcr.io/taxfix-central/gitlab/container-scanning:2
services:
- docker:19.03.5-dind
script:
- |
if [ -z "$BUILD_SCRIPT" ]
then
echo "\$BUILD_SCRIPT is empty"
docker build -t $REGISTRY_IMAGE --build-arg NPM_TOKEN=$NPM_TOKEN .
else
echo "\$BUILD_SCRIPT is NOT empty"
bash $BUILD_SCRIPT
fi



include:
- template: Container-Scanning.gitlab-ci.yml
container_scanning:
image: eu.gcr.io/taxfix-central/gitlab/container-scanning:2
variables:
CLAIR_OUTPUT: High
KLAR_TRACE: "true"
CLAIR_TRACE: "true"
DOCKER_TLS_CERTDIR: ""
services:
- docker:19.03.5-dind
- name: $CLAIR_DB_IMAGE
alias: clair-vulnerabilities-db

environment:
name: integration



# test2
69 changes: 37 additions & 32 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,33 +1,38 @@
FROM node:12 as installer
COPY . /juice-shop
WORKDIR /juice-shop
RUN npm install --production --unsafe-perm
RUN npm dedupe
RUN rm -rf frontend/node_modules
# FROM node:12 as installer
# COPY . /juice-shop
# WORKDIR /juice-shop
# RUN npm install --production --unsafe-perm
# RUN npm dedupe
# RUN rm -rf frontend/node_modules

# FROM node:12-alpine
# ARG BUILD_DATE
# ARG VCS_REF
# LABEL maintainer="Bjoern Kimminich <[email protected]>" \
# org.opencontainers.image.title="OWASP Juice Shop" \
# org.opencontainers.image.description="Probably the most modern and sophisticated insecure web application" \
# org.opencontainers.image.authors="Bjoern Kimminich <[email protected]>" \
# org.opencontainers.image.vendor="Open Web Application Security Project" \
# org.opencontainers.image.documentation="https://help.owasp-juice.shop" \
# org.opencontainers.image.licenses="MIT" \
# org.opencontainers.image.version="11.1.3" \
# org.opencontainers.image.url="https://owasp-juice.shop" \
# org.opencontainers.image.source="https://github.com/bkimminich/juice-shop" \
# org.opencontainers.image.revision=$VCS_REF \
# org.opencontainers.image.created=$BUILD_DATE
# WORKDIR /juice-shop
# RUN addgroup juicer && \
# adduser -D -G juicer juicer
# COPY --from=installer --chown=juicer /juice-shop .
# RUN mkdir logs && \
# chown -R juicer logs && \
# chgrp -R 0 ftp/ frontend/dist/ logs/ data/ i18n/ && \
# chmod -R g=u ftp/ frontend/dist/ logs/ data/ i18n/
# USER juicer
# EXPOSE 3000
# CMD ["npm", "start"]

FROM imiell/bad-dockerfile:latest

COPY README.md .

FROM node:12-alpine
ARG BUILD_DATE
ARG VCS_REF
LABEL maintainer="Bjoern Kimminich <[email protected]>" \
org.opencontainers.image.title="OWASP Juice Shop" \
org.opencontainers.image.description="Probably the most modern and sophisticated insecure web application" \
org.opencontainers.image.authors="Bjoern Kimminich <[email protected]>" \
org.opencontainers.image.vendor="Open Web Application Security Project" \
org.opencontainers.image.documentation="https://help.owasp-juice.shop" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.version="11.1.3" \
org.opencontainers.image.url="https://owasp-juice.shop" \
org.opencontainers.image.source="https://github.com/bkimminich/juice-shop" \
org.opencontainers.image.revision=$VCS_REF \
org.opencontainers.image.created=$BUILD_DATE
WORKDIR /juice-shop
RUN addgroup juicer && \
adduser -D -G juicer juicer
COPY --from=installer --chown=juicer /juice-shop .
RUN mkdir logs && \
chown -R juicer logs && \
chgrp -R 0 ftp/ frontend/dist/ logs/ data/ i18n/ && \
chmod -R g=u ftp/ frontend/dist/ logs/ data/ i18n/
USER juicer
EXPOSE 3000
CMD ["npm", "start"]