Skip to content

Commit

Permalink
circleci
Browse files Browse the repository at this point in the history
  • Loading branch information
bart84ek committed Jul 26, 2019
1 parent 0def85a commit 1a8e865
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 11 deletions.
10 changes: 6 additions & 4 deletions circleci/Oyafile
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
Project: cricleci
Project: circleci

Values:
image: circleci/ruby:2.5-node-browsers
env:

generate : |
BasePath=${Oya[BasePath]}
proceed="$($BasePath/overwrite.sh)"
if [ "$proceed" = "Y" ]; then
echo "Generating circleCI config"
image="$($BasePath/detectImage.sh)"
oya render $BasePath/config.yml
oya_ver=$(oya --version)
oya render -s circleci --set env.oya_ver="$oya_ver" $BasePath/config.yml
mkdir -p .circleci
mv config.yml .circleci/.
echo -e "\033[0;32m Oya circleCI generated."
echo -e "\033[0;31m [Warning] \033[0m You have to edit your Oyafile to add onPush and onMergeToMaster hooks."
echo -e "Oya circleCI generated."
echo -e "[Warning] You have to edit your Oyafile to add onPush and onMergeToMaster hooks."
echo " Check README if you dont know how to do it."
fi
14 changes: 11 additions & 3 deletions circleci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,18 @@
After generate Oyafile needs to be changed by adding onPush and onMergeToMaster hooks. eg:

```
Project:
Project: CircleCiPack
Require:
github.com/tooploox/oya-packs/circleci: v0.0.3
Import:
heroku: github.com/tooploox/packs/heroku
ci: github..
circleci: github.com/tooploox/oya-packs/circleci
Values:
circleci:
env:
project_name: 'Project'
onPush: |
bundle install
Expand Down
10 changes: 6 additions & 4 deletions circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
defaults: &defaults
working_directory: ~/oya-project
docker:
- image: $image
- image: <%= image %>
environment:
RAILS_ENV: test
<%= for (key, val) in env { %>
<%= Upper(key) %>: <%= val %>
<% } %>

version: 2
jobs:
Expand All @@ -13,8 +15,8 @@ jobs:
- checkout
- attach_workspace:
at: ~/oya-project
- run: curl -O https://s3.eu-central-1.amazonaws.com/oyabinary/oya
- run: chmod +x oya
- run: wget https://github.com/mozilla/sops/releases/download/3.3.1/sops_3.3.1_amd64.deb && dpkg -i sops_3.3.1_amd64.deb
- run: curl https://oya.sh/get | bash
- persist_to_workspace:
root: .
paths:
Expand Down

0 comments on commit 1a8e865

Please sign in to comment.