Skip to content
Snippets Groups Projects
Commit debbc588 authored by Bryan BRANCOTTE's avatar Bryan BRANCOTTE
Browse files

trigger pipeline on r and python example branch

parent 26d5add8
Branches
No related tags found
No related merge requests found
Pipeline #106639 canceled
...@@ -20,51 +20,67 @@ build: ...@@ -20,51 +20,67 @@ build:
export VERSIONS_TAG="${R_VERSION}--${SHINY_SERVER_VERSION}" export VERSIONS_TAG="${R_VERSION}--${SHINY_SERVER_VERSION}"
fi fi
fi fi
- apk add gettext
- envsubst < ./Dockerfile.$LANGUAGE > Dockerfile
# pull the latest build # pull the latest build
- docker pull "$CI_REGISTRY_IMAGE:latest" || true - docker pull "$CI_REGISTRY_IMAGE/${LANGUAGE}:latest" || true
# pull the latest build of the targeted versions # pull the latest build of the targeted versions
- docker pull "$CI_REGISTRY_IMAGE:$VERSIONS_TAG" || true - docker pull "$CI_REGISTRY_IMAGE/${LANGUAGE}:$VERSIONS_TAG" || true
# pull the latest build of the target R version in order to re-use it for the targeted SHINY_SERVER_VERSION # pull the latest build of the target R version in order to re-use it for the targeted SHINY_SERVER_VERSION
- docker pull "$CI_REGISTRY_IMAGE:$R_VERSION" || true - docker pull "$CI_REGISTRY_IMAGE/${LANGUAGE}:$R_VERSION" || true
# pull the latest build of main # pull the latest build of main
- docker pull "$CI_REGISTRY_IMAGE/main:latest" || true - docker pull "$CI_REGISTRY_IMAGE/${LANGUAGE}/main:latest" || true
# pull the latest build of this branch # pull the latest build of this branch
- docker pull "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:latest" || true - docker pull "$CI_REGISTRY_IMAGE/${LANGUAGE}/$CI_COMMIT_REF_SLUG:latest" || true
# build the image while passing commit SHA and versions, and tagging the image with them # build the image while passing commit SHA and versions, and tagging the image with them
- docker build - docker build
--build-arg R_VERSION --build-arg R_VERSION
--build-arg SHINY_SERVER_VERSION --build-arg SHINY_SERVER_VERSION
--cache-from "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:latest" --cache-from "$CI_REGISTRY_IMAGE/${LANGUAGE}/$CI_COMMIT_REF_SLUG:latest"
--cache-from "$CI_REGISTRY_IMAGE/main:latest" --cache-from "$CI_REGISTRY_IMAGE/${LANGUAGE}/main:latest"
--cache-from "$CI_REGISTRY_IMAGE:$VERSIONS_TAG" --cache-from "$CI_REGISTRY_IMAGE/${LANGUAGE}:$VERSIONS_TAG"
--cache-from "$CI_REGISTRY_IMAGE:$R_VERSION" --cache-from "$CI_REGISTRY_IMAGE/${LANGUAGE}:$R_VERSION"
--cache-from "$CI_REGISTRY_IMAGE:latest" --cache-from "$CI_REGISTRY_IMAGE/${LANGUAGE}:latest"
--tag "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:$CI_COMMIT_SHA" --tag "$CI_REGISTRY_IMAGE/${LANGUAGE}/$CI_COMMIT_REF_SLUG:$CI_COMMIT_SHA"
--tag "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:latest" --tag "$CI_REGISTRY_IMAGE/${LANGUAGE}/$CI_COMMIT_REF_SLUG:latest"
--tag "$CI_REGISTRY_IMAGE:$VERSIONS_TAG" --tag "$CI_REGISTRY_IMAGE/${LANGUAGE}:$VERSIONS_TAG"
--tag "$CI_REGISTRY_IMAGE:$VERSIONS_TAG--$CI_COMMIT_SHORT_SHA" --tag "$CI_REGISTRY_IMAGE/${LANGUAGE}:$VERSIONS_TAG--$CI_COMMIT_SHORT_SHA"
-f Dockerfile -f Dockerfile
./ ./
# push image as latest for the current branch # push image as latest for the current branch
- docker push "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:latest" - docker push "$CI_REGISTRY_IMAGE/${LANGUAGE}/$CI_COMMIT_REF_SLUG:latest"
# push image tagged with its sha # push image tagged with its sha
- docker push "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:$CI_COMMIT_SHA" - docker push "$CI_REGISTRY_IMAGE/${LANGUAGE}/$CI_COMMIT_REF_SLUG:$CI_COMMIT_SHA"
- | - |
if [ "main" == "${CI_COMMIT_REF_SLUG}" ]; then if [ "main" == "${CI_COMMIT_REF_SLUG}" ]; then
# push image tagged with its versions # push image tagged with its versions
docker push "$CI_REGISTRY_IMAGE:$VERSIONS_TAG" docker push "$CI_REGISTRY_IMAGE/${LANGUAGE}:$VERSIONS_TAG"
# push image tagged with its versions and the commit sha (debug purpose) # push image tagged with its versions and the commit sha (debug purpose)
docker push "$CI_REGISTRY_IMAGE:$VERSIONS_TAG--$CI_COMMIT_SHORT_SHA" docker push "$CI_REGISTRY_IMAGE/${LANGUAGE}:$VERSIONS_TAG--$CI_COMMIT_SHORT_SHA"
fi fi
parallel: parallel:
matrix: matrix:
- R_VERSION: ["latest"] - R_VERSION: ["latest"]
# R_VERSION: ["3.6.3", "4.2.3", "latest"] # R_VERSION: ["3.6.3", "4.2.3", "latest"]
SHINY_SERVER_VERSION: ["latest"] SHINY_SERVER_VERSION: ["latest"]
LANGUAGE: ["r"]
- R_VERSION: ["latest"]
# R_VERSION: ["3.6.3", "4.2.3", "latest"]
SHINY_SERVER_VERSION: ["latest"]
LANGUAGE: ["python"]
PYTHON_VERSION: ["3.9-slim-bullseye"]
trigger_r_example:
needs: ["build"]
trigger:
project: hub/rshiny-k8s-example
branch: base-r
trigger_job: trigger_python_example:
needs: ["build"] needs: ["build"]
trigger: trigger:
project: hub/rshiny-k8s-example project: hub/rshiny-k8s-example
branch: base-python
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment