All Projects → masutaka → Circleci Bundle Update Pr

masutaka / Circleci Bundle Update Pr

Licence: mit
Provide continues bundle update using CircleCI

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Circleci Bundle Update Pr

Verse
[DEPRECATED] Text transformations
Stars: ✭ 71 (-38.26%)
Mutual labels:  ruby-gem
Garth
🥁 A really basic theme for Jekyll
Stars: ✭ 85 (-26.09%)
Mutual labels:  ruby-gem
Rumbda
Run ruby scripts on aws lambda.
Stars: ✭ 109 (-5.22%)
Mutual labels:  ruby-gem
Openwrt Nanopi R2s
OpenWrt support for FriendlyElec NanoPi R2S RK3328 SoC board with 2x1000Mbps ports. This repository is not a fork of friendlywrt but a fork of upstream/openwrt.
Stars: ✭ 73 (-36.52%)
Mutual labels:  circleci
Circleci Demo Php Laravel
Example CircleCI project using PHP and Laravel
Stars: ✭ 85 (-26.09%)
Mutual labels:  circleci
Circleci Demo Python Django
Example Django application running on CircleCI
Stars: ✭ 100 (-13.04%)
Mutual labels:  circleci
Wikiloop Doublecheck
WikiLoop DoubleCheck: a web tool to help review Wikipedia edits easily and collaboratively.
Stars: ✭ 70 (-39.13%)
Mutual labels:  circleci
Android Livedata Viewmodel
Android app that demonstrates how to use new Architecture components.
Stars: ✭ 114 (-0.87%)
Mutual labels:  circleci
Ci Yarn Upgrade
Keep NPM dependencies up-to-date with CI, providing version-to-version diff for each library
Stars: ✭ 85 (-26.09%)
Mutual labels:  circleci
Terraform Multienv
A template for maintaining a multiple environments infrastructure with Terraform. This template includes a CI/CD process, that applies the infrastructure in an AWS account.
Stars: ✭ 107 (-6.96%)
Mutual labels:  circleci
System tester
A Development Tool for creating and managing system tests for Ruby on Rails >= 5.1 Applications
Stars: ✭ 73 (-36.52%)
Mutual labels:  ruby-gem
Tty Prompt
A beautiful and powerful interactive command line prompt
Stars: ✭ 1,210 (+952.17%)
Mutual labels:  ruby-gem
Sidekiq Cron
Scheduler / Cron for Sidekiq jobs
Stars: ✭ 1,383 (+1102.61%)
Mutual labels:  ruby-gem
Molecule Ansible Docker Aws
Example project showing how to test Ansible roles with Molecule using Testinfra and a multiscenario approach with Docker, Vagrant & AWS EC2 as infrastructure providers
Stars: ✭ 72 (-37.39%)
Mutual labels:  circleci
Presently
Android app for recording gratitude journal entries
Stars: ✭ 109 (-5.22%)
Mutual labels:  circleci
Rubel
Rubel is a cms built with Laravel and React.
Stars: ✭ 70 (-39.13%)
Mutual labels:  circleci
Iri
Simple Immutable URI/URL Builder in Ruby
Stars: ✭ 90 (-21.74%)
Mutual labels:  ruby-gem
Circleci Demo Javascript Express
Sample Javascript/Express app building on CircleCI
Stars: ✭ 115 (+0%)
Mutual labels:  circleci
Drupal8ci
One-line installers for implementing Continuous Integration in Drupal 8
Stars: ✭ 113 (-1.74%)
Mutual labels:  circleci
Circleci Demo Ios
A sample iOS app that builds on CircleCI
Stars: ✭ 103 (-10.43%)
Mutual labels:  circleci

Circleci::Bundle::Update::Pr

Build Status License Gem

circleci-bundle-update-pr is an automation script for continuous bundle update and for sending a pull request using Scheduling a Workflow of CircleCI.

By requesting a nightly build to CircleCI with an environment variable configured in circle.yml or .circleci/config.yml to execute this script, bundle update is invoked, then commit changes and send a pull request to GitHub repository if there some changes exist.

Installation

$ gem install circleci-bundle-update-pr

Prerequisites

The application on which you want to run continuous bundle update must be configured to be built on CircleCI.

Usage

Setting GitHub personal access token to CircleCI

GitHub personal access token is required for sending pull requests to your repository.

  1. Go to your account's settings page and generate a personal access token with "repo" scope
  2. On CircleCI dashboard, go to your application's "Project Settings" -> "Environment Variables"
  3. Add an environment variable GITHUB_ACCESS_TOKEN with your GitHub personal access token
    • If use GitHub Enterprise
      • ENTERPRISE_OCTOKIT_ACCESS_TOKEN with your GitHub Enterprise personal access token
      • ENTERPRISE_OCTOKIT_API_ENDPOINT with your GitHub Enterprise api endpoint (e.g. https://www.example.com/api/v3)

Configure circle.yml

Configure your circle.yml or .circleci/config.yml to run circleci-bundle-update-pr, for example:

version: 2
jobs:
  build:
    # snip
  continuous_bundle_update:
    docker:
      - image: ruby:2.4.2-alpine
    working_directory: /work
    steps:
      - run:
          name: Install System Dependencies
          command: |
            # See also https://circleci.com/docs/2.0/custom-images/#required-tools-for-primary-containers
            apk add --update --no-cache git openssh-client tar gzip ca-certificates \
              tzdata
            gem install -N bundler
      - run:
          name: Set timezone to Asia/Tokyo
          command: cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
      - checkout
      - restore_cache:
          name: Restore bundler cache
          keys:
            - gems-{{ .Environment.COMMON_CACHE_KEY }}-{{ checksum "Gemfile.lock" }}
            - gems-{{ .Environment.COMMON_CACHE_KEY }}-
      - run:
          name: Setup requirements for continuous bundle update
          command: gem install -N circleci-bundle-update-pr
      - deploy:
          name: Continuous bundle update
          command: circleci-bundle-update-pr <username> <email>

workflows:
  version: 2
  build:
    jobs:
      - build:
          # snip
  nightly:
    triggers:
      - schedule:
          cron: "00 10 * * 5"
          filters:
            branches:
              only: master
    jobs:
      - continuous_bundle_update

NOTE: Please make sure you replace <username> and <email> with yours.

circleci-bundle-update-pr regularly updates myself. See also .circleci/config.yml.

CLI command references

General usage:

$ circleci-bundle-update-pr <git username> <git email address>

By default, it works only on master branch, but you can also explicitly specify any branches rather than only master branch by adding them to the arguments.

$ circleci-bundle-update-pr <git username> <git email address> master develop topic

You can also add the following options:

$ circleci-bundle-update-pr -h
Usage: circleci-bundle-update-pr [options]
    -a, --assignees alice,bob,carol  Assign the PR to them
    -r, --reviewers alice,bob,carol  Request PR review to them
    -l, --labels "In Review, Update" Add labels to the PR
    -d, --duplicate                  Make PR even if it has already existed

Tips

Customize PR description

If .circleci/BUNDLE_UPDATE_NOTE.md exists, the content will be appended to PR description.

e.g. .circleci/BUNDLE_UPDATE_NOTE.md is the below.

## Notice

* example1
* example2

PR description will be created as the below.

**Updated RubyGems:**

* [ ] [octokit](https://github.com/octokit/octokit.rb): [`4.9.0...4.10.0`](https://github.com/octokit/octokit.rb/compare/v4.9.0...v4.10.0)
* [ ] [public_suffix](https://github.com/weppos/publicsuffix-ruby): [`3.0.2...3.0.3`](https://github.com/weppos/publicsuffix-ruby/compare/v3.0.2...v3.0.3)

Powered by [circleci-bundle-update-pr](https://rubygems.org/gems/circleci-bundle-update-pr)

---

## Notice

* example1
* example2

.circleci/BUNDLE_UPDATE_NOTE.md or CIRCLECI_BUNDLE_UPDATE_NOTE.md, either one is OK. It gives priority .circleci/BUNDLE_UPDATE_NOTE.md over CIRCLECI_BUNDLE_UPDATE_NOTE.md.

Run on GitHub Actions

Configure your .github/workflows/bundle-update-pr.yml to run circleci-bundle-update-pr, for example:

name: bundle-update-pr

on:
  schedule:
    - cron: "00 10 * * 5" # JST 19:00 (Fri)

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/[email protected]

      - name: Set up Ruby
        uses: actions/[email protected]
        with:
          ruby-version: v2.6.x

      - name: Install dependencies
        run: |
          set -x
          gem install -N bundler circleci-bundle-update-pr

      - name: Set timezone to Asia/Tokyo
        run: |
          set -x
          cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime

      - name: run circleci-bundle-update-pr
        run: |
          set -x

          export CIRCLE_BRANCH=$(echo $GITHUB_REF | sed -e 's!refs/heads/!!g')
          export CIRCLE_PROJECT_USERNAME=$(echo $GITHUB_REPOSITORY | cut -d "/" -f 1)
          export CIRCLE_PROJECT_REPONAME=$(echo $GITHUB_REPOSITORY | cut -d "/" -f 2)

          git checkout -b $CIRCLE_BRANCH

          circleci-bundle-update-pr "${GIT_USER_NAME}" "${GIT_USER_EMAIL}"
        env:
          GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          GIT_USER_NAME:       "your name"
          GIT_USER_EMAIL:      "[email protected]"

Contributing

  1. Fork it ( https://github.com/masutaka/circleci-bundle-update-pr/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].