sparse-intern-71089
01/03/2020, 4:21 PMsteep-toddler-94095
01/03/2020, 11:24 PMfuture-yak-43516
01/04/2020, 1:52 PM#
# This sample yaml configuration file contains two stages and three jobs.
# This configuration uses GitLab's only
, when
, and except
configuration
# options to create a pipeline that will create the pulumi-preview
job in the pipeline,
# for all branches except the master.
# Only for master branch merges, the main pulumi
job is executed automatically.
stages:
- build
- infrastructure-update
# Each stage may require multiple jobs to complete that stage.
# Consider a build stage, which may require building the UI, service, and a CLI.
# All 3 individual build jobs can be attributed to the build stage.
complex_build_job:
stage: build
script:
- echo "pulumi rocks!"
pulumi:
stage: infrastructure-update
before_script:
- apk update
- apk add bash
- apk add curl
- chmod +x ./*.sh
- ./setup.sh
script:
- ./run-pulumi.sh
# Create an artifact archive with just the pulumi log file,
# which is created using console-redirection in run-pulumi.sh.
artifacts:
paths:
- pulumi-log.txt
# This is just a sample of how artifacts can be expired (removed) automatically in GitLab.
# You may choose to not set this at all based on your organization's or team's preference.
expire_in: 1 week
# This job should only be created if the pipeline is created for the master branch.
only:
- masterfuture-yak-43516
01/04/2020, 1:53 PMsteep-toddler-94095
01/04/2020, 9:49 PMdocker:stable
image that your job is running in doesn't have the correct interpreter to execute the binary file. If you run apk add libc6-compat
before pulumi login
, it should work.
But as you can see from the apt-get
commands in the provided setup.sh
script, the example is assuming you are running the job in a debian/ubuntu image. I'd recommend setting that as your default job image. It looks like the page you are following was intentionally not written to be a complete example.future-yak-43516
01/04/2020, 10:26 PMfuture-yak-43516
01/05/2020, 7:12 AMfuture-yak-43516
01/05/2020, 7:13 AMsteep-toddler-94095
01/05/2020, 7:32 AMPATH
, e.g.
FROM ubuntu:16.04
RUN curl -fsSL <https://get.pulumi.com> | sh && \
mv $HOME/.pulumi/bin/* /usr/bin
and you can have a gitlab build step for the cicd image, e.g.
variables:
cicdImageVersion: 1.0.0 # this needs to be updated manually if there's a change to the cicd dockerfile
build_cicd_docker_image:
stage: prepare
image: docker:stable
services:
- docker:dind
only:
refs:
- merge_requests
changes:
- cicd.Dockerfile
script: |
docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN <http://registry.gitlab.com|registry.gitlab.com>
imageUri=<http://registry.gitlab.com/blahblah/cicd:$cicdImageVersion|registry.gitlab.com/blahblah/cicd:$cicdImageVersion>
if ! DOCKER_CLI_EXPERIMENTAL=enabled docker manifest inspect $imageUri; then
docker build -t $imageUri -f cicd.Dockerfile .
docker push $imageUri
fi