Commit cce6aace authored by Mateusz Gniewkowski's avatar Mateusz Gniewkowski

Merge branch 'Create-dockerfile' into 'master'

Create dockerfile

Closes #1

See merge request !2
parents ed71cd97 a3c5c2c1
Pipeline #2676 passed with stage
in 2 minutes and 15 seconds
build_image:
image: docker:18.09.7
only:
- master
services:
- 'docker:18.09.7-dind'
script:
- docker build -t clarinpl/editext .
- echo $DOCKER_PASSWORD > pass.txt
- cat pass.txt | docker login --username $DOCKER_USERNAME --password-stdin
- rm pass.txt
- docker push clarinpl/editext
FROM clarinpl/cpp:16.04
RUN apt-get update && \
apt-get install -y \
cmake g++ \
libboost-all-dev \
libicu-dev \
libloki-dev \
wsnlp=1.0.0 \
pwrutils \
toki
WORKDIR /home/install
COPY . editext/
RUN mkdir editext/bin && \
cd editext/bin && \
cmake .. && \
make -j && \
cd .. && mkdir /home/worker && mv bin/ediText /home/worker/ediText && \
cd /home && rm -r /home/install
WORKDIR /home/worker
COPY nkjp.ini .
RUN chmod +x ./ediText
CMD ["./ediText"]
...@@ -21,6 +21,7 @@ public: ...@@ -21,6 +21,7 @@ public:
void process(string task_path, ptree &config, string output_path); void process(string task_path, ptree &config, string output_path);
void static_init(ptree config); void static_init(ptree config);
void init(ptree config); void init(ptree config);
void process(boost::property_tree::ptree &data, boost::property_tree::ptree &options);
private: private:
}; };
...@@ -36,6 +37,10 @@ void ediText_Worker::init(ptree config) ...@@ -36,6 +37,10 @@ void ediText_Worker::init(ptree config)
void ediText_Worker::process(string task_path, ptree &config, string output_path) void ediText_Worker::process(string task_path, ptree &config, string output_path)
{ {
if(config.empty())
{
throw std::invalid_argument("Unspecified task options");
}
std::ifstream input(task_path); std::ifstream input(task_path);
std::ofstream output(output_path); std::ofstream output(output_path);
ConfigParser conf(config); ConfigParser conf(config);
...@@ -69,6 +74,11 @@ void ediText_Worker::process(string task_path, ptree &config, string output_path ...@@ -69,6 +74,11 @@ void ediText_Worker::process(string task_path, ptree &config, string output_path
output << buffer1.rdbuf(); output << buffer1.rdbuf();
} }
void ediText_Worker::process(boost::property_tree::ptree &data, boost::property_tree::ptree &options)
{
;
}
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
run_workers<ediText_Worker>(argc,argv); run_workers<ediText_Worker>(argc,argv);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment