|
@ -0,0 +1,47 @@ |
|
|
|
|
|
--- |
|
|
|
|
|
resources: |
|
|
|
|
|
- name: git-resource |
|
|
|
|
|
type: git |
|
|
|
|
|
icon: git |
|
|
|
|
|
source: |
|
|
|
|
|
uri: ssh://git@git.nulloctet.com:8437/Mirror/github-andreimarcu-linx-server.git |
|
|
|
|
|
private_key: | |
|
|
|
|
|
((pull_key)) |
|
|
|
|
|
branch: master |
|
|
|
|
|
tag_filter: v* |
|
|
|
|
|
- name: git-resource-image |
|
|
|
|
|
type: docker-image |
|
|
|
|
|
icon: docker |
|
|
|
|
|
source: |
|
|
|
|
|
repository: ((nexus_docker_write.host))/sothr/linx |
|
|
|
|
|
username: ((nexus_docker_write.username)) |
|
|
|
|
|
password: ((nexus_docker_write.password)) |
|
|
|
|
|
|
|
|
|
|
|
jobs: |
|
|
|
|
|
- name: build-image |
|
|
|
|
|
plan: |
|
|
|
|
|
- get: git-resource |
|
|
|
|
|
trigger: true |
|
|
|
|
|
- task: generate-tags |
|
|
|
|
|
config: |
|
|
|
|
|
platform: linux |
|
|
|
|
|
image_resource: |
|
|
|
|
|
type: registry-image |
|
|
|
|
|
source: { repository: alpine/git } |
|
|
|
|
|
inputs: |
|
|
|
|
|
- name: git-resource |
|
|
|
|
|
outputs: |
|
|
|
|
|
- name: image-tags |
|
|
|
|
|
run: |
|
|
|
|
|
path: /bin/sh |
|
|
|
|
|
args: |
|
|
|
|
|
- -c |
|
|
|
|
|
- | |
|
|
|
|
|
cd git-resource |
|
|
|
|
|
git describe --tags --abbrev=0 > ../image-tags/tag |
|
|
|
|
|
cat ../image-tags/tag |
|
|
|
|
|
- put: git-resource-image |
|
|
|
|
|
params: |
|
|
|
|
|
build: git-resource |
|
|
|
|
|
tag_file: image-tags/tag |
|
|
|
|
|
tag_as_latest: true |