Skip to content

Commit

Permalink
Execute installation as non-root user
Browse files Browse the repository at this point in the history
See: #416
  • Loading branch information
kornicameister authored Apr 26, 2020
1 parent 302cb59 commit bd878ae
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
x-build-steps: &build_steps
steps:
- run:
name: Install prerequistes
name: Install prerequisites
command: |
apt-get update -qq
apt-get install apt-utils -yqq
Expand Down Expand Up @@ -35,16 +35,23 @@ x-build-steps: &build_steps
apt-get autoclean -yqq
apt-get autoremove -yqq
- run:
name: Add non-root user
command: |
adduser ${CIRCLE_PROJECT_USERNAME}
usermod -aG sudo ${CIRCLE_PROJECT_USERNAME}
- run:
name: Run an installation
command: |
./install \
"${CIRCLE_PROJECT_USERNAME}" \
"${CIRCLE_BUILD_NUM}" \
"${CIRCLE_PROJECT_USERNAME}@${CIRCLE_PROJECT_REPONAME}.M" \
"Circle Builds" \
"${CIRCLE_SHA1}" \
"555-WAKATIME-BOGUS-API-KEY"
su - ${CIRCLE_PROJECT_USERNAME} -c '
./install \
"${CIRCLE_PROJECT_USERNAME}" \
"${CIRCLE_BUILD_NUM}" \
"${CIRCLE_PROJECT_USERNAME}@${CIRCLE_PROJECT_REPONAME}.M" \
"Circle Builds" \
"${CIRCLE_SHA1}" \
"555-WAKATIME-BOGUS-API-KEY"
'
- run:
name: Verify !
command: |
Expand Down

0 comments on commit bd878ae

Please sign in to comment.