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

Upgrade the example #7

Open
jabrena opened this issue Nov 15, 2022 · 10 comments
Open

Upgrade the example #7

jabrena opened this issue Nov 15, 2022 · 10 comments

Comments

@jabrena
Copy link
Contributor

jabrena commented Nov 15, 2022

I am going to review the example to upgrade:

  • Dockerfile -> Upgrade to Java 17
  • pom.xml -> Upgrade from Spring Boot 2.1.8.RELEASE to Spring Boot 3
@pchico83
Copy link
Contributor

@jabrena that would be awesome, thanks!

@jabrena
Copy link
Contributor Author

jabrena commented Nov 15, 2022

Hi @pchico83,

I have few questions about okteto.yml

The Docker image is generated from this section:

build:
  hello-world:
    image: okteto.dev/java-maven-hello-world:1.0.0
    context: .

Does exist a way to run a maven goal like:

mvn package spring-boot:buildImage

or it is possible to run a bash script for complex scenarios?

Where is located the documentation about octeto.yml?

@pchico83
Copy link
Contributor

@jabrena The documentation is here:
https://www.okteto.com/docs/reference/manifest/

You could use the deploy section to run mvn commands. But that would only work if you have mvn installed locally, which we cannot assume

@jabrena
Copy link
Contributor Author

jabrena commented Nov 15, 2022

I am thinking that maybe it is better to run everything in a multi layer Dockerfile and continue with the normal workflow.

I will do some experiments before sending the PR

Many thanks in advance @pchico83

@jabrena
Copy link
Contributor Author

jabrena commented Jan 13, 2023

Hi @pchico83,

I am testing the changes in my branch:
https://github.com/jabrena/java-maven-getting-started/tree/feature/upgrade-sb-3

but I would like to import in Okteto cloud my repository:
https://cloud.okteto.com/deploy?repository=https://github.com/jabrena/java-maven-getting-started/tree/feature/upgrade-sb-3

but what it the right way to use the endpoint:

-https://cloud.okteto.com/deploy?repository=REPOSITORY_X

in order to indicate the right branch to clone?
Currently, the system only clone the default git branch but I would like to clone a specific branch to run the whole process.

"okteto" has been added to your repositoriesHang tight while we grab the latest from your chart repositories......
Successfully got an update from the "okteto" chart repositoryUpdate Complete. 
⎈Happy Helming!⎈
checkout command: '[git clone --depth 1 https://github.com/jabrena/java-maven-getting-started/tree/feature/upgrade-sb-3 /okteto/src]'
Cloning git repository 'https://github.com/jabrena/java-maven-getting-started/tree/feature/upgrade-sb-3'...
Cloning into '/okteto/src'...fatal: repository 'https://github.com/jabrena/java-maven-getting-started/tree/feature/upgrade-sb-3/' not found
failed to clone repository with URL 'https://github.com/jabrena/java-maven-getting-started/tree/feature/upgrade-sb-3'git-pull

With my tests executed, I will send the PR.

Tell me

Juan Antonio

@pchico83
Copy link
Contributor

Hi @pchico83,

I am testing the changes in my branch: https://github.com/jabrena/java-maven-getting-started/tree/feature/upgrade-sb-3

but I would like to import in Okteto cloud my repository: https://cloud.okteto.com/deploy?repository=https://github.com/jabrena/java-maven-getting-started/tree/feature/upgrade-sb-3

but what it the right way to use the endpoint:

-https://cloud.okteto.com/deploy?repository=REPOSITORY_X

in order to indicate the right branch to clone? Currently, the system only clone the default git branch but I would like to clone a specific branch to run the whole process.

"okteto" has been added to your repositoriesHang tight while we grab the latest from your chart repositories......
Successfully got an update from the "okteto" chart repositoryUpdate Complete. 
⎈Happy Helming!⎈
checkout command: '[git clone --depth 1 https://github.com/jabrena/java-maven-getting-started/tree/feature/upgrade-sb-3 /okteto/src]'
Cloning git repository 'https://github.com/jabrena/java-maven-getting-started/tree/feature/upgrade-sb-3'...
Cloning into '/okteto/src'...fatal: repository 'https://github.com/jabrena/java-maven-getting-started/tree/feature/upgrade-sb-3/' not found
failed to clone repository with URL 'https://github.com/jabrena/java-maven-getting-started/tree/feature/upgrade-sb-3'git-pull

With my tests executed, I will send the PR.

Tell me

Juan Antonio

@jabrena you can do things like this:

https://cloud.okteto.com/deploy?repository=https://github.com/okteto/movies&branch=main

@jabrena
Copy link
Contributor Author

jabrena commented Jan 13, 2023

I have just sent a PR with the changes:
#8

It is working fine, can you squash and merge when you have time?

@jabrena
Copy link
Contributor Author

jabrena commented Jan 13, 2023

Hi @pchico83,

Something that I don´t understand is the image used in the deployment:

2023-01-13 15:36:32.02 UTChello-world-dcf754c59-cwl6thello-world
2023-01-13 15:36:32.02 UTChello-world-dcf754c59-cwl6thello-world . ____ _ __ _ _
2023-01-13 15:36:32.02 UTChello-world-dcf754c59-cwl6thello-world /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
2023-01-13 15:36:32.02 UTChello-world-dcf754c59-cwl6thello-world( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
2023-01-13 15:36:32.02 UTChello-world-dcf754c59-cwl6thello-world \\/ ___)| |_)| | | | | || (_| | ) ) ) )
2023-01-13 15:36:32.02 UTChello-world-dcf754c59-cwl6thello-world ' |____| .__|_| |_|_| |_\__, | / / / /
2023-01-13 15:36:32.02 UTChello-world-dcf754c59-cwl6thello-world =========|_|==============|___/=/_/_/_/
2023-01-13 15:36:32.02 UTChello-world-dcf754c59-cwl6thello-world :: Spring Boot :: (v2.1.8.RELEASE)
2023-01-13 15:36:32.02 UTChello-world-dcf754c59-cwl6thello-world
2023-01-13 15:36:32.64 UTChello-world-dcf754c59-cwl6thello-world2023-01-13 15:36:32.638 INFO 7 --- [ main] com.oktet

It is not using the latest image. Why?

@jabrena
Copy link
Contributor Author

jabrena commented Jan 13, 2023

I found the address in the logs:

Image 'registry.cloud.okteto.net/jabrena/java-maven-hello-world:1.0.0' successfully pushed

is it necessary to change something in okteto.yml or k8s.yml?

@pchico83
Copy link
Contributor

@jabrena it's using a fixed image:
https://github.com/okteto/java-maven-getting-started/blob/main/k8s.yml#L15

If you want to get the latest changes, restart the pod and it will pull the latest changes.
I reverted your changes because we were getting runtime errors after okteto deploy --build, could you have a look and re-submmit the PR?

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

No branches or pull requests

2 participants