From 4c55e3e08a81ae2fb789a4769fdcef24b396a413 Mon Sep 17 00:00:00 2001 From: Nadir Lloret Date: Fri, 7 Oct 2022 12:23:55 +0100 Subject: [PATCH 1/3] feat: add readme --- README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 00000000000..56ffe2695b3 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# Testing application for demo purposes From a7b21f3c8d26d77e7a7b90f03fdfc4072cc97907 Mon Sep 17 00:00:00 2001 From: Nadir Lloret Date: Fri, 7 Oct 2022 12:36:24 +0100 Subject: [PATCH 2/3] chore: test matrix generation --- .github/workflows/pr-edited.yaml | 151 ++++++++++++++++--------------- src/frontend/deploy/prod.hcl | 2 +- 2 files changed, 78 insertions(+), 75 deletions(-) diff --git a/.github/workflows/pr-edited.yaml b/.github/workflows/pr-edited.yaml index c94abf04618..84132b38a11 100644 --- a/.github/workflows/pr-edited.yaml +++ b/.github/workflows/pr-edited.yaml @@ -37,77 +37,80 @@ jobs: fail-fast: true if: ${{ fromJson(needs.generate-matrix.outputs.matrix-services).include[0] }} steps: - - - name: Checkout - uses: actions/checkout@v3 - - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - - name: Login to DockerHub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - - name: Docker meta - id: meta - uses: docker/metadata-action@v4 - with: - images: | - raquio/${{ matrix.service }} - tags: | - type=sha - - - uses: docker/build-push-action@v3 - name: Build - timeout-minutes: 20 - with: - push: true - context: src/${{ matrix.service }} - file: src/${{ matrix.service }}/Dockerfile - tags: ${{ steps.meta.outputs.tags }} - deploy_all: - needs: [generate-matrix, build-images] - runs-on: [ubuntu-latest] - container: - image: raquio/deployer:v0.0.15 - options: --user root - strategy: - matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix-services) }} - fail-fast: true - if: ${{ fromJson(needs.generate-matrix.outputs.matrix-services).include[0] }} - steps: - - - name: Checkout - uses: actions/checkout@v3 - - - name: Setup SSH - uses: webfactory/ssh-agent@v0.5.4 - with: - ssh-private-key: ${{ secrets.PACK_REGISTRY_DEPLOY_KEY }} - - - name: deploy - timeout-minutes: 10 - run: | - git config --global --add safe.directory /__w/boutique-demo/boutique-demo - TAG="sha-$(git rev-parse --short HEAD)" - deployer --conf src/${{ matrix.service }}/deploy/prod.hcl \ - --nomad-addr ${{ secrets.NOMAD_ADDR }} \ - --consul-addr ${{ secrets.CONSUL_HTTP_ADDR }} \ - --consul-token ${{ secrets.CONSUL_HTTP_TOKEN }} \ - --extra-vars="--var=service_version=$TAG" - - if [ "${{ matrix.service }}" == "cartservice" ]; then - deployer --conf src/${{ matrix.service }}/deploy/redis.hcl \ - --nomad-addr ${{ secrets.NOMAD_ADDR }} \ - --consul-addr ${{ secrets.CONSUL_HTTP_ADDR }} \ - --consul-token ${{ secrets.CONSUL_HTTP_TOKEN }} - fi \ No newline at end of file + - + name: Run deploy + run: echo "Deploying ${{ matrix.service }}" +# - +# name: Checkout +# uses: actions/checkout@v3 +# +# - +# name: Set up QEMU +# uses: docker/setup-qemu-action@v2 +# +# - +# name: Set up Docker Buildx +# uses: docker/setup-buildx-action@v2 +# +# - +# name: Login to DockerHub +# uses: docker/login-action@v2 +# with: +# username: ${{ secrets.DOCKERHUB_USERNAME }} +# password: ${{ secrets.DOCKERHUB_TOKEN }} +# +# - +# name: Docker meta +# id: meta +# uses: docker/metadata-action@v4 +# with: +# images: | +# raquio/${{ matrix.service }} +# tags: | +# type=sha +# - +# uses: docker/build-push-action@v3 +# name: Build +# timeout-minutes: 20 +# with: +# push: true +# context: src/${{ matrix.service }} +# file: src/${{ matrix.service }}/Dockerfile +# tags: ${{ steps.meta.outputs.tags }} +# deploy: +# needs: [generate-matrix, build-images] +# runs-on: [ubuntu-latest] +# container: +# image: raquio/deployer:v0.0.15 +# options: --user root +# strategy: +# matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix-services) }} +# fail-fast: true +# if: ${{ fromJson(needs.generate-matrix.outputs.matrix-services).include[0] }} +# steps: +# - +# name: Checkout +# uses: actions/checkout@v3 +# - +# name: Setup SSH +# uses: webfactory/ssh-agent@v0.5.4 +# with: +# ssh-private-key: ${{ secrets.PACK_REGISTRY_DEPLOY_KEY }} +# - +# name: deploy +# timeout-minutes: 10 +# run: | +# git config --global --add safe.directory /__w/boutique-demo/boutique-demo +# TAG="sha-$(git rev-parse --short HEAD)" +# deployer --conf src/${{ matrix.service }}/deploy/prod.hcl \ +# --nomad-addr ${{ secrets.NOMAD_ADDR }} \ +# --consul-addr ${{ secrets.CONSUL_HTTP_ADDR }} \ +# --consul-token ${{ secrets.CONSUL_HTTP_TOKEN }} \ +# --extra-vars="--var=service_version=$TAG" +# +# if [ "${{ matrix.service }}" == "cartservice" ]; then +# deployer --conf src/${{ matrix.service }}/deploy/redis.hcl \ +# --nomad-addr ${{ secrets.NOMAD_ADDR }} \ +# --consul-addr ${{ secrets.CONSUL_HTTP_ADDR }} \ +# --consul-token ${{ secrets.CONSUL_HTTP_TOKEN }} +# fi \ No newline at end of file diff --git a/src/frontend/deploy/prod.hcl b/src/frontend/deploy/prod.hcl index c8fba6f4044..21c80730074 100644 --- a/src/frontend/deploy/prod.hcl +++ b/src/frontend/deploy/prod.hcl @@ -21,5 +21,5 @@ upstreams = { } env_vars = { - "ENV_PLATFORM" = "Nomad" + "ENV_PLATFORM" = "nomad" } From a7b91c4ad4f71e9cd619fca7e5f19ea15fa3a0ca Mon Sep 17 00:00:00 2001 From: Nadir Lloret Date: Fri, 7 Oct 2022 12:37:45 +0100 Subject: [PATCH 3/3] chore: uncomment --- .github/workflows/pr-edited.yaml | 151 +++++++++++++++---------------- 1 file changed, 74 insertions(+), 77 deletions(-) diff --git a/.github/workflows/pr-edited.yaml b/.github/workflows/pr-edited.yaml index 84132b38a11..3dacf602cc4 100644 --- a/.github/workflows/pr-edited.yaml +++ b/.github/workflows/pr-edited.yaml @@ -37,80 +37,77 @@ jobs: fail-fast: true if: ${{ fromJson(needs.generate-matrix.outputs.matrix-services).include[0] }} steps: - - - name: Run deploy - run: echo "Deploying ${{ matrix.service }}" -# - -# name: Checkout -# uses: actions/checkout@v3 -# -# - -# name: Set up QEMU -# uses: docker/setup-qemu-action@v2 -# -# - -# name: Set up Docker Buildx -# uses: docker/setup-buildx-action@v2 -# -# - -# name: Login to DockerHub -# uses: docker/login-action@v2 -# with: -# username: ${{ secrets.DOCKERHUB_USERNAME }} -# password: ${{ secrets.DOCKERHUB_TOKEN }} -# -# - -# name: Docker meta -# id: meta -# uses: docker/metadata-action@v4 -# with: -# images: | -# raquio/${{ matrix.service }} -# tags: | -# type=sha -# - -# uses: docker/build-push-action@v3 -# name: Build -# timeout-minutes: 20 -# with: -# push: true -# context: src/${{ matrix.service }} -# file: src/${{ matrix.service }}/Dockerfile -# tags: ${{ steps.meta.outputs.tags }} -# deploy: -# needs: [generate-matrix, build-images] -# runs-on: [ubuntu-latest] -# container: -# image: raquio/deployer:v0.0.15 -# options: --user root -# strategy: -# matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix-services) }} -# fail-fast: true -# if: ${{ fromJson(needs.generate-matrix.outputs.matrix-services).include[0] }} -# steps: -# - -# name: Checkout -# uses: actions/checkout@v3 -# - -# name: Setup SSH -# uses: webfactory/ssh-agent@v0.5.4 -# with: -# ssh-private-key: ${{ secrets.PACK_REGISTRY_DEPLOY_KEY }} -# - -# name: deploy -# timeout-minutes: 10 -# run: | -# git config --global --add safe.directory /__w/boutique-demo/boutique-demo -# TAG="sha-$(git rev-parse --short HEAD)" -# deployer --conf src/${{ matrix.service }}/deploy/prod.hcl \ -# --nomad-addr ${{ secrets.NOMAD_ADDR }} \ -# --consul-addr ${{ secrets.CONSUL_HTTP_ADDR }} \ -# --consul-token ${{ secrets.CONSUL_HTTP_TOKEN }} \ -# --extra-vars="--var=service_version=$TAG" -# -# if [ "${{ matrix.service }}" == "cartservice" ]; then -# deployer --conf src/${{ matrix.service }}/deploy/redis.hcl \ -# --nomad-addr ${{ secrets.NOMAD_ADDR }} \ -# --consul-addr ${{ secrets.CONSUL_HTTP_ADDR }} \ -# --consul-token ${{ secrets.CONSUL_HTTP_TOKEN }} -# fi \ No newline at end of file + - + name: Checkout + uses: actions/checkout@v3 + + - + name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - + name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - + name: Docker meta + id: meta + uses: docker/metadata-action@v4 + with: + images: | + raquio/${{ matrix.service }} + tags: | + type=sha + - + uses: docker/build-push-action@v3 + name: Build + timeout-minutes: 20 + with: + push: true + context: src/${{ matrix.service }} + file: src/${{ matrix.service }}/Dockerfile + tags: ${{ steps.meta.outputs.tags }} + deploy: + needs: [generate-matrix, build-images] + runs-on: [ubuntu-latest] + container: + image: raquio/deployer:v0.0.15 + options: --user root + strategy: + matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix-services) }} + fail-fast: true + if: ${{ fromJson(needs.generate-matrix.outputs.matrix-services).include[0] }} + steps: + - + name: Checkout + uses: actions/checkout@v3 + - + name: Setup SSH + uses: webfactory/ssh-agent@v0.5.4 + with: + ssh-private-key: ${{ secrets.PACK_REGISTRY_DEPLOY_KEY }} + - + name: deploy + timeout-minutes: 10 + run: | + git config --global --add safe.directory /__w/boutique-demo/boutique-demo + TAG="sha-$(git rev-parse --short HEAD)" + deployer --conf src/${{ matrix.service }}/deploy/prod.hcl \ + --nomad-addr ${{ secrets.NOMAD_ADDR }} \ + --consul-addr ${{ secrets.CONSUL_HTTP_ADDR }} \ + --consul-token ${{ secrets.CONSUL_HTTP_TOKEN }} \ + --extra-vars="--var=service_version=$TAG" + + if [ "${{ matrix.service }}" == "cartservice" ]; then + deployer --conf src/${{ matrix.service }}/deploy/redis.hcl \ + --nomad-addr ${{ secrets.NOMAD_ADDR }} \ + --consul-addr ${{ secrets.CONSUL_HTTP_ADDR }} \ + --consul-token ${{ secrets.CONSUL_HTTP_TOKEN }} + fi \ No newline at end of file