Skip to content

Commit

Permalink
ci: python和task-runner合并
Browse files Browse the repository at this point in the history
  • Loading branch information
liuruibin committed Jul 1, 2024
1 parent f17fe66 commit fad9af8
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/task-runner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: runner-push-to-fit2cloud

on:
push:
branches:
- v3.x
paths:
- "Dockerfile.runner"
workflow_dispatch:

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Prepare
id: prepare
run: |
DOCKER_IMAGE=registry.fit2cloud.com/metersphere/task-runner
DOCKER_PLATFORMS=linux/amd64,linux/arm64
TAG_NAME=3.x-python
DOCKER_IMAGE_TAGS="--tag ${DOCKER_IMAGE}:${TAG_NAME}"
echo ::set-output name=docker_image::${DOCKER_IMAGE}
echo ::set-output name=version::${TAG_NAME}
echo ::set-output name=buildx_args::--platform ${DOCKER_PLATFORMS} \
--build-arg VERSION=${TAG_NAME} \
--build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \
--build-arg --no-cache \
--build-arg VCS_REF=${GITHUB_SHA::8} \
-f Dockerfile.runner \
${DOCKER_IMAGE_TAGS} .
- name: Set up Docker Buildx
uses: crazy-max/ghaction-docker-buildx@v3
- name: Docker Buildx (build)
run: |
docker buildx build --output "type=image,push=false" ${{ steps.prepare.outputs.buildx_args }}
- name: Login to Registry
uses: docker/login-action@v2
with:
registry: registry.fit2cloud.com
username: ${{ secrets.FIT2CLOUD_REGISTRY_USERNAME }}
password: ${{ secrets.FIT2CLOUD_REGISTRY_PASSWORD }}
- name: Docker Buildx (push)
run: |
docker buildx build --output "type=image,push=true" ${{ steps.prepare.outputs.buildx_args }}
19 changes: 19 additions & 0 deletions Dockerfile.runner
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
ARG IMG_TAG=v3.x

FROM registry.fit2cloud.com/metersphere/metersphere-ce:${IMG_TAG} as task-runner


FROM registry.fit2cloud.com/metersphere/graalpy-community:3.10

COPY --from=task-runner /metersphere /metersphere
COPY --from=task-runner /task-runner /task-runner
COPY --from=task-runner /result-hub /result-hub
COPY --from=task-runner /shells /shells
COPY --from=task-runner /standalone /standalone
COPY --from=task-runner /deployments /deployments
COPY --from=task-runner /opt/jmeter /opt/jmeter

RUN yum install -y java-21-openjdk

RUN useradd -m appuser
RUN echo 'appuser:appuser' | chpasswd

0 comments on commit fad9af8

Please sign in to comment.