Commit 9cfe1dec authored by Rémi's avatar Rémi
Browse files

Initial commit

parents
No related merge requests found
Pipeline #52133 passed with stage
in 2 minutes and 25 seconds
Showing with 48 additions and 0 deletions
+48 -0
variables:
VERSION: latest
stages:
- docker
Build docker image:
stage: docker
image: docker/compose:1.29.2
allow_failure: false
tags: [ dind ]
variables:
IMG_LATEST: $CI_REGISTRY_IMAGE:latest
IMG_VERSION: $CI_REGISTRY_IMAGE:$VERSION
DOCKER_TLS_CERTDIR: ""
DOCKER_HOST: tcp://docker:2375
services:
- name: docker:dind
command: [ dockerd, '-H', 'tcp://0.0.0.0:2375' ]
before_script:
- echo -n $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY
script:
- docker build --tag $IMG_VERSION .
- docker push $IMG_VERSION
- docker tag $IMG_VERSION $IMG_LATEST
- docker push $IMG_LATEST
Dockerfile 0 → 100644
FROM python:3.10-slim
COPY script.py /app/script.py
RUN chmod +x /app/script.py
ARG USER=bee
ENV HOME /home/$USER
RUN adduser $USER
USER $USER
WORKDIR $HOME
script.py 0 → 100644
#!/usr/bin/env python
import os
import json
items_file = os.environ["ITEMS_FILE"]
assert os.path.isfile(items_file)
index = os.environ["INDEX"]
assert index.isdigit()
index = int(index)
with open(items_file) as user_file:
jobs = json.load(user_file)
assert index < len(jobs)
job = jobs[index]
print(f"Hello from task#{index}, job is: {job}")
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment