[Add] MJIflyMSC 0.1.2
[CocoaPods.git] / .circleci / config.yml
blob35726cbf6b8fae33d4d56b5ccdc31f7ba4bd1110
1 version: 2.1
3 orbs:
4   queue: eddiewebb/queue@1.1.2
6 commands:
7   checkout-indexes:
8     steps:
9       - run:
10           name: Checkout
11           command: |
12             mkdir -p ~/.ssh
14             echo 'github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==' >> ~/.ssh/known_hosts
16             if [ -e "/home/circleci/project/.git" ]
17             then
18               cd "/home/circleci/project"
19               git remote set-url origin "$CIRCLE_REPOSITORY_URL" || true
21               echo "Fetching $INDEXES_BRANCH ..."
22               git fetch --force origin "$INDEXES_BRANCH:remotes/origin/$INDEXES_BRANCH"
24               echo "Resetting to origin/$INDEXES_BRANCH"
25               git reset --hard "origin/$INDEXES_BRANCH"
26             else
27               mkdir -p "/home/circleci/project"
28               cd "/home/circleci/project"
29               echo "Cloning $INDEXES_BRANCH ..."
30               git clone "$CIRCLE_REPOSITORY_URL" --single-branch --branch "$INDEXES_BRANCH" .
31             fi
33             echo "Fetching '$CIRCLE_BRANCH' ..."
34             git fetch --force origin "$CIRCLE_BRANCH:remotes/origin/$CIRCLE_BRANCH"
36 jobs:
37   update-indexes:
38     docker:
39        - image: circleci/ruby:2.4.1
40     environment:
41       INDEXES_BRANCH: indexes
42     steps:
43       - queue/until_front_of_line
44       - restore_cache:
45           keys:
46             - indexes-source-{{ .Branch }}-{{ .Revision }}
47             - indexes-source-{{ .Branch }}-
48             - indexes-source-
49       - checkout-indexes
50       - run:
51           name: Git config
52           command: |
53             git config --global user.email "cocoapods@users.noreply.github.com"
54             git config --global user.name "cocoapods"
55       - add_ssh_keys:
56           fingerprints:
57             - "d1:7c:fc:8a:17:63:75:8e:ee:01:13:05:2b:28:ca:49"
58       - run:
59           name: Rebase latest changes
60           command: git rebase "$CIRCLE_SHA1"
61       - run:
62           name: Generate indexes for the changes
63           command: |
64             ./Scripts/add_incremental_index.sh "origin/$INDEXES_BRANCH" "$CIRCLE_SHA1" | tee /dev/tty | xargs git add
65       - run:
66           name: Amend commit and force push the changes
67           command: |
68             git commit --amend --date="$(date -R)" --no-edit --quiet
69             git push origin :"$INDEXES_BRANCH" # Temporary workaround for -f not working below
70             git push origin "$INDEXES_BRANCH"
71       - save_cache:
72           key: indexes-source-{{ .Branch }}-{{ .Revision }}
73           paths:
74             - ".git"
76 workflows:
77   update-indexes:
78     jobs:
79       - update-indexes:
80           filters:
81             branches:
82               only: master