From 73046a56d7a283ef994d016e1c9757c407fc0aaa Mon Sep 17 00:00:00 2001 From: nilozjr Date: Tue, 28 Mar 2023 15:30:06 -0400 Subject: [PATCH 01/28] docker* --- src/Dockerfile | 7 +++++++ src/docker-compose.yaml | 7 +++++++ 2 files changed, 14 insertions(+) create mode 100644 src/Dockerfile create mode 100644 src/docker-compose.yaml diff --git a/src/Dockerfile b/src/Dockerfile new file mode 100644 index 00000000..57eae1c7 --- /dev/null +++ b/src/Dockerfile @@ -0,0 +1,7 @@ +FROM node:latest +WORKDIR /app +COPY package*.json ./ +RUN npm install +copy . . +EXPOSE 8080 +CMD ["node", "server.js"] \ No newline at end of file diff --git a/src/docker-compose.yaml b/src/docker-compose.yaml new file mode 100644 index 00000000..3a82224c --- /dev/null +++ b/src/docker-compose.yaml @@ -0,0 +1,7 @@ +version: '3.7' +services: + kube-news: + image: nilozjr/conversor-temp:latest + container_name: kubenews + ports: + - "8080:8080" \ No newline at end of file From 238b64bd6c42656bcefd1df347f51199a28452fe Mon Sep 17 00:00:00 2001 From: nilozjr <123497921+nilozjr@users.noreply.github.com> Date: Tue, 28 Mar 2023 15:35:25 -0400 Subject: [PATCH 02/28] Create main.yml --- .github/workflows/main.yml | 50 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..84864f32 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,50 @@ +name: CI-CD + +on: +# workflow_dispatch: + push: + branches: ["main"] + +jobs: + CI: + runs-on: windows + + steps: + - uses: actions/checkout@v3.4.0 + - name: Autenticar no dokcer hub + uses: docker/login-action@v2.1.0 + with: + username: ${{ secrets.DOCKERHUB_USER }} + password: ${{ secrets.DOCKERHUB_PWD }} + - name: Contruindo imagem Docker + uses: docker/build-push-action@v4.0.0 + with: + context: ./src + file: ./src/Dockerfile + push: true + tags: | + nilozjr/teste-kube-news:${{github.run_number}} + nilozjr/teste-kube-news:latest + - name: Upload do artefato + uses: actions/upload-artifact@v3.1.2 + with: + name: src + path: ./src/* + - name: Download a Build Artifact + uses: actions/download-artifact@v2.1.1 + with: + name: src + path: C:\Users\Olin\src + + CD: + runs-on: windows + needs: CI + environment: + name: homol + url: 'https://www.cassems.com.br' + steps: + - name: deploy + run: | + cd C:\Users\Olin\src + docker compose down + docker compose up -d From ef3d6450e65677fc2a35144d91735ac5689027f4 Mon Sep 17 00:00:00 2001 From: nilozjr <123497921+nilozjr@users.noreply.github.com> Date: Tue, 28 Mar 2023 15:56:35 -0400 Subject: [PATCH 03/28] Update main.yml --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 84864f32..36771c27 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,8 +14,8 @@ jobs: - name: Autenticar no dokcer hub uses: docker/login-action@v2.1.0 with: - username: ${{ secrets.DOCKERHUB_USER }} - password: ${{ secrets.DOCKERHUB_PWD }} + username: ${{ secrets.DOCKERHUB_USUARIO }} + password: ${{ secrets.DOCKERHUB_PASS }} - name: Contruindo imagem Docker uses: docker/build-push-action@v4.0.0 with: From 737a1d6b425ba90419a7cc7d9340483fb7f9ca8b Mon Sep 17 00:00:00 2001 From: nilozjr <123497921+nilozjr@users.noreply.github.com> Date: Tue, 28 Mar 2023 16:00:51 -0400 Subject: [PATCH 04/28] Update main.yml --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 36771c27..d4ea5655 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,8 +23,8 @@ jobs: file: ./src/Dockerfile push: true tags: | - nilozjr/teste-kube-news:${{github.run_number}} - nilozjr/teste-kube-news:latest + nilozjr/conversor-temp-2023:${{github.run_number}} + nilozjr/conversor-temp-2023:latest - name: Upload do artefato uses: actions/upload-artifact@v3.1.2 with: From f9ae6813b593d592a8ad5db25de417824107574c Mon Sep 17 00:00:00 2001 From: nilozjr <123497921+nilozjr@users.noreply.github.com> Date: Tue, 28 Mar 2023 16:04:29 -0400 Subject: [PATCH 05/28] Update main.yml --- .github/workflows/main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d4ea5655..1ac78d15 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,8 +14,10 @@ jobs: - name: Autenticar no dokcer hub uses: docker/login-action@v2.1.0 with: - username: ${{ secrets.DOCKERHUB_USUARIO }} + username: ${{ secrets.DOCKERHUB_USUARIO}} password: ${{ secrets.DOCKERHUB_PASS }} + # username: ${{ secrets.DOCKERHUB_USUARIO }} + # password: ${{ secrets.DOCKERHUB_PASS }} - name: Contruindo imagem Docker uses: docker/build-push-action@v4.0.0 with: From 733807b8511c61728ed46c52887e02a94230a754 Mon Sep 17 00:00:00 2001 From: nilozjr <123497921+nilozjr@users.noreply.github.com> Date: Tue, 28 Mar 2023 16:07:18 -0400 Subject: [PATCH 06/28] Create CImain.yml --- .github/workflows/CImain.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/CImain.yml diff --git a/.github/workflows/CImain.yml b/.github/workflows/CImain.yml new file mode 100644 index 00000000..5e52043e --- /dev/null +++ b/.github/workflows/CImain.yml @@ -0,0 +1,18 @@ +name: CI-CD + +on: +# workflow_dispatch: + push: + branches: ["main"] + +jobs: + CI: + runs-on: windows + + steps: + - uses: actions/checkout@v3.4.0 + - name: Autenticar no dokcer hub + uses: docker/login-action@v2.1.0 + with: + username: ${{ secrets.DOCKERHUB_USER }} + password: ${{ secrets.DOCKERHUB_PASS }} From 70e950821836c479c896cf339d7bb6063e1cf836 Mon Sep 17 00:00:00 2001 From: nilozjr <123497921+nilozjr@users.noreply.github.com> Date: Tue, 28 Mar 2023 16:08:03 -0400 Subject: [PATCH 07/28] Update CImain.yml --- .github/workflows/CImain.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CImain.yml b/.github/workflows/CImain.yml index 5e52043e..44b64e6c 100644 --- a/.github/workflows/CImain.yml +++ b/.github/workflows/CImain.yml @@ -1,4 +1,4 @@ -name: CI-CD +name: CI on: # workflow_dispatch: From 5298b0aa4b658fd70eeb16c2f0436cfa3c6bab4f Mon Sep 17 00:00:00 2001 From: nilozjr <123497921+nilozjr@users.noreply.github.com> Date: Tue, 28 Mar 2023 16:10:19 -0400 Subject: [PATCH 08/28] Update CImain.yml --- .github/workflows/CImain.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/CImain.yml b/.github/workflows/CImain.yml index 44b64e6c..309de093 100644 --- a/.github/workflows/CImain.yml +++ b/.github/workflows/CImain.yml @@ -16,3 +16,12 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USER }} password: ${{ secrets.DOCKERHUB_PASS }} + - name: Contruindo imagem Docker + uses: docker/build-push-action@v4.0.0 + with: + context: ./src + file: ./src/Dockerfile + push: true + tags: | + nilozjr/conversor-temp-2023:${{github.run_number}} + nilozjr/conversor-temp-2023:latest From 282a3137b00f933f894743ad90f193878aed92d5 Mon Sep 17 00:00:00 2001 From: nilozjr Date: Tue, 28 Mar 2023 16:15:36 -0400 Subject: [PATCH 09/28] docker* --- src/docker-compose.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/docker-compose.yaml b/src/docker-compose.yaml index 3a82224c..1d4bbb08 100644 --- a/src/docker-compose.yaml +++ b/src/docker-compose.yaml @@ -1,7 +1,7 @@ version: '3.7' services: kube-news: - image: nilozjr/conversor-temp:latest + image: nilozjr/conversor-temp-2023:latest container_name: kubenews ports: - "8080:8080" \ No newline at end of file From 6ba0e8489454ad7613074b3157a65ca459de68bc Mon Sep 17 00:00:00 2001 From: nilozjr <123497921+nilozjr@users.noreply.github.com> Date: Tue, 28 Mar 2023 16:16:33 -0400 Subject: [PATCH 10/28] Update CImain.yml --- .github/workflows/CImain.yml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CImain.yml b/.github/workflows/CImain.yml index 309de093..2539ee9d 100644 --- a/.github/workflows/CImain.yml +++ b/.github/workflows/CImain.yml @@ -24,4 +24,27 @@ jobs: push: true tags: | nilozjr/conversor-temp-2023:${{github.run_number}} - nilozjr/conversor-temp-2023:latest + nilozjr/conversor-temp-2023:latest + - name: Upload do artefato + uses: actions/upload-artifact@v3.1.2 + with: + name: src + path: ./src/* + - name: Download a Build Artifact + uses: actions/download-artifact@v2.1.1 + with: + name: src + path: C:\Users\Olin\src + + CD: + runs-on: windows + needs: CI + environment: + name: homol + url: 'https://www.cassems.com.br' + steps: + - name: deploy + run: | + cd C:\Users\Olin\src + docker compose down + docker compose up -d From 8735a86a18e91629fbb7b490913dac17b76f3d02 Mon Sep 17 00:00:00 2001 From: nilozjr <123497921+nilozjr@users.noreply.github.com> Date: Tue, 28 Mar 2023 16:17:49 -0400 Subject: [PATCH 11/28] Update main.yml --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1ac78d15..3010a7b3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,9 +1,9 @@ name: CI-CD on: -# workflow_dispatch: - push: - branches: ["main"] + workflow_dispatch: +# push: +# branches: ["main"] jobs: CI: From a56dae1ac5bf6756b0c3db73d7ee9ff02522545e Mon Sep 17 00:00:00 2001 From: nilozjr <123497921+nilozjr@users.noreply.github.com> Date: Tue, 28 Mar 2023 16:29:31 -0400 Subject: [PATCH 12/28] Update CImain.yml --- .github/workflows/CImain.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CImain.yml b/.github/workflows/CImain.yml index 2539ee9d..5acdecd1 100644 --- a/.github/workflows/CImain.yml +++ b/.github/workflows/CImain.yml @@ -1,4 +1,4 @@ -name: CI +name: CI/ on: # workflow_dispatch: From 2fc516736ca09f9b1db5a4a575fa4ba914524747 Mon Sep 17 00:00:00 2001 From: nilozjr Date: Tue, 28 Mar 2023 16:40:36 -0400 Subject: [PATCH 13/28] alterando pagina --- src/views/index.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/index.ejs b/src/views/index.ejs index d955e3d9..712c8add 100644 --- a/src/views/index.ejs +++ b/src/views/index.ejs @@ -71,7 +71,7 @@
-

Conversor de Temperatura

+

Conversor de Temperatura - ALTERADO 28/02/2023 | 16:40

From 1cbd583a5ec7adf65349851cf88f01386516e0b2 Mon Sep 17 00:00:00 2001 From: nilozjr Date: Thu, 30 Mar 2023 14:27:41 -0400 Subject: [PATCH 27/28] teste dia 14 --- src/views/index.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/index.ejs b/src/views/index.ejs index 046863ef..9414b6c1 100644 --- a/src/views/index.ejs +++ b/src/views/index.ejs @@ -71,7 +71,7 @@
-

Conversor de Temperatura - ALTERADO 30/03/2023 | 13:40

+

Conversor de Temperatura - ALTERADO 30/03/2023 | 14:30