Skip to content

[수정] alpine에서 command 실행 #14

[수정] alpine에서 command 실행

[수정] alpine에서 command 실행 #14

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: update_helm_repo
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
pull_request:
types:
- closed
branches: [ "main" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
env:
OCI_CLI_USER: ${{ secrets.OCI_CLI_USER }}
OCI_CLI_TENANCY: ${{ secrets.OCI_CLI_TENANCY }}
OCI_CLI_FINGERPRINT: ${{ secrets.OCI_CLI_FINGERPRINT }}
OCI_CLI_KEY_CONTENT: ${{ secrets.OCI_CLI_KEY_CONTENT }}
OCI_CLI_REGION: ${{ secrets.OCI_CLI_REGION }}
IMAGE_TAG: ${{ github.sha }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Get or create an OCIR Repository
uses: oracle-actions/[email protected]
id: get-ocir-repository
with:
name: terraform_canvas
compartment: ${{ secrets.OCI_COMPARTMENT_OCID }}
- name: Log into OCIR
uses: oracle-actions/[email protected]
id: login-ocir
with:
auth_token: ${{ secrets.OCI_AUTH_TOKEN }}
- name: Tag and push a container image
id: tag-and-push-image
run: |
docker build -t "terraform_canvas:new-backend" .
docker tag "terraform_canvas:new-backend" "${{ steps.get-ocir-repository.outputs.repo_path }}:$IMAGE_TAG"
docker push "${{ steps.get-ocir-repository.outputs.repo_path }}:$IMAGE_TAG"
- name: update back.yaml
run: |
cat <<EOF> back.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "terraform-canvas.fullname" . }}-back
labels:
app: {{ include "terraform-canvas.name" . }}-back
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: {{ include "terraform-canvas.name" . }}-back
template:
metadata:
labels:
app: {{ include "terraform-canvas.name" . }}-back
spec:
serviceAccountName: {{ include "terraform-canvas.serviceAccountName" . }}
containers:
- name: {{ .Chart.Name }}-back
image: ${{ steps.get-ocir-repository.outputs.repo_path }}:$IMAGE_TAG
ports:
- name: http
containerPort: {{ .Values.backend.lb.http.targetPort}}
protocol: TCP
env:
- name: tenancyID
valueFrom:
secretKeyRef:
name: oci-sdk
key: tenancyID
- name: userID
valueFrom:
secretKeyRef:
name: oci-sdk
key: userID
- name: fingerprint
valueFrom:
secretKeyRef:
name: oci-sdk
key: fingerprint
- name: privateKey
valueFrom:
secretKeyRef:
name: oci-sdk
key: privateKey
- name: compartmentID
valueFrom:
secretKeyRef:
name: oci-sdk
key: compartmentID
- name: privateKeyPass
valueFrom:
secretKeyRef:
name: oci-sdk
key: privateKeyPass
- name: JWT_SECRET_KEY
valueFrom:
secretKeyRef:
name: jwt-config
key: JWT_SECRET_KEY
- name: JWT_SECRET_KEY_EXPIRE_MINUTES_COUNT
valueFrom:
secretKeyRef:
name: jwt-config
key: JWT_SECRET_KEY_EXPIRE_MINUTES_COUNT
- name: JWT_REFRESH_KEY
valueFrom:
secretKeyRef:
name: jwt-config
key: JWT_REFRESH_KEY
- name: JWT_REFRESH_KEY_EXPIRE_HOURS_COUNT
valueFrom:
secretKeyRef:
name: jwt-config
key: JWT_REFRESH_KEY_EXPIRE_HOURS_COUNT
- name: AWS_ACCESS_KEY
valueFrom:
secretKeyRef:
name: aws-sdk
key: AWS_ACCESS_KEY
- name: AWS_SECRET_KEY
valueFrom:
secretKeyRef:
name: aws-sdk
key: AWS_SECRET_KEY
- name: region
valueFrom:
configMapKeyRef:
name: oci-sdk
key: region
- name: AWS_REGION
valueFrom:
configMapKeyRef:
name: aws-sdk
key: AWS_REGION
- name: SERVER_HOST
valueFrom:
configMapKeyRef:
name: server-set
key: SERVER_HOST
- name: SERVER_PORT
valueFrom:
configMapKeyRef:
name: server-set
key: SERVER_PORT
- name: SERVER_READ_TIMEOUT
valueFrom:
configMapKeyRef:
name: server-set
key: SERVER_READ_TIMEOUT
---
apiVersion: v1
kind: Service
metadata:
name: "backend-cluster"
labels:
{{- include "terraform-canvas.labels" . | nindent 4 }}-back
spec:
type: {{ .Values.backend.service.type }}
ports:
- port: {{ .Values.backend.service.http.servicePort }}
targetPort: {{ .Values.backend.service.http.targetPort }}
protocol: TCP
selector:
app: {{ include "terraform-canvas.name" . }}-back
EOF
- name: Pushes values file
uses: dmnemec/copy_file_to_another_repo_action@main
env:
API_TOKEN_GITHUB: ${{ secrets.TOKEN_GITHUB }}
with:
source_file: 'back.yaml'
destination_repo: 'Terraform-Canvas/canvas-helm'
destination_folder: 'charts/terraform-canvas/templates'
user_email: '[email protected]'
user_name: 'Eeap'
commit_message: "build: add img ${{ steps.get-ocir-repository.outputs.repo_path }}:$IMAGE_TAG"