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

[IMP] t2d: add new argument --build-extra-steps #210

Merged
merged 2 commits into from
Nov 27, 2023

Conversation

antonag32
Copy link
Contributor

Similar to --run-extra-cmds, --build-extra-cmds, this new argument allows users to add extra steps at the end of the generated Dockerfile.

Closes #209.

Previous CI and tox runs apparently lied. This is because tests run
against the main branch upstream, and not against the source code.

This generates false positives/negatives that are only found when a
merge completes but spending time fixing it is not a priority as of now.
Therefore the quickfix of adding the file back has been chosen.
@antonag32 antonag32 marked this pull request as draft November 9, 2023 02:26
@codecov-commenter
Copy link

codecov-commenter commented Nov 9, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (485b1e8) 79.29% compared to head (4376286) 79.36%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #210      +/-   ##
==========================================
+ Coverage   79.29%   79.36%   +0.06%     
==========================================
  Files           7        7              
  Lines         594      596       +2     
  Branches      108      108              
==========================================
+ Hits          471      473       +2     
  Misses         90       90              
  Partials       33       33              
Files Coverage Δ
src/travis2docker/cli.py 76.69% <100.00%> (+0.22%) ⬆️
src/travis2docker/travis2docker.py 82.47% <100.00%> (+0.06%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@antonag32 antonag32 marked this pull request as ready for review November 10, 2023 03:26
@antonag32
Copy link
Contributor Author

Tested with the following args:

--deployv
--docker-image quay.io/vauxoo/kukyflor:kukyflor-16.0-44740fa
--build-extra-steps "RUN echo hello" "RUN echo bye"
[email protected]:vauxoo/kukyflor.git 16.0

And the resulting Dockerfile:

FROM quay.io/vauxoo/kukyflor:kukyflor-16.0-44740fa

ARG HOME=/home/odoo

# rm -rf /home/odoo/.ssh
COPY .ssh $HOME/.ssh

COPY build.sh /home/odoo/build.sh

COPY entrypoint_deployv.sh /entrypoint.sh

COPY docker_helper /home/odoo/build

COPY .vscode /home/odoo/.vscode

COPY .coveragerc /home/odoo/.coveragerc
RUN chown -R odoo:odoo $HOME/.ssh;chown -R odoo:odoo /home/odoo/build.sh;chown -R odoo:odoo /entrypoint.sh;chown -R odoo:odoo /home/odoo/build;chown -R odoo:odoo /home/odoo/.vscode;chown -R odoo:odoo /home/odoo/.coveragerc;

ENV ODOORC_DB_NAME=odoo ODOORC_PIDFILE=/home/odoo/.odoo.pid ODOORC_DATA_DIR=/home/odoo/data_dir PROFILE_FILE=/etc/bash.bashrc MAIN_REPO_FULL_PATH=/home/odoo/instance/$MAIN_REPO_PATH DEB_PYTHON_INSTALL_LAYOUT=deb
ENV COVERAGE_RCFILE=$HOME/.coveragerc
ENV COVERAGE_HOME=$MAIN_REPO_FULL_PATH



# Create cluster with odoo as owner and use environment variables instead of odoo cfg to connect
RUN . /home/odoo/build.sh && \
    install_dev_tools && \
    service_postgres_without_sudo odoo odoo && \
    install_pgcli_venv && \
    custom_alias && \
    odoo_conf && \
    git_set_remote && \
    bash_colorized && \
    setup_coverage && \
    configure_vim && \
    configure_zsh && \
    chown_all && \
    set_authorized_keys && \
    mv /entrypoint_image /deployv_entrypoint_image && \
    mv /entry_point.py /deployv_entry_point.py && \
    mkdir /run/sshd


USER odoo

# TODO: Use .profile as bash profiler by default

ENTRYPOINT /entrypoint.sh

WORKDIR $MAIN_REPO_FULL_PATH

RUN echo hello

RUN echo bye

@antonag32
Copy link
Contributor Author

CI fails but that's because I deleted .travis.yaml on a previous commit and did not realize it would break, since tests run against the main branch upstream and not local code. I have added it back and once merged, tests should pass. Tested it on my fork>

https://github.com/antonag32/travis2docker/actions/runs/6826672573

Similar to --run-extra-cmds, --build-extra-cmds, this new argument
allows users to add extra steps at the end of the generated Dockerfile.

Closes Vauxoo#209.
Copy link
Contributor

@luisg123v luisg123v left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@luisg123v luisg123v merged commit 5357a7f into Vauxoo:main Nov 27, 2023
3 of 18 checks passed
@luisg123v luisg123v deleted the i209-anton branch November 27, 2023 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Is --run-extra-cmds param working as expected?
3 participants