Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For kubernetes pass commands direct to pods #3216

Closed

Conversation

6543
Copy link
Member

@6543 6543 commented Jan 18, 2024

try to not create and encode a script but pass commands directly to pots inside kubernetes

@6543 6543 added enhancement improve existing features wip backend/kubernetes build_pr_images If set, the CI will build images for this PR and push to Dockerhub labels Jan 18, 2024
@6543
Copy link
Member Author

6543 commented Jan 18, 2024

-> need to be tested @zc-devs ?

Copy link

codecov bot commented Jan 19, 2024

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (b82790d) 35.38% compared to head (17841e1) 35.45%.

Files Patch % Lines
pipeline/backend/kubernetes/pod.go 75.00% 4 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3216      +/-   ##
==========================================
+ Coverage   35.38%   35.45%   +0.07%     
==========================================
  Files         226      226              
  Lines       14901    14925      +24     
==========================================
+ Hits         5272     5291      +19     
- Misses       9238     9242       +4     
- Partials      391      392       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@zc-devs
Copy link
Contributor

zc-devs commented Jan 19, 2024

Pipeline:

steps:
  one:
    image: alpine
    commands:
      - echo $CI_COMMIT_SHA
  two:
    image: debian
    commands:
      - cat /etc/os-release
      - id
      - echo $$CI_COMMIT_BRANCH
  three:
    image: debian
    commands:
      - echo Setting up Docker registry authentication
      - AUTH=$(printf '%s:%s' "DOCKER_USR" "DOCKER_PWD" | base64 -w 0)
      - DOCKER_AUTHS=$(printf '{"auths":{"%s":{"auth":"%s"}}}' "$REGISTRY" "$AUTH")
      - printf '%s' "$DOCKER_AUTHS" > "config.json"

1-pod-clone.yaml:

+ git init -b pull_3216
Initialized empty Git repository in /woodpecker/src/gitea.test.smthd.com/usr/wp-test/.git/
+ git config --global --replace-all safe.directory /woodpecker/src/gitea.test.smthd.com/usr/wp-test
+ git remote add origin https://gitea.test.smthd.com/usr/wp-test.git
+ git fetch --no-tags --depth=1 --filter=tree:0 origin +af75d00cd55ff9a43e6de89394ff417294367569:
From https://gitea.test.smthd.com/usr/wp-test
 * branch            af75d00cd55ff9a43e6de89394ff417294367569 -> FETCH_HEAD
+ git reset --hard -q af75d00cd55ff9a43e6de89394ff417294367569
+ git submodule update --init --recursive --depth=1 --recommend-shallow
+ git lfs fetch
fetch: Fetching reference refs/heads/pull_3216
+ git lfs checkout

2-pod-one.yaml:

+ echo $CI_COMMIT_SHA

3-pod-two.yaml:

+ cat /etc/os-release

4-pod-three.yaml:

+ echo Setting up Docker registry authentication

woodpecker-agent.log

@6543
Copy link
Member Author

6543 commented Jan 19, 2024

Hmm so we still depend on script generation :/

As only the first command gets exec

@6543 6543 closed this Jan 20, 2024
@6543 6543 deleted the kubernetes/pass-commands-directly branch January 20, 2024 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend/kubernetes build_pr_images If set, the CI will build images for this PR and push to Dockerhub enhancement improve existing features wip
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants