Skip to content

Commit

Permalink
Merge pull request #57 from ChicoState/devops
Browse files Browse the repository at this point in the history
Updated devops with instructions for volume bind mount and default repo copied into container's working directory
  • Loading branch information
kbuffardi authored Oct 8, 2023
2 parents 3d20399 + 0fb96db commit 46d6396
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ RUN apt-get update && \
COPY . ./
RUN dos2unix *

# Load repo into image
COPY . ${WORKDIR}

# Run static analysis
CMD pmccabe *.cpp -v && \
cccc --lang=c++ --outdir=report *.cpp
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,8 @@ To run static analysis in the dev container:
docker run -it cpp-analysis
```

Or to run it with binding to changes to source code (but not the container configuration) use the above command with the added options `--mount type=bind,source="$(pwd)",target=/usr/src` *before* the container name.
To bind file changes between the host and container:

```
docker run -v "$(pwd)":/usr/src -it cpp-analysis
```
3 changes: 0 additions & 3 deletions dictionary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ void dictionary::load_dictionary(std::string file){
std::vector <std::string> temp;

if( read.is_open() ){

std::string word;
while( getline(read,word) ){
//convert every word to UPPER CASE
Expand All @@ -26,8 +25,6 @@ void dictionary::load_dictionary(std::string file){
}
temp.push_back(word);
}


if( temp.size() > 0 ){
words = temp;
dictionary_file = file;
Expand Down

0 comments on commit 46d6396

Please sign in to comment.