Skip to content

Commit cad19fe

Browse files
Merge pull request #36 from IFRCGo/staging
Staging
2 parents de24291 + a7e94f6 commit cad19fe

6 files changed

Lines changed: 95 additions & 91 deletions

File tree

.github/workflows/production-pipeline.yml

Lines changed: 43 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,47 @@ name: Production pipeline
22

33
on:
44
workflow_dispatch: # Allows manual execution
5-
65
jobs:
7-
build-and-deploy:
8-
runs-on: ubuntu-latest
9-
steps:
10-
- name: 'Checkout GitHub Action'
11-
uses: actions/checkout@main
12-
13-
- name: 'Login via Azure CLI'
14-
uses: azure/login@v1
15-
with:
16-
creds: ${{ secrets.AZURE_CREDENTIALS }}
17-
18-
- name: 'Set up Kubernetes'
19-
uses: azure/aks-set-context@v2
20-
with:
21-
creds: ${{ secrets.AZURE_CREDENTIALS }}
22-
cluster-name: ${{ secrets.AKS_CLUSTER_NAME }}
23-
resource-group: ${{ secrets.AKS_RESOURCE_GROUP }}
24-
25-
- name: 'Build and push image'
26-
uses: azure/docker-login@v1
27-
with:
28-
login-server: ${{ secrets.REGISTRY_LOGIN_SERVER }}
29-
username: ${{ secrets.REGISTRY_USERNAME }}
30-
password: ${{ secrets.REGISTRY_PASSWORD }}
31-
- run: |
32-
docker build -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi:${{ github.sha }} -f ./docker/Dockerfile .
33-
docker tag ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi:${{ github.sha }} ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi:latest
34-
35-
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi:${{ github.sha }}
36-
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi:latest
37-
- name: 'Copy production values files'
38-
run: |
39-
cp ./helm-chart/values-production.yaml ./helm-chart/values.yaml
40-
41-
- name: 'Deploy to AKS with Helm'
42-
run: |
43-
helm upgrade --install whatnow ./helm-chart \
44-
--namespace ${{ secrets.AKS_CLUSTER_NAMESPACE }} \
45-
--create-namespace
46-
47-
6+
build-and-deploy:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: 'Checkout GitHub Action'
10+
uses: actions/checkout@main
11+
12+
- name: 'Login via Azure CLI'
13+
uses: azure/login@v1
14+
with:
15+
creds: ${{ secrets.AZURE_CREDENTIALS }}
16+
17+
- name: 'Set up Kubernetes'
18+
uses: azure/aks-set-context@v2
19+
with:
20+
creds: ${{ secrets.AZURE_CREDENTIALS }}
21+
cluster-name: ${{ secrets.AKS_CLUSTER_NAME }}
22+
resource-group: ${{ secrets.AKS_RESOURCE_GROUP }}
23+
24+
- name: 'Build and push image'
25+
uses: azure/docker-login@v1
26+
with:
27+
login-server: ${{ secrets.REGISTRY_LOGIN_SERVER }}
28+
username: ${{ secrets.REGISTRY_USERNAME }}
29+
password: ${{ secrets.REGISTRY_PASSWORD }}
30+
- run: |
31+
if [ ! -f .env ]; then
32+
touch .env
33+
fi
34+
cp swagger.prod .env
35+
docker build -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi-qa:${{ github.sha }} -f ./docker/Dockerfile .
36+
docker tag ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi-qa:${{ github.sha }} ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi-qa:latest
37+
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi-qa:${{ github.sha }}
38+
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi-qa:latest
39+
40+
- name: 'Copy staging values file'
41+
run: |
42+
cp ./helm-chart/values-production.yaml ./helm-chart/values.yaml
43+
44+
- name: 'Deploy to AKS with Helm'
45+
run: |
46+
helm upgrade --install whatnow-qa ./helm-chart \
47+
--namespace ${{ secrets.AKS_CLUSTER_NAMESPACE_QA }} \
48+
--create-namespace

.github/workflows/qa-pipeline.yml

Lines changed: 48 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,54 @@
11
name: Stage pipeline
22

33
on:
4-
pull_request:
5-
types:
6-
- closed
7-
branches:
8-
- 'staging'
4+
pull_request:
5+
types:
6+
- closed
7+
branches:
8+
- 'staging'
99

1010

1111
jobs:
12-
build-and-deploy:
13-
runs-on: ubuntu-latest
14-
steps:
15-
- name: 'Checkout GitHub Action'
16-
uses: actions/checkout@main
17-
18-
- name: 'Login via Azure CLI'
19-
uses: azure/login@v1
20-
with:
21-
creds: ${{ secrets.AZURE_CREDENTIALS }}
22-
23-
- name: 'Set up Kubernetes'
24-
uses: azure/aks-set-context@v2
25-
with:
26-
creds: ${{ secrets.AZURE_CREDENTIALS }}
27-
cluster-name: ${{ secrets.AKS_CLUSTER_NAME }}
28-
resource-group: ${{ secrets.AKS_RESOURCE_GROUP }}
29-
30-
- name: 'Build and push image'
31-
uses: azure/docker-login@v1
32-
with:
33-
login-server: ${{ secrets.REGISTRY_LOGIN_SERVER }}
34-
username: ${{ secrets.REGISTRY_USERNAME }}
35-
password: ${{ secrets.REGISTRY_PASSWORD }}
36-
- run: |
37-
docker build -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi-qa:${{ github.sha }} -f ./docker/Dockerfile .
38-
docker tag ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi-qa:${{ github.sha }} ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi-qa:latest
39-
40-
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi-qa:${{ github.sha }}
41-
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi-qa:latest
42-
43-
- name: 'Copy staging values file'
44-
run: |
45-
cp ./helm-chart/values-staging.yaml ./helm-chart/values.yaml
46-
47-
- name: 'Deploy to AKS with Helm'
48-
run: |
49-
helm upgrade --install whatnow-qa ./helm-chart \
50-
--namespace ${{ secrets.AKS_CLUSTER_NAMESPACE_QA }} \
51-
--create-namespace
52-
53-
12+
build-and-deploy:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: 'Checkout GitHub Action'
16+
uses: actions/checkout@main
17+
18+
- name: 'Login via Azure CLI'
19+
uses: azure/login@v1
20+
with:
21+
creds: ${{ secrets.AZURE_CREDENTIALS }}
22+
23+
- name: 'Set up Kubernetes'
24+
uses: azure/aks-set-context@v2
25+
with:
26+
creds: ${{ secrets.AZURE_CREDENTIALS }}
27+
cluster-name: ${{ secrets.AKS_CLUSTER_NAME }}
28+
resource-group: ${{ secrets.AKS_RESOURCE_GROUP }}
29+
30+
- name: 'Build and push image'
31+
uses: azure/docker-login@v1
32+
with:
33+
login-server: ${{ secrets.REGISTRY_LOGIN_SERVER }}
34+
username: ${{ secrets.REGISTRY_USERNAME }}
35+
password: ${{ secrets.REGISTRY_PASSWORD }}
36+
- run: |
37+
if [ ! -f .env ]; then
38+
touch .env
39+
fi
40+
cp swagger.qa .env
41+
docker build -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi-qa:${{ github.sha }} -f ./docker/Dockerfile .
42+
docker tag ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi-qa:${{ github.sha }} ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi-qa:latest
43+
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi-qa:${{ github.sha }}
44+
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnowapi-qa:latest
45+
46+
- name: 'Copy staging values file'
47+
run: |
48+
cp ./helm-chart/values-staging.yaml ./helm-chart/values.yaml
49+
50+
- name: 'Deploy to AKS with Helm'
51+
run: |
52+
helm upgrade --install whatnow-qa ./helm-chart \
53+
--namespace ${{ secrets.AKS_CLUSTER_NAMESPACE_QA }} \
54+
--create-namespace

REDME.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ php artisan serve --port=8001
9090

9191
2. Dirígete al archivo `.env` y ajusta las siguientes configuraciones para conectar correctamente la API y el backoffice:
9292

93-
```dotenv
93+
```dotenv
9494
RCN_API_VERSION=v1
9595
RCN_API_URL=http://127.0.0.1:8001
9696
RCN_API_USER=admin

config/l5-swagger.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@
252252
* Constants which can be used in annotations
253253
*/
254254
'constants' => [
255-
'L5_SWAGGER_CONST_HOST' => env('APP_URL', 'https://api-preparemessages-stage.ifrc.org') . '/v2',
255+
'L5_SWAGGER_CONST_HOST' => env('SWAGGER_URL', null) . '/v2',
256256
],
257257
],
258258
];

swagger.prod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SWAGGER_URL=https://preparemessages.ifrc.org

swagger.qa

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SWAGGER_URL=https://preparemessages-stage.ifrc.org

0 commit comments

Comments
 (0)