Files
singh3/ci/pipeline.yml
Amneesh Singh 60adc1e937 test
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2022-10-23 04:14:15 +05:30

86 lines
1.8 KiB
YAML

resource_types:
- name: nomad
type: registry-image
source:
repository: natto17/concourse-nomad-resource
tag: latest
resources:
- name: image
type: registry-image
icon: docker
source:
repository: ((docker.user))/singh3
tag: latest
username: ((docker.user))
password: ((docker.pass))
- name: nomad-job
type: nomad
source:
url: https://nomad.weirdnatto.in
name: singh3
token: ((nomad.token))
consul_token: ((nomad.consul))
vault_token: ((nomad.vault))
- name: repo
type: git
icon: discord
source:
uri: https://git.weirdnatto.in/natto1784/singh3.git
branch: master
- name: nix
type: registry-image
icon: docker
source:
repository: nixos/nix
tag: latest
jobs:
- name: configure-self
public: true
plan:
- get: repo
trigger: true
- set_pipeline: self
file: repo/ci/pipeline.yml
- name: singh3
plan:
- get: repo
trigger: true
passed: [configure-self]
- get: nix
trigger: false
- task: build
image: nix
config:
params:
CACHIX_NAME: ((cachix.name))
CACHIX_AUTH_TOKEN: ((cachix.token))
inputs:
- name: repo
outputs:
- name: upload
platform: linux
run:
path: sh
args:
- -c
- |
nix-env -iA nixpkgs.cachix nixpkgs.gzip
cachix use $CACHIX_NAME
cachix watch-exec pain nix -- --extra-experimental-features "nix-command flakes" build ./repo
nix --extra-experimental-features "nix-command flakes" build ./repo#image -o result
gzip -cd < $(readlink result) > ./upload/image.tar
- put: image
inputs: [upload]
params:
image: upload/image.tar
- put: nomad-job
params:
job_path: repo/singh3.nomad
templating: false
restart: true