Compare commits
20
Commits
main
...
feature/ci-cd
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e3b1bfec25 | ||
|
|
8600b9dabc | ||
|
|
ff7e86b602 | ||
|
|
81146eefb6 | ||
|
|
1d76eca96c | ||
|
|
2d8542475b | ||
|
|
b6eb3e37b6 | ||
|
|
bad2619deb | ||
|
|
61efc501f6 | ||
|
|
b5d5041103 | ||
|
|
a753eda2f9 | ||
|
|
a17c4d6464 | ||
|
|
ff649de3d2 | ||
|
|
7607d2ade6 | ||
|
|
ec987885aa | ||
|
|
f79c1a4332 | ||
|
|
9dade06d0a | ||
|
|
3c1c1ee58c | ||
|
|
7496c17cec | ||
|
|
4f3f6a8e4a |
+29
-20
@@ -1,24 +1,33 @@
|
||||
build-job:
|
||||
stages:
|
||||
- build
|
||||
- push
|
||||
|
||||
variables:
|
||||
DOCKER_DRIVER: overlay2
|
||||
DOCKER_TLS_CERTDIR: ""
|
||||
DOCKER_HOST: tcp://docker:2375/
|
||||
DOCKER_USERNAME: serjiomarello
|
||||
DOCKER_PASSWORD: TaReMona225657
|
||||
|
||||
services:
|
||||
- name: docker:dind
|
||||
command: ["--privileged"]
|
||||
|
||||
before_script:
|
||||
- docker info
|
||||
|
||||
|
||||
build_container:
|
||||
stage: build
|
||||
image: docker:19.03.12
|
||||
script:
|
||||
- echo "Hello, $GITLAB_USER_LOGIN!"
|
||||
- docker build -t $CI_REGISTRY_IMAGE/my-container:latest .
|
||||
- docker tag $CI_REGISTRY_IMAGE/my-container:latest $CI_REGISTRY_IMAGE/my-container:$CI_COMMIT_SHORT_SHA
|
||||
|
||||
test-job1:
|
||||
stage: test
|
||||
push_container:
|
||||
stage: push
|
||||
image: docker:19.03.12
|
||||
script:
|
||||
- echo "This job tests something"
|
||||
|
||||
test-job2:
|
||||
stage: test
|
||||
script:
|
||||
- echo "This job tests something, but takes more time than test-job1."
|
||||
- echo "After the echo commands complete, it runs the sleep command for 20 seconds"
|
||||
- echo "which simulates a test that runs 20 seconds longer than test-job1"
|
||||
- sleep 20
|
||||
|
||||
deploy-prod:
|
||||
stage: deploy
|
||||
script:
|
||||
- echo "This job deploys something from the $CI_COMMIT_BRANCH branch."
|
||||
environment: production
|
||||
|
||||
- echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" --password-stdin $CI_REGISTRY
|
||||
- docker push $CI_REGISTRY_IMAGE/my-container:latest
|
||||
- docker push $CI_REGISTRY_IMAGE/my-container:$CI_COMMIT_#
|
||||
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
#Front
|
||||
FROM node:18-slim
|
||||
WORKDIR /usr/local/app
|
||||
COPY notes-app/package*.json ./
|
||||
RUN npm i && npm cache clean --force
|
||||
COPY notes-app/ .
|
||||
RUN npm run build
|
||||
#Backend
|
||||
FROM node:18-slim
|
||||
WORKDIR /usr/local/app
|
||||
COPY notes-backend/package*.json ./
|
||||
RUN npm i && npm cache clean --force
|
||||
COPY notes-backend/ .
|
||||
RUN npm run build
|
||||
#nginx
|
||||
FROM nginx:alpine
|
||||
COPY nginx/default.conf /etc/nginx/conf.d/default.conf
|
||||
COPY --from=build-react /app/build /usr/share/nginx/html
|
||||
COPY --from=build-node /app/dist /usr/share/nginx/html/api
|
||||
EXPOSE 80
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"env": {
|
||||
"browser": true,
|
||||
"es2021": true
|
||||
},
|
||||
"extends": ["eslint:recommended", "plugin:react/recommended"],
|
||||
"parserOptions": {
|
||||
"ecmaFeatures": {
|
||||
"jsx": true
|
||||
},
|
||||
"ecmaVersion": 12,
|
||||
"sourceType": "module"
|
||||
},
|
||||
"plugins": ["react"],
|
||||
"rules": {
|
||||
"react/prop-types": "off"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"env": {
|
||||
"browser": true,
|
||||
"es2021": true
|
||||
},
|
||||
"extends": ["eslint:recommended", "plugin:react/recommended"],
|
||||
"parserOptions": {
|
||||
"ecmaFeatures": {
|
||||
"jsx": true
|
||||
},
|
||||
"ecmaVersion": 12,
|
||||
"sourceType": "module"
|
||||
},
|
||||
"plugins": ["react"],
|
||||
"rules": {
|
||||
"react/prop-types": "off"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user