Skip to content

GitLab

    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
    • Menu
    Projects Groups Snippets
  • Sign up now
  • Login
  • Sign in / Register
  • S ssh-private-key
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 9
    • Issues 9
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 7
    • Merge requests 7
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab-examples
  • ssh-private-key
  • Issues
  • #4
Closed
Open
Created Jun 27, 2017 by Folyd@Folyd

Didn't work in alpine version image

Hi, did you try with alpine version image? I can't get it done with alpine version image. here is my .gitlab-ci.yal

deploy:
  stage: deploy
  script:
     - which ssh-agent || apk add --no-cache openssh-client
     - eval `ssh-agent -s`
     - sshecho $SSH_PRIVATE_KEY | ssh-add
     - echo -e Host $PRODUCTION_HOST_IP >> ~/.ssh/config
     - echo -e '\tStrictHostKeyChecking no' >> ~/.ssh/config
     - ssh $PRODUCTION_USERNAME@$PRODUCTION_HOST_IP 'do someting stuff'
  only:
    - master
Assignee
Assign to
Time tracking