IgniteUI / igniteui-angular

Ignite UI for Angular is a complete library of Angular-native, Material-based Angular UI components with the fastest grids and charts, Pivot Grid, Dock Manager, Hierarchical Grid, and more.
https://www.infragistics.com/products/ignite-ui-angular
Other
569 stars 162 forks source link

TEKTON pipelines for deployment #14392

Closed mddifilippo89 closed 2 months ago

mddifilippo89 commented 3 months ago

Need steps/guidelines for Tekton,

Need steps on configuration setup Azure pipelines. But a client is using TEKTON pipelines for deployment.

Please assist with the any applicable configuration setup for Tekton.

turbobobbytraykov commented 3 months ago
kind: Secret
metadata:
  name: infragistics-npm-token
type: Opaque
stringData:
  .npmrc: |
    //packages.infragistics.com/npm/js-licensed/:_authToken=${NPM_TOKEN}

---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: npm-service-account
secrets:
  - name: infragistics-npm-token

---
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
  name: infragistics-npm-install-task
spec:
  params:
    - name: NPM_TOKEN
      type: string
  steps:
    - name: configure-npm
      image: node:latest
      script: |
        #!/bin/bash
        echo -n "$NPM_TOKEN" > /tekton/home/.npmrc
        echo "@infragistics:registry=https://packages.infragistics.com/npm/js-licensed/" > /tekton/home/.npmrc
        echo "//packages.infragistics.com/npm/js-licensed/:_authToken=$(params.NPM_TOKEN)" > /tekton/home/.npmrc
    - name: install-dependencies
      image: node:latest
      command: ["npm"]
      args: ["ci"]

---
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
  name: infragistics-npm-install-pipeline
spec:
  tasks:
    - name: infragistics-npm-install
      taskRef:
        name: infragistics-npm-install-task
      params:
        - name: NPM_TOKEN
          valueFrom:
            secretKeyRef:
              name: infragistics-npm-token
              key: .npmrc

This code should suffice to set up the npm cli authentication to our ProGet instance - apart from the Tekton specifics, this is really similar to any other authentication using the npm cli. This code assumes that the Tekton task is executed against a node project whose package.json contains a reference to at least one infragistics npm package.

NB: Ensure you replace ${NPM_TOKEN} in the Secret's stringData with your actual Infragistics npm token. This setup assumes you have the necessary permissions and the token to access Infragistics' npm feed.

In addition, these are technically 4 separate Tekton classes, so they can/should be divided in 4 separate files - the secret, the service account, the task and the pipeline.

You can give the code to the relevant person asking the question so they can try it out. If they encounter any problems, they should give us the output of the npm cli so we can investigate.