Skip to content

Commit

Permalink
feat: migration from gitlab to github (#730)
Browse files Browse the repository at this point in the history
Co-authored-by: devthejo <[email protected]>
  • Loading branch information
maxgfr and devthejo authored May 12, 2022
1 parent 11cc862 commit 4c6dd02
Show file tree
Hide file tree
Showing 244 changed files with 6,697 additions and 10,682 deletions.
3 changes: 1 addition & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Protect workflow files
.github/workflows/*.yml @socialgouv/sre
.github/CODEOWNERS @socialgouv/sre
.k8s/ @socialgouv/sre
.socialgouv/ @socialgouv/sre
.kube-workflow/ @socialgouv/sre
24 changes: 12 additions & 12 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version-file: '.node-version'
node-version-file: ".node-version"
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
Expand Down Expand Up @@ -50,11 +50,11 @@ jobs:
"frontend",
"alert-cli",
"ingester",
"ingester-es",
"export-elasticsearch",
"@shared/dila-resolver",
"@socialgouv/cdtn-elasticsearch",
"@shared/elasticsearch-document-adapter",
"@socialgouv/cdtn-logger"
"@socialgouv/cdtn-logger",
]
steps:
- uses: actions/cache@v2
Expand All @@ -69,20 +69,20 @@ jobs:
test:
name: Test
runs-on: ubuntu-latest
needs: [ build ]
needs: [build]
strategy:
fail-fast: false
matrix:
repositories:
[
"frontend",
"alert-cli",
"ingester",
"ingester-es",
"@shared/dila-resolver",
"@socialgouv/cdtn-elasticsearch",
"@shared/elasticsearch-document-adapter",
"@socialgouv/cdtn-logger"
"frontend",
"alert-cli",
"ingester",
"export-elasticsearch",
"@shared/dila-resolver",
"@socialgouv/cdtn-elasticsearch",
"@shared/elasticsearch-document-adapter",
"@socialgouv/cdtn-logger",
]
steps:
- uses: actions/cache@v2
Expand Down
46 changes: 18 additions & 28 deletions .github/workflows/review.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Review

on:
pull_request:
branches:
- "**"
push:
branches-ignore:
- master
tags-ignore:
- v*

Expand All @@ -28,40 +28,30 @@ jobs:
- images: "cdtn-admin-ingester"
path: "./targets/ingester"
context: "."
- images: "cdtn-admin-ingester-elasticsearch"
path: "./targets/ingester-elasticsearch"
context: "."
- images: "cdtn-admin-alert-cli"
path: "./targets/alert-cli"
context: "."
- images: "cdtn-admin-export-elasticsearch"
path: "./targets/export-elasticsearch"
context: "."
steps:
- name: Register docker images
uses: SocialGouv/actions/autodevops-build-register@local-cache-cdtn
uses: SocialGouv/actions/autodevops-build-register@v1
with:
project: "cdtn-admin"
imageName: cdtn-admin/${{ matrix.images }}
imagePackage: ${{ matrix.images }}
token: ${{ secrets.GITHUB_TOKEN }}
dockerfile: "${{ matrix.path }}/Dockerfile.github"
dockerfile: "${{ matrix.path }}/Dockerfile"
dockercontext: "${{ matrix.context }}"

manifests:
name: Generate k8s manifests
deploy:
name: Deploy
runs-on: ubuntu-latest
needs: [register]
steps:
- name: Install
shell: bash
run: |
yarn add @socialgouv/kosko-charts
- name: Get k8s infos
id: k8s
shell: bash
run: |
RAW_BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}
BRANCH=$(npx @socialgouv/env-slug "${RAW_BRANCH}")
echo "::set-output name=branch::$(echo ${BRANCH})"
- name: Use k8s manifests generation
uses: SocialGouv/actions/k8s-manifests@v1
- uses: SocialGouv/kube-workflow@master
with:
environment: "dev"
rancherId: ${{ secrets.RANCHER_PROJECT_ID }}
socialgouvBaseDomain: ${{ secrets.SOCIALGOUV_BASE_DOMAIN }}
environment: dev
token: ${{ secrets.GITHUB_TOKEN }}
kubeconfig: ${{ secrets.KUBECONFIG }}
rancherProjectId: ${{ secrets.RANCHER_PROJECT_ID }}
rancherProjectName: ${{ secrets.RANCHER_PROJECT_NAME }}
25 changes: 25 additions & 0 deletions .github/workflows/run-ingester-preprod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Run ingester preprod

on:
workflow_dispatch:

concurrency:
cancel-in-progress: true
group: run-ingester-preprod-${{ github.ref }}

jobs:
release:
name: Run ingester preprod
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Run kube-workflow
uses: SocialGouv/kube-workflow@master
with:
environment: preprod
rancherProjectId: ${{ secrets.RANCHER_PROJECT_ID }}
rancherProjectName: ${{ secrets.RANCHER_PROJECT_NAME }}
token: ${{ secrets.GITHUB_TOKEN }}
kubeconfig: ${{ secrets.KUBECONFIG }}
charts: job-ingester
25 changes: 25 additions & 0 deletions .github/workflows/run-ingester-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Run ingester prod

on:
workflow_dispatch:

concurrency:
cancel-in-progress: true
group: run-ingester-prod-${{ github.ref }}

jobs:
release:
name: Run ingester prod
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Run kube-workflow
uses: SocialGouv/kube-workflow@master
with:
environment: prod
rancherProjectId: ${{ secrets.RANCHER_PROJECT_ID }}
rancherProjectName: ${{ secrets.RANCHER_PROJECT_NAME }}
token: ${{ secrets.GITHUB_TOKEN }}
kubeconfig: ${{ secrets.KUBECONFIG }}
charts: job-ingester
15 changes: 7 additions & 8 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,19 @@ jobs:
- images: "cdtn-admin-ingester"
path: "./targets/ingester"
context: "."
- images: "cdtn-admin-ingester-elasticsearch"
path: "./targets/ingester-elasticsearch"
context: "."
- images: "cdtn-admin-alert-cli"
path: "./targets/alert-cli"
context: "."
- images: "cdtn-admin-export-elasticsearch"
path: "./targets/export-elasticsearch"
context: "."
steps:
- name: Register docker images
uses: SocialGouv/actions/autodevops-build-register@local-cache-cdtn
uses: SocialGouv/actions/autodevops-build-register@v1
with:
project: "cdtn-admin"
imageName: cdtn-admin/${{ matrix.images }}
imagePackage: ${{ matrix.images }}
token: ${{ secrets.GITHUB_TOKEN }}
dockerfile: "${{ matrix.path }}/Dockerfile.github"
dockerfile: "${{ matrix.path }}/Dockerfile"
dockercontext: "${{ matrix.context }}"

trivy:
Expand All @@ -53,7 +52,7 @@ jobs:
"cdtn-admin-frontend",
"cdtn-admin-hasura",
"cdtn-admin-ingester",
"cdtn-admin-ingester-elasticsearch",
"cdtn-admin-export-elasticsearch",
"cdtn-admin-alert-cli",
]
steps:
Expand Down
Loading

0 comments on commit 4c6dd02

Please sign in to comment.