Skip to content

Commit

Permalink
(PC-31321)[API] ci: use teleport and argocd actions
Browse files Browse the repository at this point in the history
  • Loading branch information
lgerard-pass committed Aug 19, 2024
1 parent 8dab91c commit d8ba316
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 45 deletions.
1 change: 0 additions & 1 deletion .github/workflows/dev_on_dispatch_deploy_ops.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ jobs:
with:
environment: ops
app_version: ${{ inputs.pcapi_image_tag }}
teleport_version: 15.2.5
teleport_proxy: teleport.ops.passculture.team:443
teleport_kubernetes_cluster: passculture-metier-ops
deploy_api: true
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/dev_on_dispatch_release_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ jobs:
with:
environment: ${{ github.event.inputs.target_environment }}
app_version: ${{ needs.version.outputs.APP_VERSION }}
teleport_version: 15.2.5
teleport_proxy: teleport.ehp.passculture.team:443
teleport_kubernetes_cluster: passculture-metier-ehp
deploy_api: true
Expand All @@ -109,7 +108,6 @@ jobs:
with:
environment: integration
app_version: ${{ needs.version.outputs.APP_VERSION }}
teleport_version: 15.2.5
teleport_proxy: teleport.ehp.passculture.team:443
teleport_kubernetes_cluster: passculture-metier-ehp
deploy_api: true
Expand All @@ -127,7 +125,6 @@ jobs:
with:
environment: ${{ github.event.inputs.target_environment }}
app_version: ${{ needs.version.outputs.APP_VERSION }}
teleport_version: 15.2.5
teleport_proxy: teleport.passculture.team:443
teleport_kubernetes_cluster: passculture-metier-prod
deploy_api: true
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/dev_on_push_workflow_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ jobs:
with:
environment: testing
app_version: ${{ github.sha }}
teleport_version: 15.2.5
teleport_proxy: teleport.ehp.passculture.team:443
teleport_kubernetes_cluster: passculture-metier-ehp
deploy_api: ${{ needs.test-api.result == 'success' }}
Expand All @@ -289,7 +288,6 @@ jobs:
with:
environment: ops
app_version: ${{ github.sha }}
teleport_version: 15.2.5
teleport_proxy: teleport.ops.passculture.team:443
teleport_kubernetes_cluster: passculture-metier-ops
deploy_api: ${{ needs.test-api.result == 'success' }}
Expand Down
54 changes: 15 additions & 39 deletions .github/workflows/dev_on_workflow_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ on:
app_version:
type: string
required: true
teleport_version:
type: string
required: true
teleport_proxy:
type: string
required: true
Expand Down Expand Up @@ -63,21 +60,15 @@ jobs:
with:
secrets: |-
API_TOKEN_GITHUB:passculture-metier-ehp/passculture-main-sa-access-token
- name: "Install Teleport"
uses: teleport-actions/setup@v1
with:
version: ${{ inputs.teleport_version }}
- name: "Teleport Authentication"
uses: teleport-actions/auth-k8s@v1
id: "teleport-auth"
- name: "Connect to cluster"
uses: pass-culture/common-workflows/actions/teleport-connect@teleport-connect/v0.1.0
with:
proxy: ${{ inputs.teleport_proxy }}
token: github-token
certificate-ttl: 1h
kubernetes-cluster: ${{ inputs.teleport_kubernetes_cluster }}
teleport_proxy: ${{ inputs.teleport_proxy }}
teleport_kubernetes_cluster: ${{ inputs.teleport_kubernetes_cluster }}

- name: "Play pre-migrations"
uses: pass-culture/common-workflows/actions/pcapi-migration@PC-31321-pcapi-migration-action
uses: pass-culture/common-workflows/actions/pcapi-migration@pcapi-migration/v0.1.0
with:
environment: ${{ inputs.environment }}
app_version: ${{ inputs.app_version }}
Expand Down Expand Up @@ -126,20 +117,12 @@ jobs:
api_token_github_secret_name: passculture-metier-ehp/passculture-main-sa-access-token
chart_values_repository: ""
helmfile_path: "./pass-culture-deployment/helm/pcapi"
- name: "Install argocd cli"
id: install_argocd_cli
run: |
curl -sSL -o argocd-linux-amd64 https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-amd64
sudo install -m 555 argocd-linux-amd64 /usr/local/bin/argocd
rm argocd-linux-amd64
- name: "Check argocd application status"
id: check_status
run: |
kubectl config set-context --current --namespace=argocd
argocd app sync pcapi-${{ inputs.environment }} --core --async --prune
argocd app wait pcapi-${{ inputs.environment }} --core --timeout 600
- name: "Sync ArgoCD application"
uses: pass-culture/common-workflows/actions/argocd-sync@argocd-sync/v0.2.0
with:
app_name: pcapi-${{ inputs.environment }}
- name: "Play post-migrations"
uses: pass-culture/common-workflows/actions/pcapi-migration@PC-31321-pcapi-migration-action
uses: pass-culture/common-workflows/actions/pcapi-migration@pcapi-migration/v0.1.0
with:
environment: ${{ inputs.environment }}
app_version: ${{ inputs.app_version }}
Expand Down Expand Up @@ -244,18 +227,11 @@ jobs:
contents: read
runs-on: ubuntu-latest
steps:
- name: "Install Teleport"
uses: teleport-actions/setup@v1
with:
version: ${{ inputs.teleport_version }}
- name: "Teleport Authentication"
id: "teleport-auth"
uses: teleport-actions/auth-k8s@v1
- name: "Connect to cluster"
uses: pass-culture/common-workflows/actions/teleport-connect@teleport-connect/v0.1.0
with:
proxy: ${{ inputs.teleport_proxy }}
token: github-token
certificate-ttl: 1h
kubernetes-cluster: ${{ inputs.teleport_kubernetes_cluster }}
teleport_proxy: ${{ inputs.teleport_proxy }}
teleport_kubernetes_cluster: ${{ inputs.teleport_kubernetes_cluster }}
- name: "Configure algolia"
id: "set_algolia_settings"
uses: nick-fields/retry@v3
Expand Down

0 comments on commit d8ba316

Please sign in to comment.