Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dc098626e0 |
+20
-29
@@ -1,33 +1,24 @@
|
|||||||
stages:
|
build-job:
|
||||||
- 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
|
stage: build
|
||||||
image: docker:19.03.12
|
|
||||||
script:
|
script:
|
||||||
- docker build -t $CI_REGISTRY_IMAGE/my-container:latest .
|
- echo "Hello, $GITLAB_USER_LOGIN!"
|
||||||
- docker tag $CI_REGISTRY_IMAGE/my-container:latest $CI_REGISTRY_IMAGE/my-container:$CI_COMMIT_SHORT_SHA
|
|
||||||
|
|
||||||
push_container:
|
test-job1:
|
||||||
stage: push
|
stage: test
|
||||||
image: docker:19.03.12
|
|
||||||
script:
|
script:
|
||||||
- echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" --password-stdin $CI_REGISTRY
|
- echo "This job tests something"
|
||||||
- docker push $CI_REGISTRY_IMAGE/my-container:latest
|
|
||||||
- docker push $CI_REGISTRY_IMAGE/my-container:$CI_COMMIT_#
|
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
|
||||||
|
|
||||||
|
|||||||
-22
@@ -1,22 +0,0 @@
|
|||||||
#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;"]
|
|
||||||
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
{
|
|
||||||
"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"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
{
|
|
||||||
"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