Skip to content

Commit da3cfdb

Browse files
fix: allow serverest.dev to use env stored on .env
1 parent 2f08b53 commit da3cfdb

File tree

5 files changed

+18
-25
lines changed

5 files changed

+18
-25
lines changed

.gcloudignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# .gcloudignore created to allow publish .env file, ignoring .gitignore configuration.

.github/workflows/common_ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
uses: actions/checkout@v3
5959
with:
6060
fetch-depth: 0
61-
- uses: wagoid/commitlint-github-action@v3
61+
- uses: wagoid/commitlint-github-action@v5
6262
with:
6363
helpURL: https://github.com/ServeRest/ServeRest/blob/trunk/.github/CONTRIBUTING.md
6464

.github/workflows/continuous_delivery.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,12 @@ jobs:
5050
node-version: 16
5151
- name: Installation of Node.js dependencies
5252
run: npm ci
53+
- name: Install 1Password CLI
54+
uses: 1password/install-cli-action@v1
55+
with:
56+
version: 2.18.0
5357
- name: Generate and fill .env file with secrets
54-
run: |
55-
# Install 1password CLI
56-
curl https://cache.agilebits.com/dist/1P/op2/pkg/v2.18.0/op_linux_amd64_v2.18.0.zip > op.zip
57-
unzip op.zip
58-
sudo mv op /usr/local/bin
59-
rm op.zip
60-
61-
# Generate .env file
62-
# Append secret MOESIF_APPLICATION_ID
63-
op read op://serverest-ci-cd/moesif/application_id | sed 's/^/MOESIF_APPLICATION_ID=/' >> .env
58+
run: op read op://serverest-ci-cd/moesif/application_id | sed 's/^/MOESIF_APPLICATION_ID=/' >> .env
6459
env:
6560
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
6661
- name: Load secrets from 1password

.github/workflows/deploy-online-serverest.yml

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,6 @@ jobs:
2323
runs-on: ubuntu-22.04
2424

2525
steps:
26-
- name: Generate and fill .env file with secrets
27-
run: |
28-
# Install 1password CLI
29-
curl https://cache.agilebits.com/dist/1P/op2/pkg/v2.18.0/op_linux_amd64_v2.18.0.zip > op.zip
30-
unzip op.zip
31-
sudo mv op /usr/local/bin
32-
rm op.zip
33-
34-
# Generate .env file
35-
# Append secret MOESIF_APPLICATION_ID
36-
op read op://serverest-ci-cd/moesif/application_id | sed 's/^/MOESIF_APPLICATION_ID=/' >> .env
37-
env:
38-
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
3926
- name: Load secrets from 1password
4027
uses: 1password/load-secrets-action@v1
4128
env:
@@ -52,6 +39,14 @@ jobs:
5239
env:
5340
GCP_IAM_SERVICE_ACCOUNT_KEY: ${{ env.GCP_IAM_SERVICE_ACCOUNT_KEY }}
5441
- run: gcloud config set project serverest
42+
- name: Install 1Password CLI
43+
uses: 1password/install-cli-action@v1
44+
with:
45+
version: 2.18.0
46+
- name: Generate and fill .env file with secrets
47+
run: op read op://serverest-ci-cd/moesif/application_id | sed 's/^/MOESIF_APPLICATION_ID=/' >> .env
48+
env:
49+
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
5550
- name: Build and deploy to Gcloud
5651
run: |
5752
gcloud builds submit . \
@@ -204,7 +199,7 @@ jobs:
204199
open-issue-production:
205200
name: Open issue when production smoke test fail
206201
needs: test-e2e-smoke-production
207-
if: failure()
202+
if: ${{ failure() && needs.test-e2e-smoke-production.result == 'failure' }}
208203

209204
runs-on: ubuntu-22.04
210205

@@ -265,6 +260,7 @@ jobs:
265260
if: ${{ always() && needs.rollback-get-previous-info.result == 'success' }}
266261

267262
runs-on: ubuntu-22.04
263+
environment: production
268264

269265
steps:
270266
- name: Load secrets from 1password

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# .npmignore created to allow publish .env file, ignoring .gitignore configuration.

0 commit comments

Comments
 (0)