From 3c07cd9b414e8cf747028450a7e4c2b4de7e7cfd Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 15 Jan 2025 11:13:51 +0000 Subject: [PATCH 1/2] Update dependency pg to '~> 1.5.0' --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 98ffae3..ef15310 100644 --- a/Gemfile +++ b/Gemfile @@ -6,7 +6,7 @@ gem 'simpleidn', '~> 0.2.1' # For punycode # database gem 'activerecord', '~> 7.0' -gem 'pg', '~> 1.4.0' +gem 'pg', '~> 1.5.0' gem 'daemons', '~> 1.4.1' gem 'dotenv' diff --git a/Gemfile.lock b/Gemfile.lock index 2054bd9..a136e0d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -30,7 +30,7 @@ GEM parallel (1.20.1) parser (3.0.2.0) ast (~> 2.4.1) - pg (1.4.0) + pg (1.5.9) pry (0.14.1) coderay (~> 1.1) method_source (~> 1.0) @@ -74,7 +74,7 @@ DEPENDENCIES eventmachine (~> 1.2.7) mina (~> 1.2.4) minitest - pg (~> 1.4.0) + pg (~> 1.5.0) pry (~> 0.14.1) rubocop simplecov (= 0.17.1) From 95699db974994f8eb5f0f4491382431e5252ace1 Mon Sep 17 00:00:00 2001 From: oleghasjanov Date: Wed, 15 Jan 2025 13:27:58 +0200 Subject: [PATCH 2/2] removed unnecessary steps from ci cd --- .github/workflows/build_deploy_staging.yml | 136 --------------------- .github/workflows/remove_st_after_pr.yml | 84 ------------- 2 files changed, 220 deletions(-) delete mode 100644 .github/workflows/build_deploy_staging.yml delete mode 100644 .github/workflows/remove_st_after_pr.yml diff --git a/.github/workflows/build_deploy_staging.yml b/.github/workflows/build_deploy_staging.yml deleted file mode 100644 index 2fd9574..0000000 --- a/.github/workflows/build_deploy_staging.yml +++ /dev/null @@ -1,136 +0,0 @@ -name: build and deploy staging - -on: - pull_request: - paths-ignore: - - '**.md' - branches: [master] - types: - - opened - - reopened - - synchronize - - ready_for_review - - unlocked - -jobs: - - build_and_test: - - if: github.event.pull_request.draft == false - - runs-on: ubuntu-20.04 - - steps: - - - uses: actions/checkout@v4 - - - name: Login to container registry - env: - PASSWORD: ${{ secrets.GHCR }} - run: | - echo $PASSWORD | docker login ghcr.io -u eisbot --password-stdin - - - name: Set image tag - run: | - SHORT_SHA=$(echo $GITHUB_SHA | cut -c 1-7) - echo "TAG=ghcr.io/internetee/whois:RC-$SHORT_SHA" >> $GITHUB_ENV - echo "SHORT_TAG=RC-$SHORT_SHA" >> $GITHUB_ENV - - - name: Get pull request reference number - run: | - echo "$GITHUB_REF" - echo "PR_REF=$(cat /home/runner/work/_temp/_github_workflow/event.json | jq -r '.number')" >> $GITHUB_ENV - - - name: Build image - run: | - docker build -t $TAG -f Dockerfile.generic . - - - name: Push Docker image to gh container registry - env: - PASSWORD: ${{ secrets.GHCR }} - run: | - echo $PASSWORD | docker login ghcr.io -u eisbot --password-stdin - docker push $TAG - - # - name: Set image tag - # run: | - # SHORT_SHA=$(git describe --always) - # echo "RC_$SHORT_SHA" > TAG - - # - name: Upgrade whois in whois-testing - # env: - # K_CONFIG: ${{ secrets.KUBE_CONFIG }} - # run: | - # echo $K_CONFIG | base64 -di > kubeconfig - # export KUBECONFIG=./kubeconfig - # helm upgrade --install whois --set "image.tag=$(cat TAG)" charts --namespace=whois-testing - - - name: Get repo name - run: | - OIFS=$IFS - IFS='/' - read -a parts <<< "$GITHUB_REPOSITORY" - IFS=OIFS - echo "REPO=${parts[1]}" >> $GITHUB_ENV - - - name: Set deploy config - env: - OVPN: ${{ secrets.OVPN }} - VPN_PWD: ${{ secrets.VPN_PWD }} - P12: ${{ secrets.P12_2022 }} - K_CONFIG: ${{ secrets.KUBE_CONFIG }} - SSH_KEY: ${{ secrets.EISBOT_SSH_KEY }} - EPPROXY_CONF: ${{ secrets.EPPROXY_CONF }} - run: | - echo $VPN_PWD | base64 -di > client.pwd - chmod 0600 client.pwd - echo $OVPN | base64 -di > config.ovpn - echo $P12 | base64 -di > cert.p12 - mkdir -p ~/.ssh - echo $SSH_KEY | base64 -di > ~/.ssh/key - chmod 0600 ~/.ssh/key - mkdir -p $REPO/$PR_REF - cd $REPO/$PR_REF - echo "$SHORT_SHA" > TAG - echo $K_CONFIG | base64 -di > kubeconfig - chmod 0600 kubeconfig - - - name: Install Open VPN - run: sudo apt-get install openvpn - - - name: Deploy from remote server - timeout-minutes: 5 - env: - TOKEN: ${{ secrets.CLOUD_TOKEN }} - run: | - sudo openvpn --config config.ovpn --askpass client.pwd --auth-nocache --daemon& - sleep 15 - ping -c 1 192.168.99.12 - eval `ssh-agent` - touch ~/.ssh/known_hosts - ssh-add ~/.ssh/key - ssh-keyscan 192.168.99.12 > ~/.ssh/known_hosts - rsync -av "$REPO" runner@192.168.99.12:/home/runner/ - ssh -T runner@192.168.99.12 << EOSSH - bash - cd "$REPO"/"$PR_REF" - export KUBECONFIG=./kubeconfig - helm repo add eisrepo https://internetee.github.io/helm-charts/ - helm repo update - helm upgrade --install whois-"$PR_REF" --set "image.tag=$SHORT_TAG" eisrepo/whois -n whois - TOKEN=${{ secrets.CLOUD_TOKEN }} python3 ../../portOpener.py "$PR_REF" add whois - cd ../.. - rm -r "$REPO" - - - name: Notify developers - timeout-minutes: 1 - env: - NOTIFICATION_URL: ${{ secrets.NOTIFICATION_URL}} - run: | - curl -i -X POST --data-urlencode 'payload={ - "text": "\n# WHOIS:\n ##### pr from ['${{ github.head_ref }}'](https://github.com/internetee/whois/pull/'$PR_REF') to master has been deployed :tada:\n - ``` - whois -h riigi.pilv.tld.ee -p '$PR_REF' - ``` - " - }' $NOTIFICATION_URL diff --git a/.github/workflows/remove_st_after_pr.yml b/.github/workflows/remove_st_after_pr.yml deleted file mode 100644 index ae0b6ec..0000000 --- a/.github/workflows/remove_st_after_pr.yml +++ /dev/null @@ -1,84 +0,0 @@ -name: remove-staging-after-pull-request - -on: - pull_request: - types: [closed, converted_to_draft, locked] - paths-ignore: - - '**.md' - -jobs: - delete: - - runs-on: ubuntu-20.04 - - steps: - - - uses: actions/checkout@v4 - - - name: Get pull request reference number - run: | - echo "$GITHUB_REF" - echo "PR_REF=$(cat /home/runner/work/_temp/_github_workflow/event.json | jq -r '.number')" >> $GITHUB_ENV - echo $(cat /home/runner/work/_temp/_github_workflow/event.json | jq -r '.number') - - - name: Get repo name - run: | - OIFS=$IFS - IFS='/' - read -a parts <<< "$GITHUB_REPOSITORY" - IFS=OIFS - echo "REPO=${parts[1]}" >> $GITHUB_ENV - - - name: Set vpn config - env: - OVPN: ${{ secrets.OVPN }} - VPN_PWD: ${{ secrets.VPN_PWD }} - P12: ${{ secrets.P12_2022 }} - K_CONFIG: ${{ secrets.KUBE_CONFIG }} - SSH_KEY: ${{ secrets.EISBOT_SSH_KEY }} - run: | - echo $VPN_PWD | base64 -di > client.pwd - chmod 0600 client.pwd - echo $OVPN | base64 -di > config.ovpn - echo $P12 | base64 -di > cert.p12 - mkdir -p ~/.ssh - echo $SSH_KEY | base64 -di > ~/.ssh/key - chmod 0600 ~/.ssh/key - mkdir -p $REPO/$PR_REF - cd $REPO/$PR_REF - echo "$SHORT_SHA" > TAG - echo $K_CONFIG | base64 -di > kubeconfig - chmod 0600 kubeconfig - - - name: Install Open VPN - run: sudo apt-get install openvpn - - - name: Delete k8s - timeout-minutes: 2 - run: | - sudo openvpn --config config.ovpn --askpass client.pwd --auth-nocache --daemon& - sleep 25 - ping -c 2 192.168.99.12 - eval `ssh-agent` - touch ~/.ssh/known_hosts - ssh-add ~/.ssh/key - ssh-keyscan 192.168.99.12 > ~/.ssh/known_hosts - rsync -av "$REPO" runner@192.168.99.12:/home/runner/ - ssh -T runner@192.168.99.12 << EOSSH - bash - cd "$REPO"/"$PR_REF" - export KUBECONFIG=./kubeconfig - helm delete whois-"$PR_REF" -n whois - TOKEN=${{ secrets.CLOUD_TOKEN }} python3 ../../portOpener.py "$PR_REF" remove whois - cd ../.. - rm -r "$REPO" - - - name: Notify developers - timeout-minutes: 1 - env: - NOTIFICATION_URL: ${{ secrets.NOTIFICATION_URL}} - run: | - curl -i -X POST --data-urlencode 'payload={ - "text": "##### [Pull request](https://github.com/internetee/whois/pull/'$PR_REF') was probably succesful, at least, it is closed :bowtie:\n - " - }' $NOTIFICATION_URL