agreeable-ram-97887
03/25/2021, 5:12 PMpulumi up
/ pulumi preview
in a gitlab CICD script with docker resources? If so would you mind sharing how you've configured your pipeline? Or at least giving some hint about the "right" way to do it.
When I try this myself, I unfortunately keep getting the error FileNotFoundError: [Errno 2] No such file or directory: 'docker': 'docker'
, and I'm not sure what to make of that 🤔billowy-army-68599
03/25/2021, 5:14 PMagreeable-ram-97887
03/25/2021, 5:35 PMimage: python:3.7.9-buster
before_script:
- apt-get update -y
- apt-get install sudo -y
- python3 -m venv infra/venv
- infra/venv/bin/python -m pip install --upgrade pip setuptools wheel
- infra/venv/bin/python -m pip install -r infra/requirements.txt
- bash ./pulumiSetup/setup.sh
stages:
- preview
- deploy
pulumi-preview:
stage: preview
services:
- docker:dind
script:
- bash ./pulumiSetup/pulumi-preview.sh
pulumi-deploy:
stage: deploy
services:
- docker:dind
script:
- bash ./pulumiSetup/pulumi-up.sh
only:
- master
pulumiSetup/setup.sh
is like this:
#!/bin/bash
# exit if a command returns a non-zero exit code
# print the commands and their args as they are executed
set -e -x
# Download and install required tools
# update the GitLab Runner and install other packages
apt-get update -y
apt-get install sudo python3-pip python3-venv unzip wget curl -y
curl -fsSL <https://get.pulumi.com/> | bash
export PATH=$PATH:$HOME/.pulumi/bin
export PULUMI_ACCESS_TOKEN=$PULUMI_ACCESS_TOKEN
# Login into pulumi. This will require the PULUMI_ACCESS_TOKEN environment variable
# pulumi config set --secret pulumi-access-token $PULUMI_ACCESS_TOKEN
pulumi login
curl "<https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip>" -o "awscliv2.zip"
unzip -qq awscliv2.zip
sudo ./aws/install
pulumiSetup/pulumi-preview.sh
is like this:
#!/bin/bash
# exit if a command returns a non-zero exit code
# print the commands and their args as they are executed
set -e -x
# Add the pulumi CLI to the PATH
export PATH=$PATH:$HOME/.pulumi/bin
# AWS creds here - variables with $ to be set on gitlab var env
aws configure set default.region '$AWS_DEFAULT_REGION'
aws configure set aws_access_key_id '$AWS_ACCESS_KEY_ID'
aws configure set aws_secret_access_key '$AWS_SECRET_ACCESS_KEY'
echo $AWS_ACCESS_KEY_ID
echo $AWS_SECRET_ACCESS_KEY
pulumi stack select accure1/dev --cwd "/builds/accure1/code/el/corvus/infra/"
# preview configuration before deployment
pulumi preview --cwd "/builds/accure1/code/el/corvus/infra/"
billowy-army-68599
03/25/2021, 5:41 PMwhite-secretary-18260
03/25/2021, 5:42 PMdocker in docker,
yes.Dockerfile
with:
# SETUP DOCKER
RUN curl -fsSL <https://get.docker.com> -o get-docker.sh
RUN sudo sh get-docker.sh
RUN sudo service docker start
sudo
RUN apt-get install sudo -y
agreeable-ram-97887
03/25/2021, 6:37 PMpulumi preview
call 🤔 . Any ideas?
Btw, the new pulumiSetup/setup.sh
script that im using is (note the additional install docker lines):
#!/bin/bash
# exit if a command returns a non-zero exit code
# print the commands and their args as they are executed
set -e -x
# Download and install required tools
# update the GitLab Runner and install other packages
apt-get update -y
apt-get install sudo python3-pip python3-venv unzip wget curl -y
# SETUP DOCKER
curl -fsSL <https://get.docker.com> -o get-docker.sh
sudo sh get-docker.sh
sudo service docker start
# INSTALL PULUMI
curl -fsSL <https://get.pulumi.com/> | bash
export PATH=$PATH:$HOME/.pulumi/bin
export PULUMI_ACCESS_TOKEN=$PULUMI_ACCESS_TOKEN
# Login into pulumi. This will require the PULUMI_ACCESS_TOKEN environment variable
# pulumi config set --secret pulumi-access-token $PULUMI_ACCESS_TOKEN
pulumi login
curl "<https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip>" -o "awscliv2.zip"
unzip -qq awscliv2.zip
sudo ./aws/install
white-secretary-18260
03/25/2021, 6:49 PM--verbose 999
on there and see what it brings.agreeable-ram-97887
03/25/2021, 7:27 PMpulumi preview
. I'm running it again now with the increased verbosity, so hopefully will have some more info soon. But anyway I guess I'll need to implement some sort of caching of the image getting built