From 5d5bfa402cf7b48bb80d01cd682b9a73d4898c5f Mon Sep 17 00:00:00 2001 From: hamidval <44161836+hamidval@users.noreply.github.com> Date: Mon, 30 Oct 2023 13:54:32 +0000 Subject: [PATCH 1/2] adding concourse files --- ci/pipeline.yml | 34 ++++++++++++++++++++++++++++++++++ ci/scripts/run_tests.sh | 6 ++++++ ci/scripts/run_tests.yml | 6 ++++++ ci/tasks/run_tests.yml | 15 +++++++++++++++ 4 files changed, 61 insertions(+) create mode 100644 ci/pipeline.yml create mode 100644 ci/scripts/run_tests.sh create mode 100644 ci/scripts/run_tests.yml create mode 100644 ci/tasks/run_tests.yml diff --git a/ci/pipeline.yml b/ci/pipeline.yml new file mode 100644 index 00000000..02b3a514 --- /dev/null +++ b/ci/pipeline.yml @@ -0,0 +1,34 @@ +--- +resource_types: + - name: npm-cache + type: docker-image + source: + repository: ymedlop/npm-cache-resource + tag: latest +resources: + - name: hello_hapi + type: git + source: &repo-source + uri: https://github.com/hamidval/hello_hapi + branch: master + - name: dependency-cache + type: npm-cache + source: + <<: *repo-source + paths: + - package.json +jobs: + - name: Install dependencies + plan: + - get: hello_hapi + trigger: true + - get: dependency-cache + - name: Run tests + plan: + - get: hello_hapi + trigger: true + passed: [Install dependencies] + - get: dependency-cache + passed: [Install dependencies] + - task: run the test suite + file: hello_hapi/ci/tasks/run_tests.yml \ No newline at end of file diff --git a/ci/scripts/run_tests.sh b/ci/scripts/run_tests.sh new file mode 100644 index 00000000..70fc1e76 --- /dev/null +++ b/ci/scripts/run_tests.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +set -e -u -x + +mv dependency-cache/node_modules hello_hapi +cd hello_hapi && npm test \ No newline at end of file diff --git a/ci/scripts/run_tests.yml b/ci/scripts/run_tests.yml new file mode 100644 index 00000000..70fc1e76 --- /dev/null +++ b/ci/scripts/run_tests.yml @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +set -e -u -x + +mv dependency-cache/node_modules hello_hapi +cd hello_hapi && npm test \ No newline at end of file diff --git a/ci/tasks/run_tests.yml b/ci/tasks/run_tests.yml new file mode 100644 index 00000000..1b558d88 --- /dev/null +++ b/ci/tasks/run_tests.yml @@ -0,0 +1,15 @@ +--- +platform: linux + +image_resource: + type: docker-image + source: + repository: node + tag: latest + +inputs: + - name: hello_hapi + - name: dependency-cache + +run: + path: hello_hapi/ci/scripts/run_tests.sh \ No newline at end of file From cc435fadb1374e6f05a296c04bff2beec6c99a30 Mon Sep 17 00:00:00 2001 From: hamidval <44161836+hamidval@users.noreply.github.com> Date: Mon, 30 Oct 2023 14:14:34 +0000 Subject: [PATCH 2/2] changed branch name to pipeline --- ci/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/pipeline.yml b/ci/pipeline.yml index 02b3a514..633792e5 100644 --- a/ci/pipeline.yml +++ b/ci/pipeline.yml @@ -10,7 +10,7 @@ resources: type: git source: &repo-source uri: https://github.com/hamidval/hello_hapi - branch: master + branch: pipeline - name: dependency-cache type: npm-cache source: