Skip to content

Instantly share code, notes, and snippets.

@taking
Last active June 16, 2022 03:18
Show Gist options
  • Save taking/0c141930d1b5efced0ceaae1765f6d23 to your computer and use it in GitHub Desktop.
Save taking/0c141930d1b5efced0ceaae1765f6d23 to your computer and use it in GitHub Desktop.

Pipeline

repo pull/push
Access Token 발급

image image

.gitlab-ci.yaml
# CI 순서 설정
stages:
  - create-deploy-yaml
  
create-deploy-yaml:
  image: alpine/git:latest
  stage: create-deploy-yaml
  before_script:
    - git config --global user.name "${GITLAB_USER_NAME}"
    - git config --global user.email "${GITLAB_USER_EMAIL}"
    - git config --global http.sslverify "false"
  script:
    # Pull repo
    - git clone ${CI_REPOSITORY_URL}
    - ls -al

    - touch test  
    - git add .
    - git commit -m "Auto Commit at `date +'%Y-%m-%d %H:%M:%S'` " || true
    - git push ${CI_SERVER_PROTOCOL}://gitlab-ci-token:${ACCESS_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}.git HEAD:${CI_COMMIT_REF_NAME} || true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment