Closed bbrala closed 7 years ago
@bbrala On custom images, we do not automatically switch language versions for you because we don't know what's available in the image.
We make the language version from the YML available in an environment variable called SHIPPABLE_PHP_VERSION
but it's up to you how to use that in your image to switch versions.
So the exact answer to your question really depends on how you've installed multiple PHP versions in your image. For example, we use phpenv
to do this.
Oh, I misunderstood... you want the image tag to be based on the PHP version. Let me get back to you on this.
:) cool thanks. Thing is i just dont get the correct filtered matrix to work.
OK, I think I have a way to unblock you but it's not pretty:
language: php
env:
global:
# Hipchat config
- PROJECT="Some project"
matrix:
- IMAGE=php7.0
- IMAGE=php7.1
matrix:
exclude:
- php: "5.6"
include:
- php: "7.0"
env: IMAGE=php7.0
- php: "7.1"
env: IMAGE=php7.1
build:
pre_ci:
- echo $IMAGE
pre_ci_boot:
image_name: ragesh/foo
image_tag: $IMAGE
ci:
- echo "Hello, world"
This gets you what you're looking for, but it's an elaborate workaround for the fact that we're not exporting the language version for the pre_ci_boot scripts. I'll add this to our backlog, but hopefully the YML above will help you until we fix this.
Yeah that is pretty nasty :)
I think i rather wait for the implementation. Do you have a way to notify me when it is implemented? Perhaps add it to the userstory in your system?
Sure. We'll update this issue as soon as it's available.
Quick update -- we are planning to make this fix available before the end of the week.
@bbrala This now works as you would expect it to:
language: php
php:
- "7.0"
- "7.1"
build:
pre_ci:
- echo The PHP version is $SHIPPABLE_PHP_VERSION
- docker tag drydock/u16phpall:master drydock/u16phpall:v$SHIPPABLE_PHP_VERSION
pre_ci_boot:
image_name: drydock/u16phpall
image_tag: v$SHIPPABLE_PHP_VERSION
ci:
- echo "Hello, World!"
$SHIPPABLE_PHP_VERSION
(and all of the other language-specific env variables) are now available for use in the pre_ci
and pre_ci_boot
sections of the YML.
awesome, thanks. :)
Im trying to get a matrix build going for PHP on a custom image. The tag should be based on the language version. I've tried quite a few things, bug cant seem to get it working as it should.
I would like to use
and use that to set the image tag in the
pre_ci_boot
section. THe follwing works but id like to have the correct php version in the overviewI also tried things as:
and a few different variations using matrix -> include. I also tried using
image_tag: ${SHIPPABLE_PHP_VERSION}
but it seems that variable is not available on the build host.Can you point met in the right direction? I just want 2 builds on 2 different tags and have the correct PHP version in the interface :)