This message was deleted.
# general
s
This message was deleted.
s
weird. what's your gitlab-ci file look like?
f
#
# 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: - master
basically the sample from the website with some packages added (bash and curl)
s
The reason for your error is because the
docker: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.
f
thank you, will try this!
Got it working with an Ubuntu image and some changes to my Setup script (like install curl)
But I wonder if I can‘t take the pulumi docker image or build my own image but that’s something to try later
s
you definitely can build your own image. that's how I'm doing it since my jobs require other dependencies as well. just a tip for building your own image, make sure you move the binary into a dir already part of
PATH
, e.g.
Copy code
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.
Copy code
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