Minimal Starter Pipeline

Minimal build-test-deploy Pipeline

Minimum starter pipeline

  • code-repo - repo with the code to build and test
  • artifact - s3 location to which a built tarball will go

This pipeline

  • "performs a build",
  • creates a tarball with the build artifact
  • uploads the resulting tarball to S3
resources:
- name: code-repo
type: git
source:
branch: main
private_key: ((deploy_key))
uri: git@gitlab.com:myorg/myrepo.git
- name: artifact
type: s3
source:
access_key_id: ((aws_access))
secret_access_key: ((aws_secret))
bucket: trullla-artifacts
initial_path: mypackage/mypackage-1234567890.tar.gz
regexp: mypackage/mypackage-(.*).tar.gz
region_name: us-east-1
jobs:
- name: build-and-package
plan:
- get: code-repo
- task: build
config:
platform: linux
image_resource:
type: docker-image
source:
repository: alpine
params:
PACKAGE_NAME: mypackage
inputs:
- name: code-repo
outputs:
- name: tarball
run:
path: /bin/sh
args:
- -c
- |
set -e
TIMESTAMP="$(date +%s)"
PACKAGE="${PACKAGE_NAME}-${TIMESTAMP}"
cd code-repo
# do the building, e.g.
mkdir build
cp *.* build
cd -
cp -a code-repo/build "${PACKAGE}"
tar czf tarball/"${PACKAGE}.tar.gz" "${PACKAGE}"
- put: artifact
params:
file: tarball/*.tar.gz