Create a gist now

Instantly share code, notes, and snippets.

@callmekohei / Secret
Last active Jul 11, 2017

What would you like to do?

Travis to Github


    folder A
    ->  repository A
    ->  Travis
    ->  repository B


gem install travis


go to folder A

$ travis login

create ssh pair keys

$ ssh-keygen -f deploy_key

add public key to Github repository

$ cat

Github repository B : Setting -> Deploy keys

encrypt key

$ travis encrypt-file deploy_key

openssl aes-256-cbc -K $encrypted_b811b6a1fc44_key -iv $encrypted_b811b6a1fc44_iv -in deploy_key.enc -out deploy_key -d



.travis.yaml ( sample )

  # prepare
  - openssl aes-256-cbc -K $encrypted_b811b6a1fc44_key -iv $encrypted_b811b6a1fc44_iv -in deploy_key.enc -out ~/.ssh/id_rsa -d
  - chmod 600 ~/.ssh/id_rsa
  - echo -e "Host"                >> ~/.ssh/config
  - echo -e "\n\tUser git"                   >> ~/.ssh/config
  - echo -e "\n\tStrictHostKeyChecking no"   >> ~/.ssh/config
  - echo -e "\n\tIdentityFile ~/.ssh/id_rsa" >> ~/.ssh/config
  - echo -e "\n\tIdentitiesOnly yes"         >> ~/.ssh/config
  - echo -e "\n\tForwardAgent yes"           >> ~/.ssh/config
  - git config --global ""
  - git config --global "callmekohei"
  # git operations
  - cd ..
  - git clone
  - rm -rf ./deoplete-fsharp-bin/bin_deopletefs
  - cp -rf ./deopletefs/bin_deopletefs ./deoplete-fsharp-bin/
  - cd ./deoplete-fsharp-bin
  - git add --all
  - git commit -m "by Travis CI (JOB $TRAVIS_JOB_NUMBER)"
  - git push origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment