From 9da4ce28065fea809fe6fc85d2f18c88bb675910 Mon Sep 17 00:00:00 2001 From: leandrofars Date: Sat, 13 Apr 2024 13:18:47 -0300 Subject: [PATCH] feat: circle ci release docker images --- .circleci/config.yml | 69 ++++++++++---------------------------------- 1 file changed, 16 insertions(+), 53 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c1d16c9..d06e67b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,59 +1,22 @@ version: 2.1 -executors: - nodejs: - docker: - - image: cimg/node:18.17.1 - golang: - docker: - - image: cimg/go:1.20.7 - jobs: - - build_and_deploy_controller: - executor: golang + release: + docker: + - image: cimg/base:2022.09 + auth: + username: $DOCKERHUB_USERNAME + password: $DOCKERHUB_PASSWORD steps: - checkout + - setup_remote_docker - run: - name: Build and Deploy Controller + name: Build and Push application Docker image command: | - cd backend/services/controller && go build -o controller cmd/oktopus/main.go - scp -o StrictHostKeyChecking=no controller $SSH_USER@$SSH_HOST:/home/$SSH_USER - ssh -o StrictHostKeyChecking=no $SSH_USER@$SSH_HOST "sudo mv controller /usr/bin/ && sudo systemctl restart controller" - - build_and_deploy_mochi: - executor: golang - steps: - - checkout - - run: - name: Build and Deploy Mochi - command: | - cd backend/services/mochi/ && go build -o mochi cmd/main.go - scp -o StrictHostKeyChecking=no mochi $SSH_USER@$SSH_HOST:/home/$SSH_USER - ssh -o StrictHostKeyChecking=no $SSH_USER@$SSH_HOST "sudo mv mochi /usr/bin/ && sudo systemctl restart mochi" - - build_and_deploy_frontend: - executor: nodejs - steps: - - checkout - - run: - name: Build and Deploy Frontend - command: | - cd frontend && npm i && npm run build - scp -o StrictHostKeyChecking=no -r .next/ $SSH_USER@$SSH_HOST:/home/$SSH_USER/oktopus/frontend - ssh -o StrictHostKeyChecking=no $SSH_USER@$SSH_HOST "pm2 restart oktopus" - -workflows: - build_and_deploy: - jobs: - - build_and_deploy_controller: - filters: - branches: - only: main - - build_and_deploy_mochi: - filters: - branches: - only: main - - build_and_deploy_frontend: - filters: - branches: - only: main \ No newline at end of file + cd build && make release +# workflows: +# build_and_deploy: +# jobs: +# - release: +# filters: +# branches: +# only: main \ No newline at end of file