Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execute installation as non-root user #854

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -37,16 +37,23 @@ x-build-steps: &build_steps

apt-get autoclean -yqq
apt-get autoremove -yqq
- run:
name: Add non-root user
command: |
useradd -ms /bin/bash ${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 -l -p -c '
./install \
"${CIRCLE_PROJECT_USERNAME}" \
"${CIRCLE_BUILD_NUM}" \
"${CIRCLE_PROJECT_USERNAME}@${CIRCLE_PROJECT_REPONAME}.M" \
"Circle Builds" \
"${CIRCLE_SHA1}" \
"555-WAKATIME-BOGUS-API-KEY"
' ${CIRCLE_PROJECT_USERNAME}
- run:
name: Verify !
command: |
Expand Down