Skip to content

Commit

Permalink
added envs to each workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
dtuchs committed Sep 27, 2023
1 parent d986890 commit 8b03f97
Show file tree
Hide file tree
Showing 18 changed files with 62 additions and 22 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/niffler-auth-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,16 @@ jobs:
steps:
- name: deploy
working-directory: ./
env:
VAULT_TOKEN: ${{ secrets.VAULT_TOKEN }}
PROFILE: prod
PREFIX: ${{ vars.DOCKER_HUB_ACC }}
FRONT_IMAGE: ${{ vars.DOCKER_HUB_ACC }}/niffler-frontend-prod:latest
run: |
pwd
docker login --username ${{ vars.DOCKER_HUB_ACC }} --password "${{ secrets.DOCKER_HUB_PASSWORD }}"
echo "VAULT_TOKEN=${{ secrets.VAULT_TOKEN }}" >> $GITHUB_ENV
bash ./docker-compose-ci.sh prod
FRONT_IMAGE=${{ vars.DOCKER_HUB_ACC }}/niffler-frontend-prod:latest PREFIX=${{ vars.DOCKER_HUB_ACC }} PROFILE=prod docker-compose -f docker-compose.ci.yml up -d --force-recreate auth.niffler.dc
docker-compose -f docker-compose.ci.yml up -d --force-recreate auth.niffler.dc
docker system prune -a -f
echo "done"
5 changes: 4 additions & 1 deletion .github/workflows/niffler-auth-staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@ jobs:
working-directory: ./
env:
VAULT_TOKEN: ${{ secrets.VAULT_TOKEN }}
PROFILE: staging
PREFIX: ${{ vars.DOCKER_HUB_ACC }}
FRONT_IMAGE: ${{ vars.DOCKER_HUB_ACC }}/niffler-frontend-staging:latest
run: |
pwd
docker login --username ${{ vars.DOCKER_HUB_ACC }} --password "${{ secrets.DOCKER_HUB_PASSWORD }}"
echo "VAULT_TOKEN=${{ secrets.VAULT_TOKEN }}" >> $GITHUB_ENV
bash ./docker-compose-ci.sh staging
FRONT_IMAGE=${{ vars.DOCKER_HUB_ACC }}/niffler-frontend-prod:staging PREFIX=${{ vars.DOCKER_HUB_ACC }} PROFILE=staging VAULT_TOKEN=${{ secrets.VAULT_TOKEN }} docker-compose -f docker-compose.ci.yml up -d --force-recreate auth.niffler.dc
docker-compose -f docker-compose.ci.yml up -d --force-recreate auth.niffler.dc
docker system prune -a -f
echo "done"
7 changes: 6 additions & 1 deletion .github/workflows/niffler-currency-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,15 @@ jobs:
steps:
- name: deploy
working-directory: ./
env:
VAULT_TOKEN: ${{ secrets.VAULT_TOKEN }}
PROFILE: prod
PREFIX: ${{ vars.DOCKER_HUB_ACC }}
FRONT_IMAGE: ${{ vars.DOCKER_HUB_ACC }}/niffler-frontend-prod:latest
run: |
pwd
docker login --username ${{ vars.DOCKER_HUB_ACC }} --password "${{ secrets.DOCKER_HUB_PASSWORD }}"
bash ./docker-compose-ci.sh prod
FRONT_IMAGE=${{ vars.DOCKER_HUB_ACC }}/niffler-frontend-prod:latest PREFIX=${{ vars.DOCKER_HUB_ACC }} PROFILE=prod docker-compose -f docker-compose.ci.yml up -d --force-recreate currency.niffler.dc
docker-compose -f docker-compose.ci.yml up -d --force-recreate currency.niffler.dc
docker system prune -a -f
echo "done"
5 changes: 4 additions & 1 deletion .github/workflows/niffler-currency-staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@ jobs:
working-directory: ./
env:
VAULT_TOKEN: ${{ secrets.VAULT_TOKEN }}
PROFILE: staging
PREFIX: ${{ vars.DOCKER_HUB_ACC }}
FRONT_IMAGE: ${{ vars.DOCKER_HUB_ACC }}/niffler-frontend-staging:latest
run: |
pwd
docker login --username ${{ vars.DOCKER_HUB_ACC }} --password "${{ secrets.DOCKER_HUB_PASSWORD }}"
echo "VAULT_TOKEN=${{ secrets.VAULT_TOKEN }}" >> $GITHUB_ENV
bash ./docker-compose-ci.sh staging
FRONT_IMAGE=${{ vars.DOCKER_HUB_ACC }}/niffler-frontend-staging:latest PREFIX=${{ vars.DOCKER_HUB_ACC }} PROFILE=staging docker-compose -f docker-compose.ci.yml up -d --force-recreate currency.niffler.dc
docker-compose -f docker-compose.ci.yml up -d --force-recreate currency.niffler.dc
docker system prune -a -f
echo "done"
7 changes: 6 additions & 1 deletion .github/workflows/niffler-gateway-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,15 @@ jobs:
steps:
- name: deploy
working-directory: ./
env:
VAULT_TOKEN: ${{ secrets.VAULT_TOKEN }}
PROFILE: prod
PREFIX: ${{ vars.DOCKER_HUB_ACC }}
FRONT_IMAGE: ${{ vars.DOCKER_HUB_ACC }}/niffler-frontend-prod:latest
run: |
pwd
docker login --username ${{ vars.DOCKER_HUB_ACC }} --password "${{ secrets.DOCKER_HUB_PASSWORD }}"
bash ./docker-compose-ci.sh prod
FRONT_IMAGE=${{ vars.DOCKER_HUB_ACC }}/niffler-frontend-prod:latest PREFIX=${{ vars.DOCKER_HUB_ACC }} PROFILE=prod docker-compose -f docker-compose.ci.yml up -d --force-recreate gateway.niffler.dc
docker-compose -f docker-compose.ci.yml up -d --force-recreate gateway.niffler.dc
docker system prune -a -f
echo "done"
5 changes: 4 additions & 1 deletion .github/workflows/niffler-gateway-staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@ jobs:
working-directory: ./
env:
VAULT_TOKEN: ${{ secrets.VAULT_TOKEN }}
PROFILE: staging
PREFIX: ${{ vars.DOCKER_HUB_ACC }}
FRONT_IMAGE: ${{ vars.DOCKER_HUB_ACC }}/niffler-frontend-staging:latest
run: |
pwd
docker login --username ${{ vars.DOCKER_HUB_ACC }} --password "${{ secrets.DOCKER_HUB_PASSWORD }}"
echo "VAULT_TOKEN=${{ secrets.VAULT_TOKEN }}" >> $GITHUB_ENV
bash ./docker-compose-ci.sh staging
FRONT_IMAGE=${{ vars.DOCKER_HUB_ACC }}/niffler-frontend-staging:latest PREFIX=${{ vars.DOCKER_HUB_ACC }} PROFILE=staging docker-compose -f docker-compose.ci.yml up -d --force-recreate gateway.niffler.dc
docker-compose -f docker-compose.ci.yml up -d --force-recreate gateway.niffler.dc
docker system prune -a -f
echo "done"
7 changes: 6 additions & 1 deletion .github/workflows/niffler-spend-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,15 @@ jobs:
steps:
- name: deploy
working-directory: ./
env:
VAULT_TOKEN: ${{ secrets.VAULT_TOKEN }}
PROFILE: prod
PREFIX: ${{ vars.DOCKER_HUB_ACC }}
FRONT_IMAGE: ${{ vars.DOCKER_HUB_ACC }}/niffler-frontend-prod:latest
run: |
pwd
docker login --username ${{ vars.DOCKER_HUB_ACC }} --password "${{ secrets.DOCKER_HUB_PASSWORD }}"
bash ./docker-compose-ci.sh prod
FRONT_IMAGE=${{ vars.DOCKER_HUB_ACC }}/niffler-frontend-prod:latest PREFIX=${{ vars.DOCKER_HUB_ACC }} PROFILE=prod docker-compose -f docker-compose.ci.yml up -d --force-recreate spend.niffler.dc
docker-compose -f docker-compose.ci.yml up -d --force-recreate spend.niffler.dc
docker system prune -a -f
echo "done"
5 changes: 4 additions & 1 deletion .github/workflows/niffler-spend-staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@ jobs:
working-directory: ./
env:
VAULT_TOKEN: ${{ secrets.VAULT_TOKEN }}
PROFILE: staging
PREFIX: ${{ vars.DOCKER_HUB_ACC }}
FRONT_IMAGE: ${{ vars.DOCKER_HUB_ACC }}/niffler-frontend-staging:latest
run: |
pwd
docker login --username ${{ vars.DOCKER_HUB_ACC }} --password "${{ secrets.DOCKER_HUB_PASSWORD }}"
echo "VAULT_TOKEN=${{ secrets.VAULT_TOKEN }}" >> $GITHUB_ENV
bash ./docker-compose-ci.sh staging
FRONT_IMAGE=${{ vars.DOCKER_HUB_ACC }}/niffler-frontend-staging:latest PREFIX=${{ vars.DOCKER_HUB_ACC }} PROFILE=staging docker-compose -f docker-compose.ci.yml up -d --force-recreate spend.niffler.dc
docker-compose -f docker-compose.ci.yml up -d --force-recreate spend.niffler.dc
docker system prune -a -f
echo "done"
7 changes: 6 additions & 1 deletion .github/workflows/niffler-userdata-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,15 @@ jobs:
steps:
- name: deploy
working-directory: ./
env:
VAULT_TOKEN: ${{ secrets.VAULT_TOKEN }}
PROFILE: prod
PREFIX: ${{ vars.DOCKER_HUB_ACC }}
FRONT_IMAGE: ${{ vars.DOCKER_HUB_ACC }}/niffler-frontend-prod:latest
run: |
pwd
docker login --username ${{ vars.DOCKER_HUB_ACC }} --password "${{ secrets.DOCKER_HUB_PASSWORD }}"
bash ./docker-compose-ci.sh prod
FRONT_IMAGE=${{ vars.DOCKER_HUB_ACC }}/niffler-frontend-prod:latest PREFIX=${{ vars.DOCKER_HUB_ACC }} PROFILE=prod docker-compose -f docker-compose.ci.yml up -d --force-recreate userdata.niffler.dc
docker-compose -f docker-compose.ci.yml up -d --force-recreate userdata.niffler.dc
docker system prune -a -f
echo "done"
5 changes: 4 additions & 1 deletion .github/workflows/niffler-userdata-staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@ jobs:
working-directory: ./
env:
VAULT_TOKEN: ${{ secrets.VAULT_TOKEN }}
PROFILE: staging
PREFIX: ${{ vars.DOCKER_HUB_ACC }}
FRONT_IMAGE: ${{ vars.DOCKER_HUB_ACC }}/niffler-frontend-staging:latest
run: |
pwd
docker login --username ${{ vars.DOCKER_HUB_ACC }} --password "${{ secrets.DOCKER_HUB_PASSWORD }}"
echo "VAULT_TOKEN=${{ secrets.VAULT_TOKEN }}" >> $GITHUB_ENV
bash ./docker-compose-ci.sh staging
FRONT_IMAGE=${{ vars.DOCKER_HUB_ACC }}/niffler-frontend-staging:latest PREFIX=${{ vars.DOCKER_HUB_ACC }} PROFILE=staging docker-compose -f docker-compose.ci.yml up -d --force-recreate userdata.niffler.dc
docker-compose -f docker-compose.ci.yml up -d --force-recreate userdata.niffler.dc
docker system prune -a -f
echo "done"
2 changes: 1 addition & 1 deletion niffler-auth/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
id 'io.spring.dependency-management' version '1.1.3'
id 'com.google.cloud.tools.jib' version '3.3.2'
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-web'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,21 @@
public class CorsCustomizer {

private final String nifflerFrontUri;
private final String nifflerAuthUri;

@Autowired
public CorsCustomizer(@Value("${niffler-front.base-uri}") String nifflerFrontUri) {
public CorsCustomizer(@Value("${niffler-front.base-uri}") String nifflerFrontUri,
@Value("${niffler-auth.base-uri}") String nifflerAuthUri) {
this.nifflerFrontUri = nifflerFrontUri;
this.nifflerAuthUri = nifflerAuthUri;
}

public void corsCustomizer(@Nonnull HttpSecurity http) throws Exception {
http.cors(c -> {
CorsConfigurationSource source = s -> {
CorsConfiguration cc = new CorsConfiguration();
cc.setAllowCredentials(true);
cc.setAllowedOrigins(List.of(nifflerFrontUri));
cc.setAllowedOrigins(List.of(nifflerFrontUri, nifflerAuthUri));
cc.setAllowedHeaders(List.of("*"));
cc.setAllowedMethods(List.of("*"));
return cc;
Expand Down
2 changes: 1 addition & 1 deletion niffler-currency/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
id 'io.spring.dependency-management' version '1.1.3'
id 'com.google.cloud.tools.jib' version '3.3.2'
}

dependencies {
implementation project(':niffler-grpc-common')

Expand Down
2 changes: 1 addition & 1 deletion niffler-frontend-gql/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ FROM nginx:1.23.3-alpine as release
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /app/build /usr/share/nginx/html/
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
CMD ["nginx", "-g", "daemon off;"]
4 changes: 0 additions & 4 deletions niffler-frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,3 @@ COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /app/build /usr/share/nginx/html/
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]




2 changes: 1 addition & 1 deletion niffler-gateway/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
id 'io.spring.dependency-management' version '1.1.3'
id 'com.google.cloud.tools.jib' version '3.3.2'
}

configurations {
jaxb
}
Expand Down
2 changes: 1 addition & 1 deletion niffler-spend/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
id 'io.spring.dependency-management' version '1.1.3'
id 'com.google.cloud.tools.jib' version '3.3.2'
}

dependencies {
implementation project(':niffler-grpc-common')

Expand Down
2 changes: 1 addition & 1 deletion niffler-userdata/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
id 'io.spring.dependency-management' version '1.1.3'
id 'com.google.cloud.tools.jib' version '3.3.2'
}

configurations {
jaxb
}
Expand Down

0 comments on commit 8b03f97

Please sign in to comment.