Skip to content

Commit

Permalink
Dev to Main (#519)
Browse files Browse the repository at this point in the history
* Delete deployment directory (#443)

* Improve container build process (#492)

* Update pipelines

* update cache image

* update trivy

* add slack

* add workflow_dispatch to drafter

* back to normal drafter

* cleanup

* add context to docker build

* add context v2

* add Helm 3 to Readme

* update context

* update target branch dependabot

* Update cache GHA

* short main sha

* simplify docker build

* upgrade depraceted docker build method

* Add timestamp to container build (#494)

* add date

* add timestamp

* DAS-356 use latest common plugin + backend libs (#505)

* add missing Akka serialisation config for dex Application (for the Redis cache) (#497)

* DAS-564 remove allowed host filter and use play-common module

* Extend Helm with ServiceMonitor (#514)

* Add ServiceMonitor and PrometheusRoles

* add service metrics

* change serive name and add labels

* update names

* update selector

* update labels

* change port name

* bump hat version

* removed the TLS filter

Co-authored-by: Piotr Perzyna <[email protected]>
Co-authored-by: xavji <[email protected]>
  • Loading branch information
3 people authored Jun 14, 2021
1 parent a47a501 commit 2361af5
Show file tree
Hide file tree
Showing 49 changed files with 409 additions and 876 deletions.
8 changes: 7 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
target-branch: "main"
target-branch: "dev"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
- package-ecosystem: "docker"
directory: "/"
target-branch: "dev"
schedule:
interval: "daily"
open-pull-requests-limit: 10
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
submodules: recursive

- name: Cache - GHA
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: ~/.cache/coursier/v1/https
key: ${{ runner.OS }}-coursier-cache
Expand Down
64 changes: 46 additions & 18 deletions .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ env:
RUMPEL: live
RUMPEL_ALT: latest
RUMPEL_BUCKET: dswift-hat-stage-frontend-build-artifacts
REPOSITORY: dataswift/hat

jobs:
build:
Expand All @@ -21,15 +20,16 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: recursive

- name: Cache - GHA
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: ~/.cache/coursier/v1/https
key: ${{ runner.OS }}-coursier-cache

- name: Add extra resolvers
- name: Cache - Resolvers
run: curl https://${{ secrets.ARTIFACTS_CACHE_BUCKET }}/resolvers.sbt --create-dirs -o ~/.sbt/resolvers.sbt

- name: Setup Java
Expand All @@ -40,7 +40,7 @@ jobs:
java-package: jdk
architecture: x64

- name: Frontend
- name: App - Frontend
env:
AWS_ACCESS_KEY_ID: ${{ secrets.DEPLOYER_STAGING_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DEPLOYER_STAGING_SECRET_ACCESS_KEY }}
Expand All @@ -57,25 +57,53 @@ jobs:
rm -r alt-rumpel
cd -
- name: Build
run: |
sbt -Denv=prod -Dhttp.port=8080 -Dpidfile.path=/dev/null -Dplay.server.pidfile.path=/dev/null docker:stage
docker build -t ${{ env.REPOSITORY }}:${{ github.sha }} hat/target/docker/stage
- name: App - Build
run: sbt Docker/stage

- name: Container - Setup QEMU
uses: docker/setup-qemu-action@v1

- name: Container Registry - Login
- name: Container - Setup Buildx
uses: docker/setup-buildx-action@v1

- name: Container - Login DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_DATASWIFT_USER }}
password: ${{ secrets.DOCKERHUB_DATASWIFT_PASS }}

- name: Container Registry - Push
run: docker push ${{ env.REPOSITORY }}:${{ github.sha }}
- id: date
run: |
echo "::set-output name=ts::$(date +%s)"
- name: Container - Meta
id: meta
uses: docker/metadata-action@v3
with:
images: |
dataswift/hat
tags: |
type=sha,prefix=dev-,suffix=-${{ steps.date.outputs.ts }},format=long
- name: Container - Build & Push
uses: docker/build-push-action@v2
with:
push: true
context: hat/target/docker/stage
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
cache-from: type=registry,ref=ghcr.io/datasiwft/hat:latest

- name: Invoke deployment
uses: benc-uk/workflow-dispatch@v1
- name: Slack
uses: lazy-actions/slatify@master
if: failure()
with:
workflow: Deploy
ref: refs/heads/main
repo: dataswift/deployments
token: ${{ secrets.BOT_GITHUB_TOKEN }}
inputs: '{ "service": "hat", "environment": "dev", "version": "${{ env.REPOSITORY }}:${{ github.sha }}" }'
type: ${{ job.status }}
job_name: "*${{ env.GITHUB_WORKFLOW }}*"
channel: "ci"
commit: true
mention: "here"
mention_if: "failure"
token: ${{ secrets.GITHUB_TOKEN }}
url: ${{ secrets.SLACK_WEBHOOK_URL }}
65 changes: 47 additions & 18 deletions .github/workflows/deploy-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ env:
RUMPEL: live
RUMPEL_ALT: latest
RUMPEL_BUCKET: dswift-hat-sandbox-frontend-build-artifacts
REPOSITORY: dataswift/hat

jobs:
build:
Expand All @@ -20,15 +19,16 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: recursive

- name: Cache - GHA
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: ~/.cache/coursier/v1/https
key: ${{ runner.OS }}-coursier-cache

- name: Add extra resolvers
- name: Cache - Resolvers
run: curl https://${{ secrets.ARTIFACTS_CACHE_BUCKET }}/resolvers.sbt --create-dirs -o ~/.sbt/resolvers.sbt

- name: Setup Java
Expand All @@ -39,7 +39,7 @@ jobs:
java-package: jdk
architecture: x64

- name: Frontend
- name: App - Frontend
env:
AWS_ACCESS_KEY_ID: ${{ secrets.DEPLOYER_SANDBOX_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DEPLOYER_SANDBOX_SECRET_ACCESS_KEY }}
Expand All @@ -56,25 +56,54 @@ jobs:
rm -r alt-rumpel
cd -
- name: Build
run: |
sbt -Denv=prod -Dhttp.port=8080 -Dpidfile.path=/dev/null -Dplay.server.pidfile.path=/dev/null docker:stage
docker build -t ${{ env.REPOSITORY }}:${{ github.sha }} hat/target/docker/stage
- name: App - Build
run: sbt Docker/stage

- name: Container - Setup QEMU
uses: docker/setup-qemu-action@v1

- name: Container Registry - Login
- name: Container - Setup Buildx
uses: docker/setup-buildx-action@v1

- name: Container - Login DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_DATASWIFT_USER }}
password: ${{ secrets.DOCKERHUB_DATASWIFT_PASS }}

- name: Container Registry - Push
run: docker push ${{ env.REPOSITORY }}:${{ github.sha }}
- id: date
run: |
echo "::set-output name=ts::$(date +%s)"
- name: Container - Meta
id: meta
uses: docker/metadata-action@v3
with:
images: |
dataswift/hat
tags: |
type=sha,prefix=main-,suffix=-${{ steps.date.outputs.ts }},format=short
- name: Container - Build & Push
uses: docker/build-push-action@v2
with:
push: true
context: .
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
cache-from: type=registry,ref=ghcr.io/datasiwft/hat:latest
file: hat/target/docker/stage/Dockerfile

- name: Invoke deployment
uses: benc-uk/workflow-dispatch@v1
- name: Slack
uses: lazy-actions/slatify@master
if: failure()
with:
workflow: Deploy
ref: refs/heads/main
repo: dataswift/deployments
token: ${{ secrets.BOT_GITHUB_TOKEN }}
inputs: '{ "service": "hat", "environment": "sandbox", "version": "${{ env.REPOSITORY }}:${{ github.sha }}" }'
type: ${{ job.status }}
job_name: "*${{ env.GITHUB_WORKFLOW }}*"
channel: "ci"
commit: true
mention: "here"
mention_if: "failure"
token: ${{ secrets.GITHUB_TOKEN }}
url: ${{ secrets.SLACK_WEBHOOK_URL }}
75 changes: 52 additions & 23 deletions .github/workflows/deploy-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ env:
RUMPEL: live
RUMPEL_ALT: latest
RUMPEL_BUCKET: hubofallthings-net-frontend-build-artifacts
REPOSITORY: dataswift/hat

jobs:
build:
Expand All @@ -20,15 +19,16 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: recursive

- name: Cache - GHA
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: ~/.cache/coursier/v1/https
key: ${{ runner.OS }}-coursier-cache

- name: Add extra resolvers
- name: Cache - Resolvers
run: curl https://${{ secrets.ARTIFACTS_CACHE_BUCKET }}/resolvers.sbt --create-dirs -o ~/.sbt/resolvers.sbt

- name: Setup Java
Expand All @@ -39,7 +39,7 @@ jobs:
java-package: jdk
architecture: x64

- name: Frontend
- name: App - Frontend
env:
AWS_ACCESS_KEY_ID: ${{ secrets.DEPLOYER_MASTER_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DEPLOYER_MASTER_SECRET_ACCESS_KEY }}
Expand All @@ -56,32 +56,61 @@ jobs:
rm -r alt-rumpel
cd -
- name: Build
run: |
sbt -Denv=prod -Dhttp.port=8080 -Dpidfile.path=/dev/null -Dplay.server.pidfile.path=/dev/null docker:stage
docker build -t ${{ env.REPOSITORY }}:${{ github.sha }} hat/target/docker/stage
- name: App - Build
run: sbt Docker/stage

- name: Container - Setup QEMU
uses: docker/setup-qemu-action@v1

- name: Container Registry - Login
- name: Container - Setup Buildx
uses: docker/setup-buildx-action@v1

- name: Container - Login DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_DATASWIFT_USER }}
password: ${{ secrets.DOCKERHUB_DATASWIFT_PASS }}

- name: Get the tag
id: git
run: echo ::set-output name=TAG::$(echo $GITHUB_REF | sed -e "s/refs\/tags\///g")
- name: Container - Login GitHub
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ secrets.BOT_GITHUB_NAME }}
password: ${{ secrets.BOT_GITHUB_TOKEN }}

- name: Container Registry - Tag
run: docker tag ${{ env.REPOSITORY }}:${{ github.sha }} ${{ env.REPOSITORY }}:${{ steps.git.outputs.TAG }}
- name: Container - Meta
id: meta
uses: docker/metadata-action@v3
with:
images: |
dataswift/hat
ghcr.io/dataswift/hat
tags: |
type=raw,value=latest
type=semver,prefix=v,pattern={{version}}
type=semver,prefix=v,pattern={{major}}
type=semver,prefix=v,pattern={{major}}.{{minor}}
- name: Container Registry - Push
run: docker push ${{ env.REPOSITORY }}:${{ steps.git.outputs.TAG }}
- name: Container - Build & Push
uses: docker/build-push-action@v2
with:
push: true
context: .
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
cache-from: type=registry,ref=ghcr.io/datasiwft/hat:latest
file: hat/target/docker/stage/Dockerfile

- name: Invoke deployment
uses: benc-uk/workflow-dispatch@v1
- name: Slack
uses: lazy-actions/slatify@master
if: failure()
with:
workflow: Deploy
ref: refs/heads/main
repo: dataswift/deployments
token: ${{ secrets.BOT_GITHUB_TOKEN }}
inputs: '{ "service": "hat", "environment": "production", "version": "${{ env.REPOSITORY }}:${{ steps.git.outputs.TAG }}" }'
type: ${{ job.status }}
job_name: "*${{ env.GITHUB_WORKFLOW }}*"
channel: "ci"
commit: true
mention: "here"
mention_if: "failure"
token: ${{ secrets.GITHUB_TOKEN }}
url: ${{ secrets.SLACK_WEBHOOK_URL }}
Loading

0 comments on commit 2361af5

Please sign in to comment.