Created
August 9, 2018 21:34
-
-
Save roberthamel/1823c0d151405af5c6633abc23d0d52c to your computer and use it in GitHub Desktop.
Deploy to cf Task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ci/scripts/build.sh | |
set -eu | |
pushd source-code | |
./gradlew clean assemble | |
cp build/libs/product-service-1.0.0.jar ../build-output | |
cp manifest.yml ../build-output | |
popd | |
echo "build successful" | |
echo "deploying now..." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ci/tasks/build.yml | |
--- | |
platform: linux | |
image_resource: | |
type: docker-image | |
source: | |
repository: openjdk | |
tag: 8 | |
inputs: | |
- name: source-code | |
outputs: | |
- name: build-output | |
run: | |
path: source-code/ci/scripts/build.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ci/credentials.yml | |
gitRepository: https://github.com/<YOUR-GITHUB-USERNAME>/product-service-concourse | |
CFUsername: <YOUR-CF-USERNAME> | |
CFPassword: "<YOUR-CF-PASSWORD>" | |
CFOrg: <YOUR-CF-ORG> | |
CFSpace: <YOUR-CF-SPACE> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ci/pipeline.yml | |
--- | |
resources: | |
- name: source-code | |
type: git | |
check_every: 10s | |
source: | |
uri: ((gitRepository)) | |
branch: master | |
- name: deploy-cf | |
type: cf | |
source: | |
api: https://api.sys.apbg.apcf.io | |
username: ((CFUsername)) | |
password: ((CFPassword)) | |
organization: ((CFOrg)) | |
space: ((CFSpace)) | |
skip_cert_check: false | |
jobs: | |
- name: test | |
plan: | |
- get: source-code | |
trigger: true | |
- task: test | |
file: source-code/ci/tasks/test.yml | |
- name: build-and-deploy | |
plan: | |
- get: source-code | |
passed: [test] | |
trigger: true | |
- task: build | |
file: source-code/ci/tasks/build.yml | |
- put: deploy-cf | |
params: | |
manifest: build-output/manifest.yml | |
path: build-output/product-service-1.0.0.jar |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ci/scripts/test.sh | |
set -eu | |
pushd source-code | |
ls -lah | |
./gradlew test | |
popd | |
echo "all tests pass" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ci/tasks/test.yml | |
--- | |
platform: linux | |
image_resource: | |
type: docker-image | |
source: | |
repository: openjdk | |
tag: 8 | |
inputs: | |
- name: source-code | |
run: | |
path: source-code/ci/scripts/test.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment