Closed ivanperez-keera closed 9 months ago
Change Manager: Verified that:
Solution is implemented:
FROM ubuntu:trusty
RUN apt-get update
RUN apt-get install --yes software-properties-common RUN add-apt-repository ppa:hvr/ghc RUN apt-get update
RUN apt-get install --yes ghc-8.6.5 cabal-install-2.4 RUN apt-get install --yes libz-dev
ENV PATH=/opt/ghc/8.6.5/bin:/opt/cabal/2.4/bin:$PWD/.cabal-sandbox/bin:$PATH
RUN cabal update RUN cabal v1-sandbox init RUN cabal v1-install alex happy RUN apt-get install --yes git
CMD git clone $REPO && \ cd $NAME && \ git checkout $COMMIT && \ cd .. && \ cabal v1-install $NAME/ogma-cli/ $NAME/ogma-core/ --enable-tests --constraint "ogma-language-fret-reqs -test" && \ cabal v1-install $NAME/ogma-cli/ $NAME/ogma-core/ --enable-tests --constraint "ogma-language-fret-reqs -test" --run-tests -j1
Command:
```sh
$ docker run -e "REPO=https://github.com/nasa/ogma" -e "NAME=ogma" -e PAT="ogma-" -e "COMMIT=448465b5d5bdbb4d62f051d7a27a475e1bdbc417" -it ogma-test
--- Dockerfile
FROM ubuntu:trusty
RUN apt-get update
RUN apt-get install --yes software-properties-common RUN add-apt-repository ppa:hvr/ghc RUN apt-get update
RUN apt-get install --yes ghc-8.6.5 cabal-install-2.4 RUN apt-get install --yes libz-dev
ENV PATH=/opt/ghc/8.6.5/bin:/opt/cabal/2.4/bin:$PWD/.cabal-sandbox/bin:$PATH
RUN cabal update RUN cabal v1-sandbox init RUN cabal v1-install alex happy RUN apt-get install --yes git
ADD sample.json /tmp/
RUN cabal v1-install BNFC copilot-3.18.1
CMD git clone $REPO && \ cd $NAME && \ git checkout $COMMIT && \ cd .. && \ cabal v1-install $NAME/$PAT**/ && \ ogma fret-component-spec --fret-file-name /tmp/sample.json > sample.hs && \ cabal v1-exec -- runhaskell sample.hs && \ echo "Success"
-- sample.json { "RTSASpec": { "Internal_variables": [], "Other_variables": [ {"name":"param", "type":"bool"} ], "Requirements": [ { "name": "one", "CoCoSpecCode": "true", "ptLTL": "((H (param) ))", "fretish": "Meaning not specified" } ] } }
Command:
$ docker run -e "REPO=https://github.com/nasa/ogma" -e "NAME=ogma" -e PAT="ogma-" -e "COMMIT=448465b5d5bdbb4d62f051d7a27a475e1bdbc417" -it ogma-verify-120
Use the same name substitution when generating
trigger
calls inSpec2Copilot
, as prescribed in the solution proposed for #120.