ibm-cloud-architecture / Learning-Kabanero-101

Tutorials for Cloud Native with Cloud Pak for Applications
https://ibm-cloud-architecture.github.io/Learning-Kabanero-101
Other
3 stars 9 forks source link

Make the customize pipeline guide to use APPSODY_TEST env var #48

Closed csantanapr closed 5 years ago

csantanapr commented 5 years ago

sudo example

apiVersion: tekton.dev/v1alpha1
kind: Task
metadata:
  name: CollectionId-build-task
spec:
  inputs:
    resources:
      - name: git-source
        type: git
  outputs:
    resources:
      - name: docker-image
        type: image
  steps:
    - name: assemble-extract
      securityContext:
        privileged: true
      image: kabanero/java-spring-boot2:0.3
      command:
        [
          "/bin/bash",
          "-c",
          "pushd / && rm -r /project/user-app && ln -s /workspace/git-source /project/user-app && popd && ls && $APPSODY_TEST",
        ]
      env:
        - name: gitsource
          value: git-source
      volumeMounts:
        - mountPath: /var/lib/containers
          name: varlibcontainers
  volumes:
    - name: varlibcontainers
      emptyDir: {}
csantanapr commented 5 years ago

The java test tasks should look like this, and we can remove a lot of things we don't need

apiVersion: tekton.dev/v1alpha1
kind: Task
metadata:
  name: java-spring-boot2-test-task
spec:
  inputs:
    resources:
      - name: git-source
        type: git
  steps:
    - name: test
      image: kabanero/java-spring-boot2:0.3
      workingdir: ${inputs.resources.git-source.path}
      command: ["/bin/bash", "-c", "$APPSODY_TEST"]
csantanapr commented 5 years ago

reviewed the nodejs also and I think it should look like this

apiVersion: tekton.dev/v1alpha1
kind: Task
metadata:
  name: csantana-nodejs-express-build-task
spec:
  inputs:
    resources:
      - name: git-source
        type: git
  steps:
    - name: npm-test
      image: kabanero/nodejs-express:0.2
      workingDir: /project
      command:
        [
          "/bin/bash",
          "-c",
          "cp -a ${inputs.resources.git-source.path}/* $APPSODY_WATCH_DIR && $APPSODY_INSTALL && echo $APPSODY_TEST >/tmp/test.sh && source /tmp/test.sh",
        ]
csantanapr commented 5 years ago

I open an issue in kabanero to discuss test tasks in collections https://github.com/kabanero-io/collections/issues/132

Hemankita commented 5 years ago

Updated the java workflows