Skip to content

Latest commit

 

History

History
113 lines (99 loc) · 4.18 KB

cicd.md

File metadata and controls

113 lines (99 loc) · 4.18 KB

CI/CD

Drone

Conditional build if directory modified

Use BuildKit

steps:
  - name: docker-buildkit
    pull: always
    image: plugins/docker:linux-amd64
    environment:
      DOCKER_BUILDKIT: 1
    settings:
      daemon_off: false

Tekton Pipelines

---
apiVersion: tekton.dev/v1alpha1
kind: Condition
metadata:
  name: is-nodejs-runtime
spec:
  params:
    - name: OW_APP_PATH
      type: string
  resources:
    - name: app-git
      type: git
  check:
    image: ubuntu
    command:
      - bash
    args:
      - -c
      - |
        echo "INFO: Identifying the language of the application source based on the file extension at:"
        echo $(params.OW_APP_PATH)
        echo "INFO: ls $(params.OW_APP_PATH):"
        ls $(params.OW_APP_PATH)
        echo "INFO: Find files with extension .js, sort displays js if one or more files found: "
        find $(params.OW_APP_PATH) -type f | sed -e 's/.*\.//' | sed -e 's/.*\///' | sort -u | grep ^js$
---
apiVersion: tekton.dev/v1alpha1
kind: Condition
metadata:
  name: is-python-runtime
spec:
  params:
    - name: OW_APP_PATH
      type: string
  resources:
    - name: app-git
      type: git
  check:
    image: ubuntu
    command:
      - bash
    args:
      - -c
      - |
        echo "INFO: Identifying the language of the application source based on the file extension at:"
        echo $(params.OW_APP_PATH)
        echo "INFO: ls $(params.OW_APP_PATH):"
        ls $(params.OW_APP_PATH)
        echo "INFO: Find files with extension .py, sort displays py if one or more files found: "
        find $(params.OW_APP_PATH) -type f | sed -e 's/.*\.//' | sed -e 's/.*\///' | sort -u | grep ^py$
---
tasks:
  - name: build-backend
    conditions:
      - conditionRef: 'is-python-runtime'
  - name: build-frontend
    conditions:
      - conditionRef: 'is-nodejs-runtime'

GitHub Actions

Infrastructure as code