From fc28d7820d0d1b4ff7716881d8f7611c58f34fd3 Mon Sep 17 00:00:00 2001 From: Yurii Kovalchuk Date: Mon, 4 Mar 2024 19:23:19 +0200 Subject: [PATCH] ATOR-173 - Fix after review --- .github/workflows/dev-deploy.yml | 14 +++++++------- .github/workflows/stage-deploy.yml | 4 ++++ docker/scanner/docker-entrypoint.sh | 10 ++++------ operations/deploy-dev.hcl | 11 +++-------- operations/deploy-stage.hcl | 5 ----- 5 files changed, 18 insertions(+), 26 deletions(-) diff --git a/.github/workflows/dev-deploy.yml b/.github/workflows/dev-deploy.yml index f32a0ac..09821d6 100644 --- a/.github/workflows/dev-deploy.yml +++ b/.github/workflows/dev-deploy.yml @@ -19,10 +19,10 @@ jobs: docker-username: ${{ secrets.DOCKER_HUB_USERNAME }} docker-password: ${{ secrets.DOCKER_HUB_PASSWORD }} docker-tag: latest-dev -# - name: Deploy -# uses: ./.github/actions/deploy -# with: -# environment: dev -# nomad-cacert: operations/admin-ui-ca.crt -# nomad-token: ${{ secrets.NOMAD_TOKEN_SBWS_DEPLOY }} -# nomad-addr: ${{ secrets.NOMAD_DEPLOY_ADDR }} + - name: Deploy + uses: ./.github/actions/deploy + with: + environment: dev + nomad-cacert: operations/admin-ui-ca.crt + nomad-token: ${{ secrets.NOMAD_TOKEN_SBWS_DEPLOY }} + nomad-addr: ${{ secrets.NOMAD_DEPLOY_ADDR }} diff --git a/.github/workflows/stage-deploy.yml b/.github/workflows/stage-deploy.yml index 8d55ade..22cb97c 100644 --- a/.github/workflows/stage-deploy.yml +++ b/.github/workflows/stage-deploy.yml @@ -1,6 +1,10 @@ name: Build and Push Docker Image on: + # temporary + pull_request: + branches: + - development push: branches: - main diff --git a/docker/scanner/docker-entrypoint.sh b/docker/scanner/docker-entrypoint.sh index d2ed7db..62ef8f6 100755 --- a/docker/scanner/docker-entrypoint.sh +++ b/docker/scanner/docker-entrypoint.sh @@ -1,8 +1,6 @@ -mkdir -p /app/scanner/data/logs +mkdir -p /root/.sbws/logs -crontab -l | { cat; echo "*/5 * * * * sbws generate >> /app/scanner/data/logs/generate.log 2>&1"; } | crontab - -crontab -l | { cat; echo "30 0 * * * sbws cleanup >> /app/scanner/data/logs/cleanup.log 2>&1"; } | crontab - +crontab -l | { cat; echo "*/5 * * * * /usr/local/bin/sbws -c /root/.sbws.ini generate >> /root/.sbws/logs/generate.log 2>&1"; } | crontab - +crontab -l | { cat; echo "30 0 * * * /usr/local/bin/sbws -c /root/.sbws.ini cleanup >> /root/.sbws/logs/cleanup.log 2>&1"; } | crontab - -cron -f - -#sbws scanner +sbws scanner diff --git a/operations/deploy-dev.hcl b/operations/deploy-dev.hcl index 87019d9..90d067c 100644 --- a/operations/deploy-dev.hcl +++ b/operations/deploy-dev.hcl @@ -20,10 +20,10 @@ job "sbws-dev" { } } - volume "dir-auth-dev" { + volume "sbws-dev" { type = "host" read_only = false - source = "dir-auth-dev" + source = "sbws-dev" } network { @@ -41,11 +41,6 @@ job "sbws-dev" { } } - ephemeral_disk { - migrate = true - sticky = true - } - task "sbws-relay-dev-task" { driver = "docker" @@ -99,7 +94,7 @@ LearnCircuitBuildTimeout 0 driver = "docker" volume_mount { - volume = "dir-auth-dev" + volume = "sbws-dev" destination = "/root/.sbws" read_only = false } diff --git a/operations/deploy-stage.hcl b/operations/deploy-stage.hcl index 0045f8b..fd05d96 100644 --- a/operations/deploy-stage.hcl +++ b/operations/deploy-stage.hcl @@ -41,11 +41,6 @@ job "sbws-stage" { } } - ephemeral_disk { - migrate = true - sticky = true - } - task "sbws-relay-stage-task" { driver = "docker"