-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1142b73
commit 4b8425a
Showing
16 changed files
with
189 additions
and
186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,18 +70,18 @@ jobs: | |
- name: Run integration tests | ||
run: make test_integration | ||
- name: Build Docker image | ||
run: make build | ||
run: make docker_build | ||
- name: Upload image artifact | ||
uses: neuro-inc/[email protected] | ||
with: | ||
image: platformstorageapi | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
deploy_dev: | ||
name: Deploy on dev | ||
environment: dev | ||
runs-on: ubuntu-latest | ||
needs: test | ||
concurrency: deploy_dev | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | ||
env: | ||
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }} | ||
|
@@ -91,7 +91,6 @@ jobs: | |
AZURE_RG_NAME: ${{ secrets.AZURE_DEV_RG_NAME }} | ||
CLUSTER_NAME: ${{ secrets.DEV_CLUSTER_NAME }} | ||
HELM_ENV: dev | ||
HELM_VERSION: ${{ secrets.HELM3_VERSION }} | ||
CLOUD_PROVIDER: ${{ secrets.CLOUD_PROVIDER_DEV }} | ||
steps: | ||
- name: Checkout commit | ||
|
@@ -102,6 +101,10 @@ jobs: | |
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8.10 | ||
- name: Install Helm | ||
uses: azure/setup-helm@v1 | ||
with: | ||
version: v3.7.0 | ||
- name: Configure AWS credentials | ||
if: env.CLOUD_PROVIDER == 'aws' | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
|
@@ -130,43 +133,5 @@ jobs: | |
run: make docker_push | ||
- name: Update kube config | ||
run: make ${{ env.CLOUD_PROVIDER }}_k8s_login | ||
- name: Install helm | ||
run: make helm_install | ||
- name: Deploy to kubernetes | ||
run: make helm_deploy | ||
|
||
concurrency: deploy_dev | ||
release: | ||
name: Release package | ||
runs-on: ubuntu-latest | ||
needs: test | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | ||
env: | ||
ARTIFACTORY_DOCKER_REPO: ${{ secrets.ARTIFACTORY_DOCKER_REPO }} | ||
ARTIFACTORY_HELM_REPO: ${{ secrets.ARTIFACTORY_HELM_REPO }} | ||
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} | ||
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} | ||
HELM_VERSION: ${{ secrets.HELM3_VERSION }} | ||
steps: | ||
- name: Checkout commit | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8.10 | ||
- name: Login to Artifactory docker registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ${{ secrets.ARTIFACTORY_DOCKER_REPO }} | ||
username: ${{ secrets.ARTIFACTORY_USERNAME }} | ||
password: ${{ secrets.ARTIFACTORY_PASSWORD }} | ||
- name: Set tag | ||
run: echo "TAG=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV | ||
- name: Push image to Artifactory | ||
run: make artifactory_docker_push | ||
- name: Install helm | ||
run: make helm_install | ||
- name: Push chart to Artifactory | ||
run: make artifactory_helm_push |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
name: Release Image | ||
|
||
on: | ||
workflow_run: | ||
workflows: | ||
- CI | ||
types: | ||
- completed | ||
|
||
permissions: | ||
contents: write | ||
packages: write | ||
|
||
jobs: | ||
publish_image: | ||
name: Publish Image | ||
runs-on: ubuntu-latest | ||
concurrency: release_image | ||
outputs: | ||
tag: ${{ steps.release.outputs.tag }} | ||
version: ${{ steps.release.outputs.version }} | ||
skip: ${{ steps.release.outputs.skip }} | ||
steps: | ||
- name: Purge old artifacts | ||
uses: kolpav/purge-artifacts-action@v1 | ||
with: | ||
token: ${{ secrets.GH_TOKEN }} | ||
expire-in: 30mins | ||
- name: Release image | ||
id: release | ||
uses: neuro-inc/[email protected] | ||
with: | ||
image: platformstorageapi | ||
token: ${{ secrets.GH_TOKEN }} | ||
- name: Checkout commit | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.event.workflow_run.head_sha }} | ||
fetch-depth: 0 | ||
- name: Github Release | ||
if: ${{ ! steps.release.outputs.skip }} | ||
run: | | ||
if [[ -n $PRERELEASE ]]; then | ||
gh release create "$TAG" --prerelease --notes "docker pull ghcr.io/neuro-inc/platformstorageapi:$VERSION" | ||
else | ||
gh release create "$TAG" --notes "docker pull ghcr.io/neuro-inc/platformstorageapi:$VERSION" | ||
fi | ||
shell: bash | ||
env: | ||
TAG: ${{ steps.release.outputs.tag }} | ||
VERSION: ${{ steps.release.outputs.version }} | ||
GH_TOKEN: ${{ secrets.GH_TOKEN }} | ||
PRERELEASE: ${{ steps.release.outputs.prerelease }} | ||
publish_chart: | ||
name: Publish Helm chart | ||
runs-on: ubuntu-latest | ||
needs: publish_image | ||
if: ${{ ! needs.publish_image.outputs.skip }} | ||
concurrency: release_helm_chart | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Checkout commit | ||
run: git checkout ${{ github.event.workflow_run.head_sha }} | ||
- name: Configure Git | ||
run: | | ||
git config user.name "$GITHUB_ACTOR" | ||
git config user.email "[email protected]" | ||
- name: Install Helm | ||
uses: azure/setup-helm@v1 | ||
with: | ||
version: v3.7.0 | ||
- name: Create chart | ||
run: make helm_create_chart | ||
env: | ||
IMAGE_REGISTRY: github | ||
TAG: ${{ needs.publish_image.outputs.tag }} | ||
GITHUB_OWNER: ${{ github.repository_owner }} | ||
HELM_CHART_VERSION: ${{ needs.publish_image.outputs.version }} | ||
HELM_APP_VERSION: ${{ needs.publish_image.outputs.version }} | ||
- name: Release chart | ||
uses: helm/[email protected] | ||
env: | ||
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
values-*.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
apiVersion: v2 | ||
name: platform-storage | ||
description: A Helm chart for platform-storage service | ||
version: $CHART_VERSION | ||
appVersion: $APP_VERSION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{{- define "platformStorage.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{- define "platformStorage.fullname" -}} | ||
{{- if .Values.fullnameOverride -}} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- $name := default .Chart.Name .Values.nameOverride -}} | ||
{{- if contains $name .Release.Name -}} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{- define "platformStorage.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" -}} | ||
{{- end -}} | ||
|
||
{{- define "platformStorage.labels.standard" -}} | ||
app: {{ include "platformStorage.name" . }} | ||
chart: {{ include "platformStorage.chart" . }} | ||
heritage: {{ .Release.Service | quote }} | ||
release: {{ .Release.Name | quote }} | ||
{{- end -}} |
Oops, something went wrong.