Skip to content

Instantly share code, notes, and snippets.

@unkray
Forked from shaliko/.gitlab-ci.yml
Last active December 14, 2020 07:44
Show Gist options
  • Select an option

  • Save unkray/43a143ba51c370489f8ced4d9c6280f9 to your computer and use it in GitHub Desktop.

Select an option

Save unkray/43a143ba51c370489f8ced4d9c6280f9 to your computer and use it in GitHub Desktop.

Revisions

  1. unkray revised this gist Dec 14, 2020. 1 changed file with 3 additions and 8 deletions.
    11 changes: 3 additions & 8 deletions .gitlab-ci.yml
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,6 @@
    # Take valid private key for $SSH_PRIVATE_KEY variable to the agent store
    # cat .ssh/id_rsa | base64 -w0 >> ./deploy_key

    image: ruby:2.6

    stages:
    @@ -11,10 +14,6 @@ deploy_testing:
    script:
    - which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )
    - eval $(ssh-agent -s)
    # Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store
    # - ssh-add <(echo -e "$SSH_PRIVATE_KEY")
    # Take valid private key
    # cat .ssh/id_rsa | base64 -w0
    - ssh-add <(echo "$SSH_PRIVATE_KEY" | base64 --decode)
    - gem install capistrano
    - cap testing deploy
    @@ -31,10 +30,6 @@ deploy:
    script:
    - which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )
    - eval $(ssh-agent -s)
    # Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store
    # - ssh-add <(echo -e "$SSH_PRIVATE_KEY")
    # Take valid private key
    # cat .ssh/id_rsa | base64 -w0
    - ssh-add <(echo "$SSH_PRIVATE_KEY" | base64 --decode)
    - gem install capistrano
    - cap main deploy
  2. unkray revised this gist Dec 1, 2020. 1 changed file with 14 additions and 10 deletions.
    24 changes: 14 additions & 10 deletions .gitlab-ci.yml
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,12 @@
    image: ruby:2.4
    image: ruby:2.6

    stages:
    - deploy

    deploy_staging:
    deploy_testing:
    environment:
    name: staging
    url: http://staging.host.com/
    name: testing
    url: http://testing.host.com/
    stage: deploy
    script:
    - which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )
    @@ -17,14 +17,16 @@ deploy_staging:
    # cat .ssh/id_rsa | base64 -w0
    - ssh-add <(echo "$SSH_PRIVATE_KEY" | base64 --decode)
    - gem install capistrano
    - cap staging deploy
    - cap testing deploy
    only:
    - develop
    - testing
    tags:
    - deploy_testing

    deploy:
    environment:
    name: production
    url: http://production.host.com/
    name: main
    url: http://main.host.com/
    stage: deploy
    script:
    - which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )
    @@ -35,6 +37,8 @@ deploy:
    # cat .ssh/id_rsa | base64 -w0
    - ssh-add <(echo "$SSH_PRIVATE_KEY" | base64 --decode)
    - gem install capistrano
    - cap production deploy
    - cap main deploy
    only:
    - master
    - main
    tags:
    - deploy
  3. unkray revised this gist Nov 26, 2020. 1 changed file with 15 additions and 4 deletions.
    19 changes: 15 additions & 4 deletions .gitlab-ci.yml
    Original file line number Diff line number Diff line change
    @@ -1,28 +1,39 @@
    image: ruby:2.4

    stages:
    - deploy

    deploy_staging:
    environment: staging
    environment:
    name: staging
    url: http://staging.host.com/
    stage: deploy
    script:
    - which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )
    - eval $(ssh-agent -s)
    # Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store
    - ssh-add <(echo -e “$SSH_PRIVATE_KEY”)
    # - ssh-add <(echo -e "$SSH_PRIVATE_KEY")
    # Take valid private key
    # cat .ssh/id_rsa | base64 -w0
    - ssh-add <(echo "$SSH_PRIVATE_KEY" | base64 --decode)
    - gem install capistrano
    - cap staging deploy
    only:
    - develop

    deploy:
    environment: production
    environment:
    name: production
    url: http://production.host.com/
    stage: deploy
    script:
    - which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )
    - eval $(ssh-agent -s)
    # Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store
    - ssh-add <(echo -e “$SSH_PRIVATE_KEY”)
    # - ssh-add <(echo -e "$SSH_PRIVATE_KEY")
    # Take valid private key
    # cat .ssh/id_rsa | base64 -w0
    - ssh-add <(echo "$SSH_PRIVATE_KEY" | base64 --decode)
    - gem install capistrano
    - cap production deploy
    only:
  4. unkray revised this gist Nov 26, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion .gitlab-ci.yml
    Original file line number Diff line number Diff line change
    @@ -24,6 +24,6 @@ deploy:
    # Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store
    - ssh-add <(echo -e “$SSH_PRIVATE_KEY”)
    - gem install capistrano
    - cap staging deploy
    - cap production deploy
    only:
    - master
  5. @shaliko shaliko created this gist Aug 21, 2017.
    29 changes: 29 additions & 0 deletions .gitlab-ci.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@
    image: ruby:2.4
    stages:
    - deploy

    deploy_staging:
    environment: staging
    stage: deploy
    script:
    - which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )
    - eval $(ssh-agent -s)
    # Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store
    - ssh-add <(echo -e “$SSH_PRIVATE_KEY”)
    - gem install capistrano
    - cap staging deploy
    only:
    - develop

    deploy:
    environment: production
    stage: deploy
    script:
    - which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )
    - eval $(ssh-agent -s)
    # Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store
    - ssh-add <(echo -e “$SSH_PRIVATE_KEY”)
    - gem install capistrano
    - cap staging deploy
    only:
    - master